opensearch-project / dashboards-flow-framework

A UI designer for constructing AI applications with OpenSearch
Apache License 2.0
9 stars 8 forks source link

Warn users on browser refresh if unsaved changes #470

Closed ohltyler closed 1 week ago

ohltyler commented 1 week ago

Description

Use browser-native popups to warn users of unsaved changes when refreshing. Adds a basic hook to add/remove event listeners when the component is unloaded (triggered on refresh), and if saveDisabled is false, indicating there are unsaved changes.

Issues Resolved

Makes progress on #469

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.