Skip to content

Commit 4d89aba

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 6e891e6 commit 4d89aba

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
@@ -93,7 +93,10 @@ export function LensEditConfigurationFlyout({
9393
previousAttrs.state.datasourceStates[datasourceId],
9494
previousAttrs.references,
9595
datasourceStates[datasourceId].state,
96-
attributes.references
96+
// Extract references from the current state as they contain resolved data view IDs
97+
// We cannot use attributes.references because they may contain stale data view IDs from when the panel was initially loaded
98+
datasourceMap[datasourceId].getPersistableState(datasourceStates[datasourceId].state)
99+
.references
97100
)
98101
: false;
99102

0 commit comments

Comments
 (0)