Skip to content

Commit

Permalink
fix: users losing work when opening as chart (#3196)
Browse files Browse the repository at this point in the history
Fixes: https://dhis2.atlassian.net/browse/DHIS2-15794
Updated LayerCard>openAs property to open link in new tab.
Updated text and icon on specific Menu Item to match new behavior.
  • Loading branch information
BRaimbault authored May 8, 2024
1 parent 07a36fe commit 3c69a86
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 88 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ src/locales
.DS_Store
.idea
.vscode
maps-app.code-workspace
168 changes: 84 additions & 84 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-03-15T10:46:33.764Z\n"
"PO-Revision-Date: 2024-03-15T10:46:33.764Z\n"
"POT-Creation-Date: 2024-05-07T11:26:24.266Z\n"
"PO-Revision-Date: 2024-05-07T11:26:24.268Z\n"

msgid "Untitled map, {{date}}"
msgstr "Untitled map, {{date}}"
Expand Down Expand Up @@ -95,12 +95,6 @@ msgstr "Event > org unit coordinate"
msgid "Event data item"
msgstr "Event data item"

msgid "Selected value not available in in list: {{name}}"
msgstr "Selected value not available in in list: {{name}}"

msgid "Style by data element"
msgstr "Style by data element"

msgid "Filtering is available after selecting a program stage."
msgstr "Filtering is available after selecting a program stage."

Expand Down Expand Up @@ -128,6 +122,12 @@ msgstr "Operator"
msgid "Date"
msgstr "Date"

msgid "Selected value not available in in list: {{name}}"
msgstr "Selected value not available in in list: {{name}}"

msgid "Style by data element"
msgstr "Style by data element"

msgid "Data set"
msgstr "Data set"

Expand Down Expand Up @@ -237,54 +237,6 @@ msgstr "Cancel"
msgid "Close"
msgstr "Close"

msgid "No organisation units are selected"
msgstr "No organisation units are selected"

msgid "Organisation Units"
msgstr "Organisation Units"

msgid "Style"
msgstr "Style"

msgid "Point color"
msgstr "Point color"

msgid "Point radius"
msgstr "Point radius"

msgid "event"
msgstr "event"

msgid "tracked entity"
msgstr "tracked entity"

msgid "facility"
msgstr "facility"

msgid "thematic"
msgstr "thematic"

msgid "org unit"
msgstr "org unit"

msgid "Earth Engine"
msgstr "Earth Engine"

msgid "feature"
msgstr "feature"

msgid "Edit {{name}} layer"
msgstr "Edit {{name}} layer"

msgid "Add new {{name}} layer"
msgstr "Add new {{name}} layer"

msgid "Update layer"
msgstr "Update layer"

msgid "Add layer"
msgstr "Add layer"

msgid "Aggregation method"
msgstr "Aggregation method"

Expand All @@ -300,6 +252,12 @@ msgstr "Data"
msgid "Period"
msgstr "Period"

msgid "Organisation Units"
msgstr "Organisation Units"

msgid "Style"
msgstr "Style"

msgid ""
"Data will be calculated on Google Earth Engine for the chosen organisation "
"units."
Expand Down Expand Up @@ -392,6 +350,48 @@ msgstr "No legend set is selected"
msgid "Event status"
msgstr "Event status"

msgid "No organisation units are selected"
msgstr "No organisation units are selected"

msgid "Point color"
msgstr "Point color"

msgid "Point radius"
msgstr "Point radius"

msgid "event"
msgstr "event"

msgid "tracked entity"
msgstr "tracked entity"

msgid "facility"
msgstr "facility"

msgid "thematic"
msgstr "thematic"

msgid "org unit"
msgstr "org unit"

msgid "Earth Engine"
msgstr "Earth Engine"

msgid "feature"
msgstr "feature"

msgid "Edit {{name}} layer"
msgstr "Edit {{name}} layer"

msgid "Add new {{name}} layer"
msgstr "Add new {{name}} layer"

msgid "Update layer"
msgstr "Update layer"

msgid "Add layer"
msgstr "Add layer"

msgid "Boundary color"
msgstr "Boundary color"

Expand Down Expand Up @@ -545,12 +545,6 @@ msgstr "Style by group set"
msgid "Indicator group"
msgstr "Indicator group"

msgid "Collapse"
msgstr "Collapse"

msgid "Expand"
msgstr "Expand"

msgid "External basemap"
msgstr "External basemap"

Expand Down Expand Up @@ -579,6 +573,12 @@ msgstr "Use human-readable keys"
msgid "Data download failed."
msgstr "Data download failed."

msgid "Collapse"
msgstr "Collapse"

msgid "Expand"
msgstr "Expand"

msgid "External layer"
msgstr "External layer"

Expand Down Expand Up @@ -618,8 +618,8 @@ msgstr "Hide data table"
msgid "Show data table"
msgstr "Show data table"

msgid "Open as chart"
msgstr "Open as chart"
msgid "Open in Data Visualizer app"
msgstr "Open in Data Visualizer app"

msgid "Download data"
msgstr "Download data"
Expand Down Expand Up @@ -657,15 +657,25 @@ msgstr "Show longitude/latitude"
msgid "Show {{name}}"
msgstr "Show {{name}}"

msgid "Longitude"
msgstr "Longitude"

msgid "Latitude"
msgstr "Latitude"

msgid "Basemap could not be added: {{message}}"
msgstr "Basemap could not be added: {{message}}"

msgid ""
"Google Earth Engine failed. Is the service configured for this DHIS2 "
"instance?"
msgstr ""
"Google Earth Engine failed. Is the service configured for this DHIS2 "
"instance?"

msgid "no value"
msgstr "no value"

msgid "All groups"
msgstr "All groups"

msgid "Loading data"
msgstr "Loading data"

msgid "Not set"
msgstr "Not set"

Expand All @@ -681,21 +691,11 @@ msgstr "Parent unit"
msgid "Last updated"
msgstr "Last updated"

msgid ""
"Google Earth Engine failed. Is the service configured for this DHIS2 "
"instance?"
msgstr ""
"Google Earth Engine failed. Is the service configured for this DHIS2 "
"instance?"

msgid "no value"
msgstr "no value"

msgid "All groups"
msgstr "All groups"
msgid "Longitude"
msgstr "Longitude"

msgid "Loading data"
msgstr "Loading data"
msgid "Latitude"
msgstr "Latitude"

msgid "acres"
msgstr "acres"
Expand Down
5 changes: 4 additions & 1 deletion src/components/layers/overlays/OverlayCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ const OverlayCard = ({
await set(currentAO)

// Open it in another app
window.location.href = `${baseUrl}/${APP_URLS[type]}/#/currentAnalyticalObject`
window.open(
`${baseUrl}/${APP_URLS[type]}/#/currentAnalyticalObject`,
'_blank'
)
}
: undefined
}
Expand Down
8 changes: 5 additions & 3 deletions src/components/layers/toolbar/LayerToolbarMoreMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
MenuDivider,
IconMore24,
IconTable16,
IconVisualizationColumn16,
IconLaunch16,
IconDownload16,
IconEdit16,
IconDelete16,
Expand Down Expand Up @@ -83,8 +83,10 @@ const LayerToolbarMoreMenu = ({
)}
{openAs && (
<MenuItem
label={i18n.t('Open as chart')}
icon={<IconVisualizationColumn16 />}
label={i18n.t(
'Open in Data Visualizer app'
)}
icon={<IconLaunch16 />}
onClick={() => {
setIsOpen(false)
openAs('CHART')
Expand Down

0 comments on commit 3c69a86

Please sign in to comment.