Skip to content

Commit

Permalink
Merge branch 'dev' into chore/color-scale-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
turban committed Sep 27, 2023
2 parents 7360e68 + 5d33ca5 commit c7196cb
Show file tree
Hide file tree
Showing 25 changed files with 486 additions and 420 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# [100.2.0](https://github.com/dhis2/maps-app/compare/v100.1.7...v100.2.0) (2023-09-27)


### Bug Fixes

* **translations:** sync translations from transifex (dev) ([af3183c](https://github.com/dhis2/maps-app/commit/af3183cb28928d5a2f862b13a57c45377d136b8b))
* accept both lowercase and camelCase interpretationId in url([#2937](https://github.com/dhis2/maps-app/issues/2937)) ([c171b3d](https://github.com/dhis2/maps-app/commit/c171b3d26189206e546361911e31f887082ee136))
* **translations:** sync translations from transifex (dev) ([1ec1b5c](https://github.com/dhis2/maps-app/commit/1ec1b5cac53d2f36a80201a258fe99757523ab15))
* **translations:** sync translations from transifex (dev) ([bfff4ab](https://github.com/dhis2/maps-app/commit/bfff4ab2a4036c3afce74bda58e24bc77504edbd))
* **translations:** sync translations from transifex (dev) ([2a77caa](https://github.com/dhis2/maps-app/commit/2a77caafdd6d8ee42db14d35a9ab3034e5e8897a))


### Features

* upgrade toolbar (DHIS2-15667) ([#2936](https://github.com/dhis2/maps-app/issues/2936)) ([e1bda37](https://github.com/dhis2/maps-app/commit/e1bda3702edc5c254bce6bacb573da5dd9f54305))


### Reverts

* "chore: fixed period select refactor ([#2958](https://github.com/dhis2/maps-app/issues/2958))" ([#2984](https://github.com/dhis2/maps-app/issues/2984)) ([f532a81](https://github.com/dhis2/maps-app/commit/f532a81463e1842a3e3aa938497505d290be028a))

## [100.1.7](https://github.com/dhis2/maps-app/compare/v100.1.6...v100.1.7) (2023-09-07)


Expand Down
29 changes: 29 additions & 0 deletions cypress/integration/interpretations.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
81 changes: 1 addition & 80 deletions cypress/integration/layers/thematiclayer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
expectContextMenuOptions,
} from '../../elements/map_context_menu.js'
import { ThematicLayer } from '../../elements/thematic_layer.js'
import { CURRENT_YEAR, getApiBaseUrl } from '../../support/util.js'
import { CURRENT_YEAR } from '../../support/util.js'

const INDICATOR_NAME = 'VCCT post-test counselling rate'

Expand Down Expand Up @@ -136,83 +136,4 @@ context('Thematic Layers', () => {
{ name: VIEW_PROFILE },
])
})

// TODO - update demo database with calculations instead of creating on the fly
it('adds a thematic layer with a calculation', () => {
const timestamp = new Date().toUTCString().slice(-24, -4)
const calculationName = `map calc ${timestamp}`

// add a calculation
cy.request('POST', `${getApiBaseUrl()}/api/expressionDimensionItems`, {
name: calculationName,
shortName: calculationName,
expression: '#{fbfJHSPpUQD}/2',
}).then((response) => {
expect(response.status).to.eq(201)

const calculationUid = response.body.response.uid

// open thematic dialog
cy.getByDataTest('add-layer-button').click()
cy.getByDataTest('addlayeritem-thematic').click()

// choose "Calculation" in item type
cy.getByDataTest('thematic-layer-value-type-select').click()
cy.contains('Calculations').click()

// assert that the label on the Calculation select is "Calculation"
cy.getByDataTest('calculationselect-label').contains('Calculation')

// click to open the calculation select
cy.getByDataTest('calculationselect').click()

// check search box exists "Type to filter options"
cy.getByDataTest('dhis2-uicore-popper')
.find('input[type="text"]')
.should('have.attr', 'placeholder', 'Type to filter options')

// search for something that doesn't exist
cy.getByDataTest('dhis2-uicore-popper')
.find('input[type="text"]')
.type('foo')

cy.getByDataTest('dhis2-uicore-select-menu-menuwrapper')
.contains('No options found')
.should('be.visible')

// try search for something that exists
cy.getByDataTest('dhis2-uicore-popper')
.find('input[type="text"]')
.clear()

cy.getByDataTest('dhis2-uicore-popper')
.find('input[type="text"]')
.type(calculationName)

cy.getByDataTest('dhis2-uicore-select-menu-menuwrapper')
.contains(calculationName)
.should('be.visible')

// select the calculation and close dialog
cy.contains(calculationName).click()

cy.getByDataTest('dhis2-uicore-modalactions')
.contains('Add layer')
.click()

// check the layer card title
cy.getByDataTest('layercard')
.contains(calculationName, { timeout: 50000 })
.should('be.visible')

// check the map canvas is displayed
cy.get('canvas.maplibregl-canvas').should('be.visible')

// delete the calculation
cy.request(
'DELETE',
`${getApiBaseUrl()}/api/expressionDimensionItems/${calculationUid}`
)
})
})
})
42 changes: 42 additions & 0 deletions cypress/integration/smoke.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
15 changes: 0 additions & 15 deletions i18n/cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ msgstr "Mapa \"{{- name}}\" je uložena."
msgid "Failed to save map: {{message}}"
msgstr "Nepodařilo se uložit mapu: {{message}}"

msgid "Calculation"
msgstr "Výpočet"

msgid "No calculations found"
msgstr "Nenalezeny žádné výpočty"

msgid "Calculations can be created in the Data Visualizer app."
msgstr "Výpočty lze vytvářet v aplikaci Data Visualizer."

msgid "Classification"
msgstr "Klasifikace"

Expand Down Expand Up @@ -444,9 +435,6 @@ msgstr "Položka dat události je povinná"
msgid "Program indicator is required"
msgstr "Je vyžadován indikátor programu"

msgid "Calculation is required"
msgstr "Je vyžadován výpočet"

msgid "Period is required"
msgstr "Období je vyžadováno"

Expand All @@ -462,9 +450,6 @@ msgstr "Položky dat události"
msgid "Program indicators"
msgstr "Ukazatele programu"

msgid "Calculations"
msgstr "Výpočty"

msgid "Item type"
msgstr "Typ položky"

Expand Down
15 changes: 0 additions & 15 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ msgstr "Map \"{{- name}}\" is saved."
msgid "Failed to save map: {{message}}"
msgstr "Failed to save map: {{message}}"

msgid "Calculation"
msgstr "Calculation"

msgid "No calculations found"
msgstr "No calculations found"

msgid "Calculations can be created in the Data Visualizer app."
msgstr "Calculations can be created in the Data Visualizer app."

msgid "Classification"
msgstr "Classification"

Expand Down Expand Up @@ -430,9 +421,6 @@ msgstr "Event data item is required"
msgid "Program indicator is required"
msgstr "Program indicator is required"

msgid "Calculation is required"
msgstr "Calculation is required"

msgid "Period is required"
msgstr "Period is required"

Expand All @@ -448,9 +436,6 @@ msgstr "Event data items"
msgid "Program indicators"
msgstr "Program indicators"

msgid "Calculations"
msgstr "Calculations"

msgid "Item type"
msgstr "Item type"

Expand Down
15 changes: 0 additions & 15 deletions i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ msgstr "El mapa \"{{- name}}\" está guardado."
msgid "Failed to save map: {{message}}"
msgstr "Error al guardar el mapa: {{message}}"

msgid "Calculation"
msgstr "Cálculo"

msgid "No calculations found"
msgstr ""

msgid "Calculations can be created in the Data Visualizer app."
msgstr ""

msgid "Classification"
msgstr "Clasificación"

Expand Down Expand Up @@ -454,9 +445,6 @@ msgstr "Se requiere el dato de evento"
msgid "Program indicator is required"
msgstr "Se requiere indicador de programa"

msgid "Calculation is required"
msgstr ""

msgid "Period is required"
msgstr "Período requerido"

Expand All @@ -472,9 +460,6 @@ msgstr "Datos de eventos"
msgid "Program indicators"
msgstr "Indicadores de programa"

msgid "Calculations"
msgstr "Cálculos"

msgid "Item type"
msgstr "Item type"

Expand Down
15 changes: 0 additions & 15 deletions i18n/zh.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ msgstr "地图“{{- name}}”已保存。"
msgid "Failed to save map: {{message}}"
msgstr "无法保存地图:{{message}}"

msgid "Calculation"
msgstr "计算"

msgid "No calculations found"
msgstr "没有找到计算结果"

msgid "Calculations can be created in the Data Visualizer app."
msgstr "可以在数据可视化工具应用程序中创建计算。"

msgid "Classification"
msgstr "分类"

Expand Down Expand Up @@ -438,9 +429,6 @@ msgstr "需要事件数据项"
msgid "Program indicator is required"
msgstr "需要项目指标"

msgid "Calculation is required"
msgstr "需要计算"

msgid "Period is required"
msgstr "需要期间"

Expand All @@ -456,9 +444,6 @@ msgstr "事件数据项"
msgid "Program indicators"
msgstr "项目指标"

msgid "Calculations"
msgstr "计算"

msgid "Item type"
msgstr "条目类型"

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maps-app",
"version": "100.1.7",
"version": "100.2.0",
"description": "DHIS2 Maps",
"license": "BSD-3-Clause",
"author": "Bjørn Sandvik",
Expand Down Expand Up @@ -36,7 +36,7 @@
"patch-package": "^6.5.1",
"redux-devtools": "^3.7.0",
"redux-mock-store": "^1.5.4",
"start-server-and-test": "^1.15.4"
"start-server-and-test": "^2.0.1"
},
"dependencies": {
"@dhis2/analytics": "^26.0.17",
Expand Down
10 changes: 10 additions & 0 deletions src/components/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)) {
Expand Down
Loading

0 comments on commit c7196cb

Please sign in to comment.