Fix unnecessary navigation modal in pipeline editor
What does this MR do and why?
Fixes the bug where if a user in the pipeline editor created a new commit and wanted to open a merge request, they would see a notification to confirm they wanted to leave the page. However since they have committed their changes, we shouldn't show the modal. The bug occurs because the root parent (pipeline_editor_app
) has a computed property called hasUnsavedChanges
which is what we use to determine if we should show the browser alert to prevent navigation. However after the commit, the computed property has not yet been updated and so the alert appears anyway.
This MR fixes this by waiting after the UI update before navigating away. It also has the benefit of clearly showing that the commit was successful before navigating away.
Also, while I was adding feature test to test this new behaviour, I decided to also address an older issue about testing that very same browser alert.
Screenshots or screen recordings
Before | After |
---|---|
Screen_Recording_2022-01-25_at_3.10.25_PM | Screen_Recording_2022-01-24_at_2.47.25_PM |
How to set up and validate locally
- Go to
CI/CD => Editor
- Make modification to your CI config
- Change the target branch to a new, non-existing branch
- Check the
Start a new merge request with these changes
checkbox - Commit
- Notice that you see the success banner with a message that says you are being redirected.
- Notice that you are redirected to create a MR
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #350503 (closed)