[Lens] Forward secondary prefix correctly when state value is an empty string (None option)#228183
Conversation
|
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
markov00
left a comment
There was a problem hiding this comment.
Thanks, it works fine.
I believe we should improve that "prefix" label in the form to be more a show/hide label/name than prefix. auto doesn't have much sense, because I believe we are not doing anything special there, custom is just an override of the Name, and none is the hide.
There is no need to have 2 different naming, one just for the table output in the inspector and one only used in the visualization.
Could you please open an issue for this improvement? thanks
I believe this will be improved when we add the new version of the metric chart. We will update the Secondary Metric settings and "prefix" won't make sense anymore because we will add the possibility of adding it before or after the value/badge. |
|
Starting backport for target branches: 8.19, 9.1 |
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
…y string (`None` option) (elastic#228183) Closes elastic#227281 ## Summary When going from state to expression, the secondaryPrefix value wasn't forwarded correctly when the secondaryPrefix state value was an empty string (the empty string is set in the state when the Prefix "None" option is selected in settings). It was forwarded as `undefined`, causing showing the column name as the prefix on: https://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255 #### After: https://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit d1846d3)
…y string (`None` option) (elastic#228183) Closes elastic#227281 ## Summary When going from state to expression, the secondaryPrefix value wasn't forwarded correctly when the secondaryPrefix state value was an empty string (the empty string is set in the state when the Prefix "None" option is selected in settings). It was forwarded as `undefined`, causing showing the column name as the prefix on: https://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255 #### After: https://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit d1846d3)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…n empty string (`None` option) (#228183) (#228424) # Backport This will backport the following commits from `main` to `9.1`: - [[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)](#228183) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maria Iriarte","email":"106958839+mariairiartef@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-17T10:49:51Z","message":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)\n\nCloses https://github.com/elastic/kibana/issues/227281\n\n## Summary\n\nWhen going from state to expression, the secondaryPrefix value wasn't\nforwarded correctly when the secondaryPrefix state value was an empty\nstring (the empty string is set in the state when the Prefix \"None\"\noption is selected in settings). It was forwarded as `undefined`,\ncausing showing the column name as the prefix on:\n\n\nhttps://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255\n\n#### After:\n\n\nhttps://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f\n\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"d1846d304a43606f9d3be7e38323e14eb64ef1a6","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Visualizations","Feature:Lens","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option)","number":228183,"url":"https://github.com/elastic/kibana/pull/228183","mergeCommit":{"message":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)\n\nCloses https://github.com/elastic/kibana/issues/227281\n\n## Summary\n\nWhen going from state to expression, the secondaryPrefix value wasn't\nforwarded correctly when the secondaryPrefix state value was an empty\nstring (the empty string is set in the state when the Prefix \"None\"\noption is selected in settings). It was forwarded as `undefined`,\ncausing showing the column name as the prefix on:\n\n\nhttps://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255\n\n#### After:\n\n\nhttps://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f\n\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"d1846d304a43606f9d3be7e38323e14eb64ef1a6"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228183","number":228183,"mergeCommit":{"message":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)\n\nCloses https://github.com/elastic/kibana/issues/227281\n\n## Summary\n\nWhen going from state to expression, the secondaryPrefix value wasn't\nforwarded correctly when the secondaryPrefix state value was an empty\nstring (the empty string is set in the state when the Prefix \"None\"\noption is selected in settings). It was forwarded as `undefined`,\ncausing showing the column name as the prefix on:\n\n\nhttps://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255\n\n#### After:\n\n\nhttps://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f\n\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"d1846d304a43606f9d3be7e38323e14eb64ef1a6"}}]}] BACKPORT--> Co-authored-by: Maria Iriarte <106958839+mariairiartef@users.noreply.github.com>
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
…an empty string (`None` option) (#228183) (#228423) # Backport This will backport the following commits from `main` to `8.19`: - [[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)](#228183) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maria Iriarte","email":"106958839+mariairiartef@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-17T10:49:51Z","message":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)\n\nCloses https://github.com/elastic/kibana/issues/227281\n\n## Summary\n\nWhen going from state to expression, the secondaryPrefix value wasn't\nforwarded correctly when the secondaryPrefix state value was an empty\nstring (the empty string is set in the state when the Prefix \"None\"\noption is selected in settings). It was forwarded as `undefined`,\ncausing showing the column name as the prefix on:\n\n\nhttps://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255\n\n#### After:\n\n\nhttps://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f\n\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"d1846d304a43606f9d3be7e38323e14eb64ef1a6","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Visualizations","Feature:Lens","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option)","number":228183,"url":"https://github.com/elastic/kibana/pull/228183","mergeCommit":{"message":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)\n\nCloses https://github.com/elastic/kibana/issues/227281\n\n## Summary\n\nWhen going from state to expression, the secondaryPrefix value wasn't\nforwarded correctly when the secondaryPrefix state value was an empty\nstring (the empty string is set in the state when the Prefix \"None\"\noption is selected in settings). It was forwarded as `undefined`,\ncausing showing the column name as the prefix on:\n\n\nhttps://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255\n\n#### After:\n\n\nhttps://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f\n\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"d1846d304a43606f9d3be7e38323e14eb64ef1a6"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228183","number":228183,"mergeCommit":{"message":"[Lens] Forward secondary prefix correctly when state value is an empty string (`None` option) (#228183)\n\nCloses https://github.com/elastic/kibana/issues/227281\n\n## Summary\n\nWhen going from state to expression, the secondaryPrefix value wasn't\nforwarded correctly when the secondaryPrefix state value was an empty\nstring (the empty string is set in the state when the Prefix \"None\"\noption is selected in settings). It was forwarded as `undefined`,\ncausing showing the column name as the prefix on:\n\n\nhttps://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255\n\n#### After:\n\n\nhttps://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f\n\n\n### Checklist\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"d1846d304a43606f9d3be7e38323e14eb64ef1a6"}}]}] BACKPORT--> Co-authored-by: Maria Iriarte <106958839+mariairiartef@users.noreply.github.com>
…y string (`None` option) (elastic#228183) Closes elastic#227281 ## Summary When going from state to expression, the secondaryPrefix value wasn't forwarded correctly when the secondaryPrefix state value was an empty string (the empty string is set in the state when the Prefix "None" option is selected in settings). It was forwarded as `undefined`, causing showing the column name as the prefix on: https://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255 #### After: https://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
…y string (`None` option) (elastic#228183) Closes elastic#227281 ## Summary When going from state to expression, the secondaryPrefix value wasn't forwarded correctly when the secondaryPrefix state value was an empty string (the empty string is set in the state when the Prefix "None" option is selected in settings). It was forwarded as `undefined`, causing showing the column name as the prefix on: https://github.com/elastic/kibana/blob/2928bdf1cb5f8fd648c6a46a52ae3f96b4b01a70/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx#L255 #### After: https://github.com/user-attachments/assets/1a104f9e-bf78-4acc-aca5-a3866c80d03f ### 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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
Closes #227281
Summary
When going from state to expression, the secondaryPrefix value wasn't forwarded correctly when the secondaryPrefix state value was an empty string (the empty string is set in the state when the Prefix "None" option is selected in settings). It was forwarded as
undefined, causing showing the column name as the prefix on:kibana/src/platform/plugins/shared/chart_expressions/expression_metric/public/components/secondary_metric.tsx
Line 255 in 2928bdf
After:
Screen.Recording.2025-07-16.at.12.16.00.mov
Checklist
release_note:*label is applied per the guidelinesbackport:*labels.