PB-1355 : don't show drawing lost warning when we open download PDFs#1210
Merged
PB-1355 : don't show drawing lost warning when we open download PDFs#1210
Conversation
web-mapviewer
|
||||||||||||||||||||||||||||
| Project |
web-mapviewer
|
| Branch Review |
develop
|
| Run status |
|
| Run duration | 04m 51s |
| Commit |
|
| Committer | Pascal Barth |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
20
|
|
|
0
|
|
|
231
|
| View all changes introduced in this branch ↗︎ | |
using window.open to trigger a download (of the print results) was triggering the beforeUnload event in MapView.vue's code, and showing the "you'll lose your drawing" warning, while we stay on the page in the end. Also fixing some usage of the old $t to the new Composition API equivalent
1f76846 to
90947f4
Compare
ltkum
approved these changes
Jan 20, 2025
Contributor
ltkum
left a comment
There was a problem hiding this comment.
in the long run, I woulld prefer a cleaner solution without using the store, but for a quick fix, I can let this go :)
Comment on lines
+179
to
+188
| /** | ||
| * Flag set to true when the app is opening a new tab. | ||
| * | ||
| * This helps us decide to show or not show a warning popup for lost changes if the user | ||
| * closes the tab. In some cases, we are opening a new tab ourselves (print result) and | ||
| * don't want this popup to show up. | ||
| * | ||
| * @type Boolean | ||
| */ | ||
| isOpeningNewTab: false, |
Contributor
There was a problem hiding this comment.
I don't like this approach, and would prefer we play around with the closeTab event interception, but I can see why this would be simpler to do this way :) We can go with this if you're satisfied with it :)
Contributor
Author
There was a problem hiding this comment.
for now we will live with it, I'll create a task to sort this out for the next release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
using window.open to trigger a download (of the print results) was triggering the beforeUnload event in MapView.vue's code, and showing the "you'll lose your drawing" warning, while we stay on the page in the end.
Also fixing some usage of the old $t to the new Composition API equivalent
Test link