kibana
kibana copied to clipboard
Switch without saving warning appears when users switches from ES|QL even after saving the current state
Kibana version: 8.13.0 latest snapshot
Browser OS version: Chrome latest
Original install method (e.g. download page, yum, from source, etc.): from snapshots
Describe the bug: Kibana displays "Switch without saving" warning when user tries to switch from ES|QL to non-esql mode even after saving the current state and the query.
Oh please note - all this is happening when I am on a saved search. Should the saved search state remain the same when user switches between ES|QL and non-ESQL mode?
Steps to reproduce:
- Open discover and some dataview in regular mode and query something and save it
- Switch to ES|QL mode - you can see you are in ES|QL but in the saved search from step 1 - click on save and save again
- Try to switch to non-ES|QL mode now and Kibana warns the user about losing the query even though you already saved it in step 2
Screenshots (if relevant):
https://github.com/elastic/kibana/assets/7074629/2305b13c-7254-4391-bc78-45fd28824b8a
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)
cc @stratoula
I hear this we can definitely do something better here in the wording.
@MichaelMarcialis wdyt? If a user has saved a saved ES|QL search maybe this modal doesn't make sense or maybe we shuld change the wording?
Thanks for catching this, @bhavyarm. @stratoula, yes, this warning modal should not be shown if the user transitions from an unmodified (i.e. not dirty) ES|QL-based saved search to a data view. If the ES|QL query is not part of a saved search or is dirty (i.e. has been modified but not resaved), then the modal should continue to show.
Luckily, unless I'm missing something, we should be able to support this quite easily by checking the same hasChanged
state in Discover that we use to toggle the unsaved changes badge.
This sounds great Davis!