Skip to content

fix: open Maps in a new tab instead of navigating away [DHIS2-17366] - #3472

Closed
karolinelien wants to merge 5 commits into
masterfrom
fix/open-as-map-new-tab-DHIS2-17366
Closed

fix: open Maps in a new tab instead of navigating away [DHIS2-17366]#3472
karolinelien wants to merge 5 commits into
masterfrom
fix/open-as-map-new-tab-DHIS2-17366

Conversation

@karolinelien

@karolinelien karolinelien commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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 to window.open(url, '_blank'), matching how "Open in [App]" already behaves in Dashboard and Maps.

AI Assisted.


Quality checklist


ToDos

  • Manual check that no popup blocker interferes with the new-tab open across Chrome/Firefox/Safari (Can someone test in Safari?)

Known issues

  • N/A

Screenshots

N/A — behavioral navigation change only

"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.
@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-3472.data-visualizer.netlify.dhis2.org

@dhis2-bot
dhis2-bot temporarily deployed to netlify July 30, 2026 15:01 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify July 30, 2026 15:56 Inactive
… [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.
@dhis2-bot
dhis2-bot temporarily deployed to netlify July 30, 2026 16:14 Inactive
@karolinelien
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.
@dhis2-bot
dhis2-bot temporarily deployed to netlify July 30, 2026 16:32 Inactive
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>
@sonarqubecloud

Copy link
Copy Markdown

@dhis2-bot
dhis2-bot temporarily deployed to netlify July 30, 2026 20:25 Inactive
@karolinelien

Copy link
Copy Markdown
Collaborator Author

#3473

@karolinelien
karolinelien deleted the fix/open-as-map-new-tab-DHIS2-17366 branch August 5, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants