[Maps] Update style when metrics change#83586
[Maps] Update style when metrics change#83586thomasneirynck merged 35 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/kibana-gis (Team:Geo) |
|
@elasticmachine merge upstream |
x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/classes/styles/vector/style_fields_helper.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
Outdated
Show resolved
Hide resolved
| VECTOR_STYLES, | ||
| RawValue, | ||
| FieldFormatter, | ||
| TOP_TERM_PERCENTAGE_SUFFIX, |
There was a problem hiding this comment.
Clean up all import changes in this file, since they are no longer used
There was a problem hiding this comment.
Looks like you missed cleaning up these imports
| if (newLayerType) { | ||
| dispatch(updateLayerType(layerId, newLayerType)); | ||
| } | ||
| await dispatch(clearMissingStyleProperties(layerId)); |
There was a problem hiding this comment.
only needs to occur for metrics changes
| ) { | ||
| const styleFieldsHelper = await createStyleFieldsHelper(nextFields); | ||
|
|
||
| return previousFields.length === nextFields.length |
There was a problem hiding this comment.
this assumption only works when field-descriptors are complete. #84828 will address the issue of storing invalid field-descriptors in the store.
| VECTOR_STYLES, | ||
| RawValue, | ||
| FieldFormatter, | ||
| TOP_TERM_PERCENTAGE_SUFFIX, |
There was a problem hiding this comment.
Looks like you missed cleaning up these imports
x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
Outdated
Show resolved
Hide resolved
| styleFieldsHelper: StyleFieldsHelper, | ||
| originalProperties: VectorStylePropertiesDescriptor, | ||
| mapColors: string[], | ||
| hasChanges: boolean |
There was a problem hiding this comment.
No need to pass this in since _updateFieldsInDescriptor no longer calls this function.
x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx
Outdated
Show resolved
Hide resolved
nreese
left a comment
There was a problem hiding this comment.
Just to small nits about not exporting location functions. This will making editing layers with metrics a much better experience. Its great that styles using metrics will auto-update to the new metric when possible and save users a lot of clicks.
LGTM
code review, tested in chrome
💔 Build Failed
Failed CI Steps
Test FailuresFirefox UI Functional Tests.test/functional/apps/dashboard/index·js.dashboard app using current data "before all" hook: loadCurrentData in "using current data"Standard OutStack TraceChrome X-Pack UI Functional Tests.x-pack/test/functional/apps/monitoring/elasticsearch/nodes·js.Monitoring app Elasticsearch nodes listing with offline node should sort by statusStandard OutStack TraceJest Integration Tests.src/core/server/ui_settings/integration_tests.uiSettings/routes doc missing get route creates doc, returns a 200 with settingsStandard OutStack Traceand 20 more failures, only showing the first 3. Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
This PR and #84828 will close #82892.
When a user changes a metric, the style-properties get "unset", e.g. causing icons to shrink in size or colors to go black.
With this PR, style properties will automatically update their field-configuration, based on changes in the metrics-configuration.
This is blocking #83393
#84828 addresses an edge-case. Metric-descriptors can go into an invalid state (e.g. due to missing field-name selection) but are still stored in the redux-store. This causes invalid metrics to be dropped when they are serialized in IField-objects.
Checklist
Delete any items that are not applicable to this PR.
For maintainers