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 41 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
41 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
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
Prev Previous commit
Next Next commit
chore: finalize cypress test
BRaimbault committed Mar 10, 2025
commit c086ea7ea5e3749076f68e23b96569c075eca216
11 changes: 11 additions & 0 deletions cypress/elements/layer.js
Original file line number Diff line number Diff line change
@@ -134,4 +134,15 @@ export class Layer {

return this
}

validateCardContents(contents) {
contents.forEach((content) => {
cy.getByDataTest('layercard')
.find('[data-test="layerlegend"]')
.contains(content)
.should('be.visible')
})

return this
}
}
132 changes: 72 additions & 60 deletions cypress/integration/layers/eventlayer.cy.js
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ const programGeowR = {
startDate: `2025-01-01`,
endDate: `2025-03-31`,
ous: ['Bo', 'Bargbe'],
filters: { item: 'Geo - DataElement - ID', value: '#C' },
}

context('Event Layers', () => {
@@ -39,65 +40,6 @@ context('Event Layers', () => {

const Layer = new EventLayer()

it('change coordinate field', () => {
function testCoordinate(n) {
Layer.selectTab('Data').selectCoordinate(
programGeowR.coordinates[n]
)
cy.getByDataTest('layeredit-addbtn').click()

Layer.validateDialogClosed(true)

cy.wait(5000) // eslint-disable-line cypress/no-unnecessary-waiting

cy.get('#dhis2-map-container')
.findByDataTest('dhis2-uicore-componentcover', EXTENDED_TIMEOUT)
.should('not.exist')

cy.get('.dhis2-map').click('center') // Click in the middle of the map

cy.get('.maplibregl-popup')
.contains(programGeowR.coordinates[n])
.should('be.visible')

Layer.validateCardTitle(programGeowR.stage)
Layer.validateCardItems([`Event (${programGeowR.coordinates[n]})`])
}

Layer.openDialog('Events')
.selectProgram(programGeowR.name)
.selectStage(programGeowR.stage)
.selectTab('Period')
.selectPeriodType({ periodType: 'Start/end dates' })
.typeStartDate(programGeowR.startDate)
.typeEndDate(programGeowR.endDate)
.selectTab('Org Units')

cy.getByDataTest('dhis2-uicore-checkbox').eq(1).click()

cy.getByDataTest('org-unit-tree-node')
.contains(programGeowR.ous[0])
.parents('[data-test="org-unit-tree-node"]')
.first()
.within(() => {
cy.getByDataTest('org-unit-tree-node-toggle').click()
})

cy.getByDataTest('org-unit-tree-node')
.contains(programGeowR.ous[1])
.click()

Layer.selectTab('Style').selectViewAllEvents()

testCoordinate(2)

cy.getByDataTest('layer-edit-button').click()
testCoordinate(1)

cy.getByDataTest('layer-edit-button').click()
testCoordinate(0)
})

it('adds an event layer and applies style for boolean data element', () => {
Layer.openDialog('Events')
.selectProgram(programE2E.name)
@@ -183,7 +125,77 @@ context('Event Layers', () => {
Layer.validateCardItems(['Event'])
})

// it('change coordinate field', () => {
it('change coordinate field', () => {
function testCoordinate(n, open = true) {
if (open) {
cy.getByDataTest('layer-edit-button').click()
}
Layer.selectTab('Data').selectCoordinate(
programGeowR.coordinates[n]
)
cy.getByDataTest('layeredit-addbtn').click()

Layer.validateDialogClosed(true)

cy.wait(5000) // eslint-disable-line cypress/no-unnecessary-waiting

cy.get('#dhis2-map-container')
.findByDataTest('dhis2-uicore-componentcover', EXTENDED_TIMEOUT)
.should('not.exist')

cy.get('.dhis2-map').click('center') // Click in the middle of the map

cy.get('.maplibregl-popup')
.contains(programGeowR.coordinates[n])
.should('be.visible')

Layer.validateCardTitle(programGeowR.stage)
Layer.validateCardContents([
'Coordinate field',
`${programGeowR.coordinates[n]}`,
])
}

Layer.openDialog('Events')
.selectProgram(programGeowR.name)
.selectStage(programGeowR.stage)
.selectTab('Period')
.selectPeriodType({ periodType: 'Start/end dates' })
.typeStartDate(programGeowR.startDate)
.typeEndDate(programGeowR.endDate)
.selectTab('Org Units')

cy.getByDataTest('dhis2-uicore-checkbox').eq(1).click()

cy.getByDataTest('org-unit-tree-node')
.contains(programGeowR.ous[0])
.parents('[data-test="org-unit-tree-node"]')
.first()
.within(() => {
cy.getByDataTest('org-unit-tree-node-toggle').click()
})

cy.getByDataTest('org-unit-tree-node')
.contains(programGeowR.ous[1])
.click()

Layer.selectTab('Filter')

cy.contains('Add filter').click()
cy.getByDataTest('dhis2-uicore-select-input').last().click()
cy.contains(programGeowR.filters.item).click()
cy.getByDataTest('dhis2-uiwidgets-inputfield-content')
.find('input')
.type(programGeowR.filters.value)

Layer.selectTab('Style').selectViewAllEvents()

testCoordinate(3, false) // Geo - DataElement - Coordinate
testCoordinate(4) // Geo - TrackedEntityAttribute - Coordinate
testCoordinate(2) // Tracked entity location
testCoordinate(1) // Enrollment location
testCoordinate(0) // Event location
})

it('opens an event popup', () => {
Layer.openDialog('Events')