diff --git a/cypress/integration/interpretations.cy.js b/cypress/integration/interpretations.cy.js
index 7662150da..4a1e54abe 100644
--- a/cypress/integration/interpretations.cy.js
+++ b/cypress/integration/interpretations.cy.js
@@ -67,4 +67,33 @@ context('Interpretations', () => {
deleteMap()
})
+
+ it('opens and closes the interpretation panel', () => {
+ cy.intercept({ method: 'POST', url: /dataStatistics/ }).as(
+ 'postDataStatistics'
+ )
+ cy.visit(
+ '/?id=ZBjCfSaLSqD&interpretationId=yKqhXZdeJ6a',
+ EXTENDED_TIMEOUT
+ ) //ANC: LLITN coverage district and facility
+
+ cy.wait('@postDataStatistics')
+ .its('response.statusCode')
+ .should('eq', 201)
+
+ cy.getByDataTest('interpretation-modal')
+ .find('h1')
+ .contains(
+ 'Viewing interpretation: ANC: LLITN coverage district and facility'
+ )
+ .should('be.visible')
+
+ cy.getByDataTest('interpretation-modal')
+ .findByDataTest('dhis2-modal-close-button')
+ .click()
+
+ cy.getByDataTest('interpretation-modal').should('not.exist')
+
+ cy.getByDataTest('interpretations-list').should('be.visible')
+ })
})
diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js
index 5a7ad16e3..be0d0f82d 100644
--- a/cypress/integration/smoke.cy.js
+++ b/cypress/integration/smoke.cy.js
@@ -38,4 +38,46 @@ context('Smoke Test', () => {
Layer.validateCardTitle('ANC 1 Coverage')
cy.get('canvas.maplibregl-canvas').should('be.visible')
})
+
+ it('loads with map id and interpretationid lowercase', () => {
+ cy.intercept({ method: 'POST', url: /dataStatistics/ }).as(
+ 'postDataStatistics'
+ )
+ cy.visit(
+ '/?id=ZBjCfSaLSqD&interpretationid=yKqhXZdeJ6a',
+ EXTENDED_TIMEOUT
+ ) //ANC: LLITN coverage district and facility
+
+ cy.wait('@postDataStatistics')
+ .its('response.statusCode')
+ .should('eq', 201)
+
+ cy.getByDataTest('interpretation-modal')
+ .find('h1')
+ .contains(
+ 'Viewing interpretation: ANC: LLITN coverage district and facility'
+ )
+ .should('be.visible')
+ })
+
+ it('loads with map id and interpretationId uppercase', () => {
+ cy.intercept({ method: 'POST', url: /dataStatistics/ }).as(
+ 'postDataStatistics'
+ )
+ cy.visit(
+ '/?id=ZBjCfSaLSqD&interpretationId=yKqhXZdeJ6a',
+ EXTENDED_TIMEOUT
+ ) //ANC: LLITN coverage district and facility
+
+ cy.wait('@postDataStatistics')
+ .its('response.statusCode')
+ .should('eq', 201)
+
+ cy.getByDataTest('interpretation-modal')
+ .find('h1')
+ .contains(
+ 'Viewing interpretation: ANC: LLITN coverage district and facility'
+ )
+ .should('be.visible')
+ })
})
diff --git a/src/components/app/App.js b/src/components/app/App.js
index 762d13b8a..7e8f8ca55 100644
--- a/src/components/app/App.js
+++ b/src/components/app/App.js
@@ -7,6 +7,7 @@ import { useDispatch } from 'react-redux'
import { tSetAnalyticalObject } from '../../actions/analyticalObject.js'
import { removeBingBasemaps, setBingMapsApiKey } from '../../actions/basemap.js'
import { tSetExternalLayers } from '../../actions/externalLayers.js'
+import { setInterpretation } from '../../actions/interpretations.js'
import { tOpenMap } from '../../actions/map.js'
import { CURRENT_AO_KEY } from '../../util/analyticalObject.js'
import { getUrlParameter } from '../../util/requests.js'
@@ -33,6 +34,15 @@ const App = () => {
} else if (getUrlParameter('currentAnalyticalObject') === 'true') {
await dispatch(tSetAnalyticalObject(currentAO))
}
+
+ // analytics interpretation component uses camelcase
+ const interpretationId =
+ getUrlParameter('interpretationid') ||
+ getUrlParameter('interpretationId')
+
+ if (interpretationId) {
+ dispatch(setInterpretation(interpretationId))
+ }
}
if (!isEmpty(systemSettings)) {
diff --git a/src/components/app/DetailsPanel.js b/src/components/app/DetailsPanel.js
index ddb88d10e..a5dee646a 100644
--- a/src/components/app/DetailsPanel.js
+++ b/src/components/app/DetailsPanel.js
@@ -9,17 +9,14 @@ import styles from './styles/DetailsPanel.module.css'
const DetailsPanel = ({ interpretationsRenderCount }) => {
const detailsPanelOpen = useSelector((state) => state.ui.rightPanelOpen)
const viewOrgUnitProfile = useSelector((state) => state.orgUnitProfile)
+ const interpretationId = useSelector((state) => state.interpretation?.id)
const getContent = () => {
- if (!detailsPanelOpen) {
- return null
+ if (interpretationId || (detailsPanelOpen && !viewOrgUnitProfile)) {
+ return