Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 40 additions & 7 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: 2026-05-01T10:18:47.999Z\n"
"PO-Revision-Date: 2026-05-01T10:18:48.000Z\n"
"POT-Creation-Date: 2026-05-14T10:04:17.710Z\n"
"PO-Revision-Date: 2026-05-14T10:04:17.711Z\n"

msgid "2020"
msgstr "2020"
Expand Down Expand Up @@ -267,6 +267,9 @@ msgstr "Organisation Units"
msgid "Style"
msgstr "Style"

msgid "Count org units without a point location"
msgstr "Count org units without a point location"

msgid "Point color"
msgstr "Point color"

Expand Down Expand Up @@ -380,6 +383,9 @@ msgstr "Valid classes are {{minSteps}} to {{maxSteps}}"
msgid "Facility buffer"
msgstr "Facility buffer"

msgid "Count org units without coordinates"
msgstr "Count org units without coordinates"

msgid "Org Units"
msgstr "Org Units"

Expand All @@ -395,6 +401,9 @@ msgstr "View all events"
msgid "Radius"
msgstr "Radius"

msgid "Count events without coordinates"
msgstr "Count events without coordinates"

msgid "You can style events by data element after selecting a program."
msgstr "You can style events by data element after selecting a program."

Expand Down Expand Up @@ -683,6 +692,24 @@ msgstr "Remove layer"
msgid "Filters"
msgstr "Filters"

msgid "Data quality"
msgstr "Data quality"

msgid "{{count}} event without coordinates"
msgid_plural "{{count}} event without coordinates"
msgstr[0] "{{count}} event without coordinates"
msgstr[1] "{{count}} events without coordinates"

msgid "{{count}} org unit without a point location"
msgid_plural "{{count}} org unit without a point location"
msgstr[0] "{{count}} org unit without a point location"
msgstr[1] "{{count}} org units without a point location"

msgid "{{count}} org unit without coordinates"
msgid_plural "{{count}} org unit without coordinates"
msgstr[0] "{{count}} org unit without coordinates"
msgstr[1] "{{count}} org units without coordinates"

msgid "No data found"
msgstr "No data found"

Expand Down Expand Up @@ -1728,6 +1755,9 @@ msgstr "Financial year (Start April)"
msgid "Cancelled"
msgstr "Cancelled"

msgid "Could not count org units without coordinates"
msgstr "Could not count org units without coordinates"

msgid "Earth Engine layer"
msgstr "Earth Engine layer"

Expand All @@ -1746,17 +1776,17 @@ msgstr "Displaying first {{pageSize}} events out of {{total}}"
msgid "Event"
msgstr "Event"

msgid "Could not count org units without a point location"
msgstr "Could not count org units without a point location"

msgid "Facilities"
msgstr "Facilities"

msgid "an error occurred"
msgstr "an error occurred"

msgid "GroupSet used for styling was not found"
msgstr "GroupSet used for styling was not found"

msgid "No coordinates found for selected facilities"
msgstr "No coordinates found for selected facilities"
msgid "No point locations found for selected facilities"
msgstr "No point locations found for selected facilities"

msgid "There was a problem with this layer. Contact a system administrator."
msgstr "There was a problem with this layer. Contact a system administrator."
Expand Down Expand Up @@ -1840,6 +1870,9 @@ msgstr "Org units"
msgid "Facility"
msgstr "Facility"

msgid "GroupSet used for styling was not found"
msgstr "GroupSet used for styling was not found"

msgid "Start date is invalid"
msgstr "Start date is invalid"

Expand Down
6 changes: 6 additions & 0 deletions src/actions/layerEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ export const setEventClustering = (checked) => ({
checked,
})

// Set if features without coordinates should be counted and added to data table
export const setCountFeaturesWithoutCoordinates = (checked) => ({
type: types.LAYER_EDIT_COUNT_FEATURES_WITHOUT_COORDS_SET,
checked,
})

// Set event point radius (event layer)
export const setEventPointRadius = (radius) => ({
type: types.LAYER_EDIT_EVENT_POINT_RADIUS_SET,
Expand Down
8 changes: 4 additions & 4 deletions src/components/classification/Classification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ Classification.propTypes = {

export default connect(
({ layerEdit }) => ({
method: layerEdit.method,
classes: layerEdit.classes,
colorScale: layerEdit.colorScale,
legendDecimalPlaces: layerEdit.legendDecimalPlaces,
method: layerEdit?.method,
classes: layerEdit?.classes,
colorScale: layerEdit?.colorScale,
legendDecimalPlaces: layerEdit?.legendDecimalPlaces,
}),
{ setClassification, setColorScale, setLegendDecimalPlaces }
)(Classification)
2 changes: 1 addition & 1 deletion src/components/classification/IsolatedClass.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ IsolatedClass.propTypes = {
}

export default connect(
({ layerEdit }) => ({ legendIsolated: layerEdit.legendIsolated }),
({ layerEdit }) => ({ legendIsolated: layerEdit?.legendIsolated }),
{ setLegendIsolated }
)(IsolatedClass)
2 changes: 1 addition & 1 deletion src/components/classification/NumericLegendStyle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ NumericLegendStyle.propTypes = {

export default connect(
({ layerEdit }) => ({
method: layerEdit.method,
method: layerEdit?.method,
}),
{ setClassification }
)(NumericLegendStyle)
4 changes: 2 additions & 2 deletions src/components/classification/SingleColor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ SingleColor.propTypes = {

export default connect(
({ layerEdit }) => ({
color: layerEdit.colorScale,
legendDecimalPlaces: layerEdit.legendDecimalPlaces,
color: layerEdit?.colorScale,
legendDecimalPlaces: layerEdit?.legendDecimalPlaces,
}),
{ setColorScale, setLegendDecimalPlaces }
)(SingleColor)
29 changes: 17 additions & 12 deletions src/components/dataItem/DataItemStyle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import NoDataLegend from '../edit/shared/NoDataLegend.jsx'
import UnclassifiedLegend from '../edit/shared/UnclassifiedLegend.jsx'
import OptionSetStyle from '../optionSet/OptionSetStyle.jsx'
import BooleanStyle from './BooleanStyle.jsx'
import styles from './styles/DataItemStyle.module.css'

const DataItemStyle = ({ dataItem, style }) => {
const noDataLegend = useSelector((state) => state.layerEdit.noDataLegend)
Expand Down Expand Up @@ -48,18 +49,22 @@ const DataItemStyle = ({ dataItem, style }) => {

{optionSet ? <OptionSetStyle styledOptionSet={optionSet} /> : null}

{hasClassification && (
<UnclassifiedLegend
label={i18n.t('Include unclassified events')}
value={unclassifiedLegend}
onChange={(v) => dispatch(setUnclassifiedLegend(v))}
/>
)}
<NoDataLegend
label={i18n.t('Include events with no data')}
value={noDataLegend}
onChange={(v) => dispatch(setNoDataLegend(v))}
/>
<div className={styles.flexColumnFlow}>
<div className={styles.flexColumn}>
{hasClassification && (
<UnclassifiedLegend
label={i18n.t('Include unclassified events')}
value={unclassifiedLegend}
onChange={(v) => dispatch(setUnclassifiedLegend(v))}
/>
)}
<NoDataLegend
label={i18n.t('Include events with no data')}
value={noDataLegend}
onChange={(v) => dispatch(setNoDataLegend(v))}
/>
</div>
</div>
</div>
)
}
Expand Down
13 changes: 13 additions & 0 deletions src/components/dataItem/styles/DataItemStyle.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.flexColumnFlow {
display: flex;
flex-wrap: wrap;
}

.flexColumn {
display: flex;
flex-direction: column;
flex: 1 1 0px;
margin: 0;
box-sizing: border-box;
max-width: 340px;
}
13 changes: 9 additions & 4 deletions src/components/datatable/useTableData.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const useTableData = ({ layer, sortField, sortDirection }) => {
legend,
styleDataItem,
data,
dataWithoutCoords,
dataFilters,
headers: layerHeaders,
serverCluster,
Expand All @@ -207,25 +208,29 @@ export const useTableData = ({ layer, sortField, sortDirection }) => {
return null
}

if (!data?.length) {
const allData = dataWithoutCoords?.length
? [...(data || []), ...dataWithoutCoords]
: data

if (!allData?.length) {
errorCode.current = ERROR_NO_VALID_DATA
return null
}

if (layerType === GEOJSON_URL_LAYER) {
return data.map((d) => ({
return allData.map((d) => ({
...d.properties,
}))
}

return data
return allData
.filter((d) => !d.properties.hasAdditionalGeometry)
.map((d, index) => ({
...(d.properties || d),
...aggregations[d.id],
index,
}))
}, [data, aggregations, serverCluster, layerType])
}, [data, dataWithoutCoords, aggregations, serverCluster, layerType])

const headers = useMemo(() => {
if (errorCode.current) {
Expand Down
30 changes: 26 additions & 4 deletions src/components/edit/FacilityDialog.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { useDataQuery } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import cx from 'classnames'
import PropTypes from 'prop-types'
import React, { useState, useEffect, useCallback } from 'react'
import { useDispatch } from 'react-redux'
import { useDispatch, useSelector } from 'react-redux'
import {
setOrgUnits,
setRadiusLow,
setOrganisationUnitGroupSet,
setOrganisationUnitColor,
setCountFeaturesWithoutCoordinates,
setUnclassifiedLegend,
} from '../../actions/layerEdit.js'
import {
Expand All @@ -20,7 +22,7 @@ import {
NONE,
} from '../../constants/layers.js'
import { getOrgUnitsFromRows } from '../../util/analytics.js'
import { Tab, Tabs, NumberField, ColorPicker } from '../core/index.js'
import { Tab, Tabs, NumberField, ColorPicker, Checkbox } from '../core/index.js'
import StyleByGroupSet from '../groupSet/StyleByGroupSet.jsx'
import OrgUnitSelect from '../orgunits/OrgUnitSelect.jsx'
import BufferRadius from './shared/BufferRadius.jsx'
Expand Down Expand Up @@ -52,6 +54,9 @@ const FacilityDialog = ({
const [orgUnitsError, setOrgUnitsError] = useState()
const { data } = useDataQuery(QUERY)
const dispatch = useDispatch()
const countFeaturesWithoutCoordinates = useSelector(
(state) => state.layerEdit.countFeaturesWithoutCoordinates
)

const facilityOrgUnitLevel = data?.configuration.facilityOrgUnitLevel
const facilityOrgUnitGroupSet = data?.configuration.facilityOrgUnitGroupSet
Expand Down Expand Up @@ -113,10 +118,24 @@ const FacilityDialog = ({
data-test="facilitydialog-styletab"
>
<div className={styles.flexColumn}>
<Labels />
<Labels className={styles.noMarginTop} />
<BufferRadius
defaultRadius={FACILITY_BUFFER}
hasOrgUnitField={hasOrgUnitField}
className={styles.noMarginTop}
/>
<Checkbox
label={i18n.t(
'Count org units without a point location'
)}
checked={!!countFeaturesWithoutCoordinates}
onChange={(checked) =>
dispatch(
setCountFeaturesWithoutCoordinates(
checked
)
)
}
/>
</div>
<div className={styles.flexColumn}>
Expand Down Expand Up @@ -144,7 +163,10 @@ const FacilityDialog = ({
setOrganisationUnitColor(val)
)
}
className={styles.narrowField}
className={cx(
styles.narrowField,
styles.marginTop
)}
/>
<NumberField
label={i18n.t('Point radius')}
Expand Down
6 changes: 3 additions & 3 deletions src/components/edit/earthEngine/AggregationSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ AggregationSelect.propTypes = {

export default connect(
({ layerEdit }) => ({
aggregations: layerEdit.aggregations,
defaultAggregations: layerEdit.defaultAggregations,
aggregationType: layerEdit.aggregationType,
aggregations: layerEdit?.aggregations,
defaultAggregations: layerEdit?.defaultAggregations,
aggregationType: layerEdit?.aggregationType,
}),
{ setAggregationType }
)(AggregationSelect)
4 changes: 2 additions & 2 deletions src/components/edit/earthEngine/BandSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ BandSelect.propTypes = {

export default connect(
({ layerEdit }) => ({
band: layerEdit.band,
bands: layerEdit.bands,
band: layerEdit?.band,
bands: layerEdit?.bands,
}),
{ setBand }
)(BandSelect)
14 changes: 14 additions & 0 deletions src/components/edit/earthEngine/StyleTab.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import i18n from '@dhis2/d2-i18n'
import PropTypes from 'prop-types'
import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { setCountFeaturesWithoutCoordinates } from '../../../actions/layerEdit.js'
import { EE_BUFFER } from '../../../constants/layers.js'
import { Checkbox } from '../../core/index.js'
import BufferRadius from '../shared/BufferRadius.jsx'
import styles from '../styles/LayerDialog.module.css'
import LegendPreview from './LegendPreview.jsx'
import StyleSelect from './StyleSelect.jsx'

const StyleTab = ({ unit, style, showBelowMin, hasOrgUnitField }) => {
const dispatch = useDispatch()
const countFeaturesWithoutCoordinates = useSelector(
(state) => state.layerEdit.countFeaturesWithoutCoordinates
)
const { min, max, palette } = style
const isClassStyle =
min !== undefined &&
Expand All @@ -25,6 +32,13 @@ const StyleTab = ({ unit, style, showBelowMin, hasOrgUnitField }) => {
hasOrgUnitField={hasOrgUnitField}
forceShowNumberField={true}
/>
<Checkbox
label={i18n.t('Count org units without coordinates')}
checked={!!countFeaturesWithoutCoordinates}
onChange={(checked) =>
dispatch(setCountFeaturesWithoutCoordinates(checked))
}
/>
</div>
{isClassStyle && (
<LegendPreview style={style} showBelowMin={showBelowMin} />
Expand Down
Loading
Loading