feat: organisation-unit-tree to support shortname (DHIS2-21561)#1745
Merged
KaiVandivier merged 2 commits intoMay 26, 2026
Conversation
Contributor
|
🚀 Deployed on https://pr-1745--dhis2-ui.netlify.app |
|
HendrikThePendric
approved these changes
May 26, 2026
KaiVandivier
approved these changes
May 26, 2026
dhis2-bot
added a commit
that referenced
this pull request
May 26, 2026
# [10.16.0](v10.15.1...v10.16.0) (2026-05-26) ### Features * **organisation-unit-tree:** add displayProperty prop to support shortname (DHIS2-21561) ([#1745](#1745)) ([447d3db](447d3db))
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Ref this subtask: https://dhis2.atlassian.net/browse/DHIS2-21561
Adds a
displayPropertyprop toOrganisationUnitTreeso consumers can render labels withdisplayShortNameinstead ofdisplayName.Context: DHIS2 has a
keyAnalysisDisplayPropertysystem/user setting that the analytics apps (data-visualizer, line-listing, dashboards) already plumb through@dhis2/analytics'sOrgUnitDimensionasdisplayNameProp. That dead-ended at the tree though, since there was no matching prop on this side. This PR is the missing piece.Both
useDataQuerycalls use the field-rename trick when a non-defaultdisplayPropertyis passed:${displayProperty}~rename(displayName)children[id,path,${displayProperty}~rename(displayName)]When
displayPropertyis the default'displayName', the field strings stay byte-identical to before, so the wire format and existing mocks are unchanged. The internal node shape always exposes.displayName, so no render-side code moves and existing callers see no difference. Fully backwards compatible.@dhis2/analyticsstill needs a small change to actually forwarddisplayPropertythroughOrgUnitDimension, but that's a separate PR.Also fixed two pre-existing react-hooks/exhaustive-deps warnings in
use-org-children.jsthat CI surfaced once the file was in the diff (node.childrenmissing fromuseMemo,nodemissing fromuseEffect). Both effects already guard against unwanted re-runs, so behavior is unchanged.Checklist