Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle value types and missing data to style by data item in event layers [DHIS2-19215] #3488

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
05e1ff0
feat: support proper coordinateName in legend and popup
BRaimbault Feb 21, 2025
c89884c
fix: fix lint error
BRaimbault Feb 21, 2025
c78d4c9
chore: generate translation strings
BRaimbault Feb 21, 2025
91f0c70
fix: styleDataItem.name not available when loading saved map
BRaimbault Feb 24, 2025
63acf99
fix: onPeriodChange to update popup for timeline
BRaimbault Feb 24, 2025
ad6045d
Merge branch 'master' into feat/DHIS2-19047
BRaimbault Mar 3, 2025
53a6fc2
chore: roll back changes moved to #3481
BRaimbault Mar 3, 2025
df649c8
chore: roll back changes moved to #3480
BRaimbault Mar 3, 2025
0931134
chore: small refactor
BRaimbault Mar 3, 2025
626dd41
fix: update coordinateField layout in Legend
BRaimbault Mar 7, 2025
c086ea7
chore: finalize cypress test
BRaimbault Mar 10, 2025
b5eb97f
chore: finalize cypress test
BRaimbault Mar 11, 2025
b082b6f
chore: docs update
BRaimbault Mar 11, 2025
e0a33e9
chore: fix cypress test
BRaimbault Mar 11, 2025
9ef0a71
chore: cypress tests refactor
BRaimbault Mar 11, 2025
d7b3a10
chore: remove unrelated changes
BRaimbault Mar 11, 2025
9e5d78c
chore: restore cypress test
BRaimbault Mar 11, 2025
43d65be
chore: fix lint error
BRaimbault Mar 11, 2025
b2315bd
chore: refactor queries
BRaimbault Mar 11, 2025
a25a40e
chore: adding line break
BRaimbault Mar 11, 2025
540fc7d
fix: prevent DE or Attr used for styling from disappearing from popup…
BRaimbault Mar 13, 2025
333f4bb
fix: update value in popup with period change in timeline [DHIS2-1900…
BRaimbault Mar 13, 2025
cf1a1e1
Merge branch 'feat/release-DHIS2-17711-and-DHIS2-19008-and-DHIS2-1904…
BRaimbault Mar 13, 2025
590fe02
chore: fix lint error and cypress test update
BRaimbault Mar 13, 2025
40bbe03
chore: rename queries
BRaimbault Mar 14, 2025
ca3baaf
fix: thematic layer popup with no value when playing timeline
BRaimbault Mar 14, 2025
f0aaaa2
feat: properly support alternative coordinates for event layers [DHIS…
BRaimbault Mar 14, 2025
b6ecec2
chore: fix lint error
BRaimbault Mar 14, 2025
16936d2
Merge branch 'feat/release-DHIS2-17711-and-DHIS2-19008-and-DHIS2-1904…
BRaimbault Mar 14, 2025
5c45228
fix: styleDataItem valueType BOOLEAN or TRUE_ONLY
BRaimbault Mar 14, 2025
7ba9f4f
fix: do not consider AGE in numberValueTypes
BRaimbault Mar 17, 2025
371b242
fix: handle unsupported valueTypes and missing value in styleDataItem
BRaimbault Mar 17, 2025
16fce7a
Merge branch 'master' into feat/release-DHIS2-17711-and-DHIS2-19008-a…
BRaimbault Mar 17, 2025
c5a8311
Merge branch 'feat/release-DHIS2-17711-and-DHIS2-19008-and-DHIS2-1904…
BRaimbault Mar 17, 2025
912e566
fix: optionSet prioritized over other styling options
BRaimbault Mar 17, 2025
719b779
fix: StyleByDataItem default to None if not set
BRaimbault Mar 17, 2025
30e237e
chore: small readability improvements
BRaimbault Mar 17, 2025
9506534
Merge branch 'master' into fix/DHIS2-19215
BRaimbault Mar 17, 2025
6d0fbfe
fix: missing data is not counted as 0 in numerical values and tests
BRaimbault Mar 18, 2025
9cac40a
Merge branch 'master' into fix/DHIS2-19215
BRaimbault Mar 18, 2025
e9f6cca
Merge branch 'master' into fix/DHIS2-19215
BRaimbault Mar 19, 2025
af1d6c9
Merge branch 'master' into fix/DHIS2-19215
BRaimbault Apr 1, 2025
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
4 changes: 2 additions & 2 deletions src/components/dataItem/DataItemStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const DataItemStyle = ({ dataItem, style }) => {

return (
<div style={style}>
{numberValueTypes.includes(valueType) ? (
{!optionSet && numberValueTypes.includes(valueType) ? (
<NumericLegendStyle
dataItem={dataItem}
style={{ width: '100%' }}
/>
) : null}

{booleanValueTypes.includes(valueType) ? (
{!optionSet && booleanValueTypes.includes(valueType) ? (
<BooleanStyle {...dataItem} />
) : null}

Expand Down
2 changes: 1 addition & 1 deletion src/components/dataItem/StyleByDataItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const StyleByDataItem = ({ program, programStage, error }) => {
<div>
<SelectField
label={i18n.t('Style by data item')}
value={styleDataItem ? styleDataItem.id : null}
value={styleDataItem ? styleDataItem.id : ITEM_NONE.id}
items={dataItems}
onChange={onChange}
dataTest="style-by-data-item-select"
Expand Down
12 changes: 10 additions & 2 deletions src/components/map/layers/EventPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,18 @@ const EventPopup = ({

const { type, coordinates: coord } = feature.geometry
const { dataValues = [], occurredAt } = dataEvent?.events || {}
if (!dataValues.some((d) => d.dataElement === styleDataItem?.id)) {
const dataValueIndex = dataValues.findIndex(
(d) => d.dataElement === styleDataItem?.id
)
if (dataValueIndex !== -1) {
dataValues[dataValueIndex] = {
dataElement: styleDataItem?.id,
value: feature.properties.value,
}
} else {
dataValues.push({
dataElement: styleDataItem?.id,
value: feature.properties[styleDataItem?.id],
value: feature.properties.value,
})
}

Expand Down
1 change: 0 additions & 1 deletion src/constants/valueTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

// Number values types used for style by data item
export const numberValueTypes = [
'AGE',
'INTEGER',
'INTEGER_NEGATIVE',
'INTEGER_POSITIVE',
Expand Down
Loading
Loading