Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Fix multi-value formatting for metric #187982

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jul 10, 2024

Summary

Fixes #187968

It avoids the default JSON stringify behaviour around formatted values in multi-values scenarios for the new Metric chart type

Screenshot 2024-07-10 at 15 28 23

Added also a couple of unit tests to spot regressions in the area.

Checklist

@dej611 dej611 added Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v8.15.0 labels Jul 10, 2024
@dej611
Copy link
Contributor Author

dej611 commented Jul 10, 2024

/ci

@dej611 dej611 added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.16.0 labels Jul 10, 2024
@dej611 dej611 marked this pull request as ready for review July 10, 2024 16:36
@dej611 dej611 requested a review from a team as a code owner July 10, 2024 16:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #9 / CaseFormFields calls onSubmit with case fields
  • [job] [logs] Jest Tests #9 / CaseFormFields calls onSubmit with custom fields
  • [job] [logs] Jest Tests #9 / CaseFormFields renders correctly

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
expressionMetricVis 5.1KB 5.1KB +64.0B

@dej611 dej611 merged commit 61de0b0 into elastic:main Jul 11, 2024
35 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 11, 2024
## Summary

Fixes elastic#187968

It avoids the default JSON stringify behaviour around formatted values
in multi-values scenarios for the new Metric chart type

<img width="1504" alt="Screenshot 2024-07-10 at 15 28 23"
src="https://github.com/elastic/kibana/assets/924948/c52c5c5c-3004-4a3f-bdbf-612fdedd853a">

Added also a couple of unit tests to spot regressions in the area.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 61de0b0)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 11, 2024
# Backport

This will backport the following commits from `main` to `8.15`:
- [[Lens] Fix multi-value formatting for metric
(#187982)](#187982)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-07-11T08:20:17Z","message":"[Lens]
Fix multi-value formatting for metric (#187982)\n\n##
Summary\r\n\r\nFixes #187968\r\n\r\nIt avoids the default JSON stringify
behaviour around formatted values\r\nin multi-values scenarios for the
new Metric chart type\r\n\r\n\r\n<img width=\"1504\" alt=\"Screenshot
2024-07-10 at 15 28
23\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/c52c5c5c-3004-4a3f-bdbf-612fdedd853a\">\r\n\r\nAdded
also a couple of unit tests to spot regressions in the area.\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"61de0b022b4a9a515c9b1da8940130a9243aaa4b","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","backport:prev-minor","v8.15.0","v8.16.0"],"title":"[Lens]
Fix multi-value formatting for
metric","number":187982,"url":"https://github.com/elastic/kibana/pull/187982","mergeCommit":{"message":"[Lens]
Fix multi-value formatting for metric (#187982)\n\n##
Summary\r\n\r\nFixes #187968\r\n\r\nIt avoids the default JSON stringify
behaviour around formatted values\r\nin multi-values scenarios for the
new Metric chart type\r\n\r\n\r\n<img width=\"1504\" alt=\"Screenshot
2024-07-10 at 15 28
23\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/c52c5c5c-3004-4a3f-bdbf-612fdedd853a\">\r\n\r\nAdded
also a couple of unit tests to spot regressions in the area.\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"61de0b022b4a9a515c9b1da8940130a9243aaa4b"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187982","number":187982,"mergeCommit":{"message":"[Lens]
Fix multi-value formatting for metric (#187982)\n\n##
Summary\r\n\r\nFixes #187968\r\n\r\nIt avoids the default JSON stringify
behaviour around formatted values\r\nin multi-values scenarios for the
new Metric chart type\r\n\r\n\r\n<img width=\"1504\" alt=\"Screenshot
2024-07-10 at 15 28
23\"\r\nsrc=\"https://github.com/elastic/kibana/assets/924948/c52c5c5c-3004-4a3f-bdbf-612fdedd853a\">\r\n\r\nAdded
also a couple of unit tests to spot regressions in the area.\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"61de0b022b4a9a515c9b1da8940130a9243aaa4b"}}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.15.0 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] The entire array of values in Metrics is stringified
4 participants