Skip to content

Commit

Permalink
fix: unclear 'show no data' (#3204)
Browse files Browse the repository at this point in the history
Fix: https://dhis2.atlassian.net/browse/DHIS2-15799
Update text "Show no data" in NoDataColor component.
Add logic to display "No data" text if value is missing in Popup component.
Bump maps-gl to 3.9.2.
Update a few cypress tests.
  • Loading branch information
BRaimbault committed Jun 7, 2024
1 parent a2c7e5e commit ec24ca0
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 101 deletions.
2 changes: 1 addition & 1 deletion cypress/elements/file_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const deleteMap = () => {
)

cy.getByDataTest('file-menu-delete', EXTENDED_TIMEOUT)
.not('.disabled')
.should('not.have.class', 'disabled')
.should('be.visible')
.click()

Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/filemenu.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ describe('File menu', () => {
url: /\/maps/,
}).as('deleteMap')

cy.getByDataTest('layercard').should('not.contain', 'Loading layer...')

deleteMap()

cy.wait('@deleteMap').its('response.statusCode').should('eq', 200)
Expand Down
11 changes: 5 additions & 6 deletions cypress/integration/interpretations.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ context('Interpretations', () => {
.find('input[type="text"]')
.should('have.attr', 'placeholder', 'Write an interpretation')

cy.get('p')
.contains(
'Koinadugu has a very high LLITN coverage despite low density of facilities providing nets.'
)
.should('be.visible')
cy.contains(
'p',
'Koinadugu has a very high LLITN coverage despite low density of facilities providing nets.'
).should('be.visible')
})

it('view interpretation after creating a map', () => {
Expand Down Expand Up @@ -83,7 +82,7 @@ context('Interpretations', () => {
EXTENDED_TIMEOUT
) //ANC: LLITN coverage district and facility

cy.wait('@postDataStatistics')
cy.wait('@postDataStatistics', EXTENDED_TIMEOUT)
.its('response.statusCode')
.should('eq', 201)

Expand Down
174 changes: 87 additions & 87 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-05-07T11:26:24.266Z\n"
"PO-Revision-Date: 2024-05-07T11:26:24.268Z\n"
"POT-Creation-Date: 2024-06-04T09:11:11.417Z\n"
"PO-Revision-Date: 2024-06-04T09:11:11.417Z\n"

msgid "Untitled map, {{date}}"
msgstr "Untitled map, {{date}}"
Expand Down Expand Up @@ -95,6 +95,12 @@ 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 @@ -122,12 +128,6 @@ 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,6 +237,54 @@ 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 @@ -252,12 +300,6 @@ 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 @@ -350,48 +392,6 @@ 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 @@ -425,8 +425,8 @@ msgstr "Aggregation type"
msgid "Only show completed events"
msgstr "Only show completed events"

msgid "Show no data"
msgstr "Show no data"
msgid "Include org units with no data"
msgstr "Include org units with no data"

msgid "Low radius"
msgstr "Low radius"
Expand Down Expand Up @@ -545,6 +545,12 @@ 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 @@ -573,12 +579,6 @@ 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 @@ -657,24 +657,14 @@ msgstr "Show longitude/latitude"
msgid "Show {{name}}"
msgstr "Show {{name}}"

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 "Longitude"
msgstr "Longitude"

msgid "All groups"
msgstr "All groups"
msgid "Latitude"
msgstr "Latitude"

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

msgid "Not set"
msgstr "Not set"
Expand All @@ -688,14 +678,27 @@ msgstr "Organisation unit"
msgid "Parent unit"
msgstr "Parent unit"

msgid "No data"
msgstr "No data"

msgid "Last updated"
msgstr "Last updated"

msgid "Longitude"
msgstr "Longitude"
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 "Latitude"
msgstr "Latitude"
msgid "no value"
msgstr "no value"

msgid "All groups"
msgstr "All groups"

msgid "Loading data"
msgstr "Loading data"

msgid "acres"
msgstr "acres"
Expand Down Expand Up @@ -1362,9 +1365,6 @@ msgstr "Error"
msgid "Thematic layer"
msgstr "Thematic layer"

msgid "No data"
msgstr "No data"

msgid "Tracked entity"
msgstr "Tracked entity"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@dhis2/app-service-alerts": "3.9.4",
"@dhis2/app-service-datastore": "^1.0.0-beta.3",
"@dhis2/d2-i18n": "^1.1.3",
"@dhis2/maps-gl": "^3.9.1",
"@dhis2/maps-gl": "^3.9.2",
"@dhis2/ui": "^9.2.0",
"@krakenjs/post-robot": "^11.0.0",
"@reportportal/agent-js-cypress": "git+https://github.com/dhis2/agent-js-cypress.git#develop",
Expand Down
2 changes: 1 addition & 1 deletion src/components/edit/thematic/NoDataColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const NoDataColor = ({ value, onChange }) => {
return (
<div>
<Checkbox
label={i18n.t('Show no data')}
label={i18n.t('Include org units with no data')}
checked={!!value}
onChange={onCheck}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/layers/ThematicLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class ThematicLayer extends Layer {
<div>{indicator}</div>
<div>{periodName}</div>
<div>
{i18n.t('Value')}: {value}
{i18n.t('Value')}: {value ? value : i18n.t('No data')}
</div>
{aggregationType && aggregationType !== 'DEFAULT' && (
<div>{aggregationType}</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/map/mapLocale.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const getMapLocale = () => ({
km: i18n.t('km'),
'Measure distances and areas': i18n.t('Measure distances and areas'),
mi: i18n.t('mi'),
'No data': i18n.t('No data'),
Perimeter: i18n.t('Perimeter'),
'Reset bearing to north': i18n.t('Reset bearing to north'),
'Search for place or address': i18n.t('Search for place or address'),
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2243,10 +2243,10 @@
markdown-it "^8.4.2"
prop-types "^15.6.2"

"@dhis2/maps-gl@^3.9.1":
version "3.9.1"
resolved "https://registry.yarnpkg.com/@dhis2/maps-gl/-/maps-gl-3.9.1.tgz#c3550b9014074a8d5676c073e6275163d0ba941d"
integrity sha512-ayMXeXbCSfmocAsA00jz13h0QW7R/S3M7F/JN5BlYx63+utNi4Ru+ZAIWRcPeksuEXIIu/nnLU55vDtUnS4X3A==
"@dhis2/maps-gl@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@dhis2/maps-gl/-/maps-gl-3.9.2.tgz#510a7d0f91bfbbdc6139283c8269506e3680bdc3"
integrity sha512-AJQ8Q2qKiZ6+ieaiM7qdsZ5tjIEdUQKp/zCQoUaTpmgOPB86sM2BYV1fJ8tvSSqHU4Wo7jyoEoNku1zbpCQZRQ==
dependencies:
"@mapbox/sphericalmercator" "^1.2.0"
"@turf/area" "^6.5.0"
Expand Down

0 comments on commit ec24ca0

Please sign in to comment.