Skip to content

Commit 0145344

Browse files
committed
[Lens] Use current references for checking if data source states are the same (elastic#244700)
## Summary Fix elastic#234360 Uses current references for checking if data source states are the same. The fix: the "Apply and close" button is enabled when the data view is changed in the in-line editor. https://github.com/user-attachments/assets/6d9a100d-1c20-4184-a861-6221a53e12c5 ### Checklist - [ ] [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 57a3353)
1 parent 066650c commit 0145344

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ export function LensEditConfigurationFlyout({
9292
previousAttrs.state.datasourceStates[datasourceId],
9393
previousAttrs.references,
9494
datasourceStates[datasourceId].state,
95-
attributes.references
95+
// Extract references from the current state as they contain resolved data view IDs
96+
// We cannot use attributes.references because they may contain stale data view IDs from when the panel was initially loaded
97+
datasourceMap[datasourceId].getPersistableState(datasourceStates[datasourceId].state)
98+
.references
9699
)
97100
: false;
98101

0 commit comments

Comments
 (0)