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

[ColorMapping] Allow storing raw values in color assignments #207957

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

nickofthyme
Copy link
Contributor

@nickofthyme nickofthyme commented Jan 23, 2025

Summary

Refactors color mapping logic to store raw values in save objects.

Main changes:

  • Instead assignments having a single rule with many values, we now have assignments with multiple rules of varying types with a single value.
  • As per the previous change, there is no more explicit auto rule, this is now implicit when there are no rules in the assignment.
  • Raw values can now be raw and in cases such as RangeKeys and MultiValueKeys can be instance values. This is not ok for storing in redux nor the SO so be have added a serialize methods to facilitate this value storage. Code changes attempt to identify which value is used based on variable/param names and type aliases as both are unknown.
  • For values that are non-string or non-number types, we no longer allow creating custom matching options.
  • Values are now correctly formatted.
  • More to be added....

Closes #193080
Fixes #187519

Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Identify risks

  • Migration from previous stored types.

@elasticmachine
Copy link
Contributor

elasticmachine commented Jan 23, 2025

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

@elasticmachine
Copy link
Contributor

elasticmachine commented Jan 23, 2025

💔 Build Failed

Failed CI Steps

History

- use stringified categories for legacy palettes
- pass formatter to all color mapping usages
- cleanup new color mapping toggle logic
- only compute categories when color mapping is enabled
…lastic#208623

- only handle untransposed data to collate categories
- use untransposed data in lens datatable renderer
- updates usages of getColorCategories
- match with or without formatting
- match rule should only match full values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants