Open flash1293 opened 4 years ago
@flash1293 Thanks for raising this!
I can definitely see this being useful for Console once we are saving text remote. Future work enabled by: https://github.com/elastic/kibana/pull/52402
In that case we can check if we are saving (or haven't been able to save) and prompt the user before leaving Console.
Pinging @elastic/kibana-management (Team:Kibana Management)
https://github.com/elastic/kibana/pull/54221 adds the functionality to mounted apps to prompt a confirm message before getting unmounted. As the dev tools API currently re-uses the mount callback interface of applications (https://github.com/elastic/kibana/blob/master/src/plugins/dev_tools/public/plugin.ts#L66), dev tools will also have access to a
onAppLeave
method in the params of the mount function.In the PR linked above this is solved by implementing the method as a no-op which is confusing because people could accidentally use it. I see two options to resolve this:
onAppLeave
method. Pro: Easy fix which supports the current use cases. Con: Diverging interfaces and feature sets between dev tools and appsWhat do you think, @elastic/es-ui team?