[OnWeek][FieldFormatters] Update styles for Color formatter to look like a badge#189391
[OnWeek][FieldFormatters] Update styles for Color formatter to look like a badge#189391jughosta merged 26 commits intoelastic:mainfrom
Conversation
|
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
This reverts commit c4c348b.
|
/ci |
|
/ci |
|
/ci |
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
kertal
left a comment
There was a problem hiding this comment.
LGTM, as we aligned in our sync, this is just a visual change for the better, aligning it visually to how it looks like when contextual awareness in Discover is available. While it's true that the defined colors can collide with by value cell coloring in Lens, this is not introduced by this PR, which adds more padding and borderRadius. Tested it remotely (link) and works as expected. On top of that this PR saved a few lines of code by making the unit test better 👍 .
💚 Build Succeeded
Metrics [docs]Page load bundle
History
cc @jughosta |
|
Starting backport for target branches: 8.19 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…ike a badge (elastic#189391) ## Summary This PR updates the styles for Color formatter so it has `EuiBadge` look. `EuiBadge` is not used as it does not support multiline text. Ideally we could use a CSS class and move styles to it but since we are moving away from SCSS usage I haven't used it here. Also Emotion styles don't get applied when used inside the field formatter utils, so I went with a simpler solution which should work in any case and be relatively fast. Before: <img width="1744" alt="Screenshot 2025-02-27 at 16 05 42" src="https://github.com/user-attachments/assets/355c7a23-f6a4-406d-b2a2-f6aaa50d4648" /> After: <img width="1743" alt="Screenshot 2025-02-27 at 16 04 31" src="https://github.com/user-attachments/assets/3263e145-5387-4bd8-b7d8-54dd2ae7db24" /> <img width="1084" alt="Screenshot 2025-02-27 at 15 33 36" src="https://github.com/user-attachments/assets/12f3a197-24d2-4156-910d-ce02428643b1" /> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [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
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ike a badge (elastic#189391) ## Summary This PR updates the styles for Color formatter so it has `EuiBadge` look. `EuiBadge` is not used as it does not support multiline text. Ideally we could use a CSS class and move styles to it but since we are moving away from SCSS usage I haven't used it here. Also Emotion styles don't get applied when used inside the field formatter utils, so I went with a simpler solution which should work in any case and be relatively fast. Before: <img width="1744" alt="Screenshot 2025-02-27 at 16 05 42" src="https://github.com/user-attachments/assets/355c7a23-f6a4-406d-b2a2-f6aaa50d4648" /> After: <img width="1743" alt="Screenshot 2025-02-27 at 16 04 31" src="https://github.com/user-attachments/assets/3263e145-5387-4bd8-b7d8-54dd2ae7db24" /> <img width="1084" alt="Screenshot 2025-02-27 at 15 33 36" src="https://github.com/user-attachments/assets/12f3a197-24d2-4156-910d-ce02428643b1" /> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [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 87da92b) # Conflicts: # x-pack/platform/plugins/private/translations/translations/fr-FR.json # x-pack/platform/plugins/private/translations/translations/ja-JP.json # x-pack/platform/plugins/private/translations/translations/zh-CN.json
… look like a badge (#189391) (#219762) # Backport This will backport the following commits from `main` to `8.19`: - [[OnWeek][FieldFormatters] Update styles for Color formatter to look like a badge (#189391)](#189391) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2025-04-29T18:34:07Z","message":"[OnWeek][FieldFormatters] Update styles for Color formatter to look like a badge (#189391)\n\n## Summary\n\nThis PR updates the styles for Color formatter so it has `EuiBadge`\nlook. `EuiBadge` is not used as it does not support multiline text.\nIdeally we could use a CSS class and move styles to it but since we are\nmoving away from SCSS usage I haven't used it here. Also Emotion styles\ndon't get applied when used inside the field formatter utils, so I went\nwith a simpler solution which should work in any case and be relatively\nfast.\n\nBefore:\n<img width=\"1744\" alt=\"Screenshot 2025-02-27 at 16 05 42\"\nsrc=\"https://github.com/user-attachments/assets/355c7a23-f6a4-406d-b2a2-f6aaa50d4648\"\n/>\n\nAfter:\n<img width=\"1743\" alt=\"Screenshot 2025-02-27 at 16 04 31\"\nsrc=\"https://github.com/user-attachments/assets/3263e145-5387-4bd8-b7d8-54dd2ae7db24\"\n/>\n\n<img width=\"1084\" alt=\"Screenshot 2025-02-27 at 15 33 36\"\nsrc=\"https://github.com/user-attachments/assets/12f3a197-24d2-4156-910d-ce02428643b1\"\n/>\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\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","sha":"87da92bf3da6382271c0421b0117320744fbb54c","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Feature:FieldFormatters","Team:DataDiscovery","backport:version","v9.1.0","v8.19.0"],"title":"[OnWeek][FieldFormatters] Update styles for Color formatter to look like a badge","number":189391,"url":"https://github.com/elastic/kibana/pull/189391","mergeCommit":{"message":"[OnWeek][FieldFormatters] Update styles for Color formatter to look like a badge (#189391)\n\n## Summary\n\nThis PR updates the styles for Color formatter so it has `EuiBadge`\nlook. `EuiBadge` is not used as it does not support multiline text.\nIdeally we could use a CSS class and move styles to it but since we are\nmoving away from SCSS usage I haven't used it here. Also Emotion styles\ndon't get applied when used inside the field formatter utils, so I went\nwith a simpler solution which should work in any case and be relatively\nfast.\n\nBefore:\n<img width=\"1744\" alt=\"Screenshot 2025-02-27 at 16 05 42\"\nsrc=\"https://github.com/user-attachments/assets/355c7a23-f6a4-406d-b2a2-f6aaa50d4648\"\n/>\n\nAfter:\n<img width=\"1743\" alt=\"Screenshot 2025-02-27 at 16 04 31\"\nsrc=\"https://github.com/user-attachments/assets/3263e145-5387-4bd8-b7d8-54dd2ae7db24\"\n/>\n\n<img width=\"1084\" alt=\"Screenshot 2025-02-27 at 15 33 36\"\nsrc=\"https://github.com/user-attachments/assets/12f3a197-24d2-4156-910d-ce02428643b1\"\n/>\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\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","sha":"87da92bf3da6382271c0421b0117320744fbb54c"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/189391","number":189391,"mergeCommit":{"message":"[OnWeek][FieldFormatters] Update styles for Color formatter to look like a badge (#189391)\n\n## Summary\n\nThis PR updates the styles for Color formatter so it has `EuiBadge`\nlook. `EuiBadge` is not used as it does not support multiline text.\nIdeally we could use a CSS class and move styles to it but since we are\nmoving away from SCSS usage I haven't used it here. Also Emotion styles\ndon't get applied when used inside the field formatter utils, so I went\nwith a simpler solution which should work in any case and be relatively\nfast.\n\nBefore:\n<img width=\"1744\" alt=\"Screenshot 2025-02-27 at 16 05 42\"\nsrc=\"https://github.com/user-attachments/assets/355c7a23-f6a4-406d-b2a2-f6aaa50d4648\"\n/>\n\nAfter:\n<img width=\"1743\" alt=\"Screenshot 2025-02-27 at 16 04 31\"\nsrc=\"https://github.com/user-attachments/assets/3263e145-5387-4bd8-b7d8-54dd2ae7db24\"\n/>\n\n<img width=\"1084\" alt=\"Screenshot 2025-02-27 at 15 33 36\"\nsrc=\"https://github.com/user-attachments/assets/12f3a197-24d2-4156-910d-ce02428643b1\"\n/>\n\n\n### Checklist\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\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","sha":"87da92bf3da6382271c0421b0117320744fbb54c"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…ike a badge (elastic#189391) ## Summary This PR updates the styles for Color formatter so it has `EuiBadge` look. `EuiBadge` is not used as it does not support multiline text. Ideally we could use a CSS class and move styles to it but since we are moving away from SCSS usage I haven't used it here. Also Emotion styles don't get applied when used inside the field formatter utils, so I went with a simpler solution which should work in any case and be relatively fast. Before: <img width="1744" alt="Screenshot 2025-02-27 at 16 05 42" src="https://github.com/user-attachments/assets/355c7a23-f6a4-406d-b2a2-f6aaa50d4648" /> After: <img width="1743" alt="Screenshot 2025-02-27 at 16 04 31" src="https://github.com/user-attachments/assets/3263e145-5387-4bd8-b7d8-54dd2ae7db24" /> <img width="1084" alt="Screenshot 2025-02-27 at 15 33 36" src="https://github.com/user-attachments/assets/12f3a197-24d2-4156-910d-ce02428643b1" /> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [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
Summary
This PR updates the styles for Color formatter so it has
EuiBadgelook.EuiBadgeis not used as it does not support multiline text. Ideally we could use a CSS class and move styles to it but since we are moving away from SCSS usage I haven't used it here. Also Emotion styles don't get applied when used inside the field formatter utils, so I went with a simpler solution which should work in any case and be relatively fast.Before:

After:

Checklist