Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dashboard] [Controls] Fix dashboard reset when initial state has no …
…controls (elastic#159404) ## Summary Consider taking the following steps: 1. Create a new dashboard and save it 2. Add a control and, without saving, 3. Reset the changes to the dashboard ### Before Before this PR, we were not updating the control group input if the `lastSavedControlGroupInput` was `undefined` (which only happens when a dashboard has **never** been saved with any controls and/or edits to the control group settings) - this caused a problem when trying to reset a dashboard from having controls back to the state where `lastSavedControlGroupInput` was `undefined` because the **dashboard's** input would get updated as expected (i.e. the dashboard would think it no longer has any controls), but the control group's input wouldn't get updated (i.e. the control group would think it **still has** controls). Because of this discrepancy, the control would stick around until you refreshed the dashboard: https://github.com/elastic/kibana/assets/8698078/c9da58dc-3373-493d-9bba-5d2540c19560 ### After Now, after this PR, I fixed this by resetting back to the default control group input if `lastSavedControlGroupInput` is `undefined` on reset: https://github.com/elastic/kibana/assets/8698078/e41838e6-6dbe-47a1-bea7-28f20eddcf80 ### Checklist - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- Loading branch information