fix: open Maps in a new tab instead of navigating away [DHIS2-17366] - #3472
Closed
karolinelien wants to merge 5 commits into
Closed
fix: open Maps in a new tab instead of navigating away [DHIS2-17366]#3472karolinelien wants to merge 5 commits into
karolinelien wants to merge 5 commits into
Conversation
"Open as Map" replaced the current Data Visualizer tab via window.location.href, so any unsaved work in that tab was lost. Use window.open with target=_blank instead, matching how "Open in [App]" already behaves in Dashboard and Maps.
Contributor
|
🚀 Deployed on https://pr-3472.data-visualizer.netlify.dhis2.org |
… [DHIS2-17366] Matches maps-app's own "Open in" pattern (await set() before window.open) to avoid a race where the new tab could load before the analytical object is persisted, and adds noopener to guard against reverse-tabnabbing. AI Assisted.
karolinelien
marked this pull request as ready for review
July 30, 2026 16:28
Pre-existing 80-char overflow from the original PR, surfaced by CI lint.
The spec imported MAPS_APP_URL from VisualizationTypeSelector.jsx, which pulled the React component and its CSS module into the Cypress browserify bundle. browserify cannot parse the CSS, so the spec failed to compile and reported "0 tests, 1 failing" on every DHIS2 instance version. No other spec imports from src/, so duplicate the two string constants instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Collaborator
Author
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.



Implements DHIS2-17366
Description
"Open as Map" navigated away from Data Visualizer in the same tab via
window.location.href, so any unsaved work in that tab was lost. This changes it towindow.open(url, '_blank'), matching how "Open in [App]" already behaves in Dashboard and Maps.AI Assisted.
Quality checklist
ToDos
Known issues
Screenshots
N/A — behavioral navigation change only