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] The entire array of values in Metrics is stringified #187968

Closed
teresaalvarezsoler opened this issue Jul 10, 2024 · 1 comment · Fixed by #187982
Closed

[Lens] The entire array of values in Metrics is stringified #187968

teresaalvarezsoler opened this issue Jul 10, 2024 · 1 comment · Fixed by #187982
Labels
Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@teresaalvarezsoler
Copy link

Problem
We recently adde the ability of showing fields that have array of values in the new Metric in order to take a step further to deprecate the legacy Metric.

However, we show the values in the array with quotes because we are stringfying the entire array instead of each value separately.

Image

This is not happening in other Lens charts such as tables where we show a nicer representation of the array without quotes.
Image

@teresaalvarezsoler teresaalvarezsoler added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jul 10, 2024
@elasticmachine
Copy link
Contributor

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

@teresaalvarezsoler teresaalvarezsoler added Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Jul 10, 2024
@teresaalvarezsoler teresaalvarezsoler changed the title [Lens] The entire array of values in Metrics are stringified [Lens] The entire array of values in Metrics is stringified Jul 10, 2024
@dej611 dej611 closed this as completed in 61de0b0 Jul 11, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue 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 added a commit that referenced this issue 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":"#187982
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":"#187982
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
Feature:Lens impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants