Skip to content

Commit

Permalink
fix: update pop-up 'No data' logic and add labelNoData to labelStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
BRaimbault committed Nov 25, 2024
1 parent 837a52e commit 0e9fb23
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@dhis2/d2-ui-core": "^7.4.0",
"@dhis2/d2-ui-org-unit-dialog": "^7.4.0",
"@dhis2/d2-ui-org-unit-tree": "^7.4.0",
"@dhis2/maps-gl": "^4.0.0",
"@dhis2/maps-gl": "git+https://github.com/d2-ci/maps-gl.git#1b235a8e3fc0a7cb9b207b2353236c4e2952bffe",
"@dhis2/ui": "^8.4.13",
"abortcontroller-polyfill": "^1.7.3",
"array-move": "^4.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/components/map/layers/ThematicLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ class ThematicLayer extends Layer {
<div>{indicator}</div>
<div>{periodName}</div>
<div>
{i18n.t('Value')}: {value ? value : i18n.t('No data')}
{i18n.t('Value')}:{' '}
{value !== null && value !== undefined
? value
: i18n.t('No data')}
</div>
{aggregationType && aggregationType !== 'DEFAULT' && (
<div>{aggregationType}</div>
Expand Down
2 changes: 2 additions & 0 deletions src/util/labels.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import i18n from '@dhis2/d2-i18n';
import { cssColor } from './colors';
import {
LABEL_FONT_SIZE,
Expand All @@ -20,5 +21,6 @@ export const getLabelStyle = ({
lineHeight: parseInt(fontSize, 10) * 1.2 + 'px',
color: cssColor(labelFontColor) || LABEL_FONT_COLOR,
paddingTop: '10px',
labelNoData: i18n.t('No data'),
};
};
5 changes: 2 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2092,10 +2092,9 @@
markdown-it "^8.4.2"
prop-types "^15.6.2"

"@dhis2/maps-gl@^4.0.0":
"@dhis2/maps-gl@git+https://github.com/d2-ci/maps-gl.git#1b235a8e3fc0a7cb9b207b2353236c4e2952bffe":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@dhis2/maps-gl/-/maps-gl-4.0.0.tgz#e97df2fbc78f787a0916224d7d54fb96b9c376db"
integrity sha512-TDEIBT6rFuEZGXnBxAqKhSmCXk3wtuCf/OrVZBKxT1qk0kHau71f3lzAXbWhYAuop8t6/DyJaIcQrUYMi1Xy3w==
resolved "git+https://github.com/d2-ci/maps-gl.git#1b235a8e3fc0a7cb9b207b2353236c4e2952bffe"
dependencies:
"@mapbox/sphericalmercator" "^1.2.0"
"@turf/area" "^6.5.0"
Expand Down

0 comments on commit 0e9fb23

Please sign in to comment.