Skip to content

Commit

Permalink
[9.0] [ColorMapping] Fix palette key mapping for legacy palette ids (#…
Browse files Browse the repository at this point in the history
…211858) (#211920)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[ColorMapping] Fix palette key mapping for legacy palette ids
(#211858)](#211858)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Nick
Partridge","email":"nicholas.partridge@elastic.co"},"sourceCommit":{"committedDate":"2025-02-20T15:31:55Z","message":"[ColorMapping]
Fix palette key mapping for legacy palette ids (#211858)\n\nCurrently,
palettes with the legacy palette id of `eui_amsterdam_color_blind`, the
old default id, gets assigned the `kibana 7` palette. The desired
behavior is that this palette is assigned the new borealis default
palette in
`9.0`.","sha":"9e7d93189f6ea59fb21332fd7e0af571a4bac8c0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","v9.0.0","backport:version","v9.1.0"],"title":"[ColorMapping]
Fix palette key mapping for legacy palette
ids","number":211858,"url":"https://github.com/elastic/kibana/pull/211858","mergeCommit":{"message":"[ColorMapping]
Fix palette key mapping for legacy palette ids (#211858)\n\nCurrently,
palettes with the legacy palette id of `eui_amsterdam_color_blind`, the
old default id, gets assigned the `kibana 7` palette. The desired
behavior is that this palette is assigned the new borealis default
palette in
`9.0`.","sha":"9e7d93189f6ea59fb21332fd7e0af571a4bac8c0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211858","number":211858,"mergeCommit":{"message":"[ColorMapping]
Fix palette key mapping for legacy palette ids (#211858)\n\nCurrently,
palettes with the legacy palette id of `eui_amsterdam_color_blind`, the
old default id, gets assigned the `kibana 7` palette. The desired
behavior is that this palette is assigned the new borealis default
palette in `9.0`.","sha":"9e7d93189f6ea59fb21332fd7e0af571a4bac8c0"}}]}]
BACKPORT-->

Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
  • Loading branch information
kibanamachine and nickofthyme authored Feb 20, 2025
1 parent 4656c20 commit 09125b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class KbnPalettes {
function buildAliasMappings(palettes: IKbnPalette[]): Map<string, string> {
return palettes.reduce((acc, { id, aliases }) => {
aliases.forEach((alias) => {
acc.set(alias, id);
if (!acc.has(alias)) acc.set(alias, id);
});
return acc;
}, new Map());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const elasticPalette = new KbnColorFnPalette({
id: KbnPalette.Default,
type: 'categorical',
aliases: [
KbnPalette.Default, // needed when switching between new and old themes
'elastic_borealis', // placeholder - not yet used
KbnPalette.Amsterdam, // to assign to existing default palettes
],
Expand Down

0 comments on commit 09125b6

Please sign in to comment.