-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modal to prevent losing REST datasource changes #15752
Modal to prevent losing REST datasource changes #15752
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The confirm util is very nice.
NAB - could we update the "Save and continue" button to be a CTA variant instead? The current red button makes it look like saving is a bad/dangerous thing, but it's probably what they want to press.
return true | ||
} | ||
|
||
return await confirm({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice util to have 👌
Description
REST datasources currently behave quite differently from the other datasources and the rest of the platform, as it is one of the few points where we don't autosave on actions: the user is required to save via the save click. This might be confusing as the UI and some of its elements might give the impression that the data is persisted on change. This will be even more problematic as we are changing some of its configuration elements from dropdowns to context buttons and menus.
This PR introduces a mechanism to detect if you are leaving a REST config with unsaved changes. If this is the case, the user will have 2 options:
Screenshots
No modal when no changes
Modal appears when there are changes
Saving on exiting the screen
Discard changes on exit
Closing the modal will prevent from exiting
On new endpoint, we will validate if it's saved
We will not validate new endpoint "save" status if there is no changes at all
Launchcontrol
Confirm modal when leaving a rest configuration page with unsaved changes