Skip to content

feat: add event layer tooltips, labels, and org unit boundary checks#3710

Open
BRaimbault wants to merge 13 commits into
masterfrom
feat/event-layer-tooltips-and-labels
Open

feat: add event layer tooltips, labels, and org unit boundary checks#3710
BRaimbault wants to merge 13 commits into
masterfrom
feat/event-layer-tooltips-and-labels

Conversation

@BRaimbault

@BRaimbault BRaimbault commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds two event-layer features:

  1. Hover tooltips and persistent labels — select a data item to label events; hover shows a tooltip, and a separate toggle renders persistent map labels styled via the existing shared label font controls (size/weight/style/color).
  2. Filter and count events outside org unit boundaries — a new event-layer option that classifies each event against the boundaries of its selected org units, tags it with the containing org unit ("Org unit boundary" column/legend info), and excludes/counts events falling outside all of them. Resolves USER_ORGUNIT/_CHILDREN/_GRANDCHILDREN keyword selections via the current user's own org-unit tree (fetched once and cached). A new "Data quality" legend section reports boundary coverage (how many selected org units lack boundary data) alongside the existing missing-coordinates count. A boundary-fetch failure degrades gracefully (keeps events, shows a warning) instead of failing the whole layer.

Quality checklist

Add N/A to items that are not applicable.

  • Dashboard tested
  • Cypress and/or Jest tests added/updated
  • Docs added
  • d2-ci dependencies replaced (maps-gl)
  • Tester approved (@edoardo )

Known issues

  • Parallelize the org-unit-boundary fetch with the main event-data fetch (currently sequential; noted inline in eventLoader.js)
  • Surface partial batch-fetch failures to callers of fetchInBatches (orgUnitLoader.js, thematicLoader.js, eventLoader.js) instead of silently dropping the failed ids — deferred since one caller (orgUnitLoader.js) has no existing test coverage
  • LEVEL-x/OU_GROUP-x org-unit selectors aren't resolved for boundary-coverage counting (currently unreachable — those pickers are hidden for event layers today, but this would need addressing if that changes)
  • Two selected org units at the same level with overlapping boundaries can't be disambiguated when an event's facility path doesn't resolve to either — classification falls back to selection order rather than which boundary actually contains the point
  • Point-in-polygon classification runs synchronously over all loaded events with no chunking, same as the existing createEventFeatures pass — can be slow for very large event layers

Screenshots and tests

Instance: https://dev.im.dhis2.org/maps-app-42-3

image

@BRaimbault BRaimbault changed the title Feat/event layer tooltips and labels feat: filter and count events outside org unit boundaries Jul 3, 2026
@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-3710.maps.netlify.dhis2.org

@dhis2-bot dhis2-bot temporarily deployed to netlify July 3, 2026 09:51 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify July 3, 2026 10:11 Inactive
@BRaimbault BRaimbault changed the title feat: filter and count events outside org unit boundaries feat: add event layer tooltips, labels, and org unit boundary checks Jul 3, 2026
@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 11:08 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 11:16 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 11:40 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 13:34 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 15:37 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 15:41 Inactive
@BRaimbault BRaimbault requested a review from edoardo July 6, 2026 15:50
cy.intercept(
'GET',
'**/me?fields=id%2Cusername%2CdisplayName~rename(name)%2Cauthorities%2Csettings%5BkeyAnalysisDisplayProperty%2CkeyUiLocale%5D',
'**/me?fields=id%2Cusername%2CdisplayName~rename(name)%2Cauthorities%2CorganisationUnits%5Bid%2Cchildren%5Bid%2Cchildren%5Bid%5D%5D%5D%2Csettings%5BkeyAnalysisDisplayProperty%2CkeyUiLocale%5D',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much more readable when using encodeURIComponent like it's done in cypress/integration/usersettings.cy.js below.

@@ -313,16 +333,20 @@ const styleByOptionSet = async (config, engine) => {
// For easier and faster lookup below
// TODO: There might be options with duplicate name, so code/id would be safer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Map is used there should be no duplicates.
If there is a duplicated option the name of the last iterated one ends in the Map.

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants