Skip to content

Commit

Permalink
fix: system / user setting for display name not respected in Org Unit…
Browse files Browse the repository at this point in the history
… tree (DHIS2-15000) (#1664)
  • Loading branch information
martinkrulltott authored May 8, 2024
1 parent 743d7ff commit 899358d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/OrgUnitDimension/OrgUnitDimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const OrgUnitDimension = ({
hideLevelSelect,
hideUserOrgUnits,
warning,
displayNameProp,
}) => {
const [ouLevels, setOuLevels] = useState([])
const [ouGroups, setOuGroups] = useState([])
Expand Down Expand Up @@ -79,13 +80,16 @@ const OrgUnitDimension = ({
setOuLevels(result)
}
const doFetchOuGroups = async () => {
const result = await apiFetchOrganisationUnitGroups(dataEngine)
const result = await apiFetchOrganisationUnitGroups(
dataEngine,
displayNameProp
)
setOuGroups(result)
}

!hideLevelSelect && doFetchOuLevels()
!hideGroupSelect && doFetchOuGroups()
}, [dataEngine, hideLevelSelect, hideGroupSelect])
}, [dataEngine, hideLevelSelect, hideGroupSelect, displayNameProp])

const onLevelChange = (ids) => {
const items = ids.map((id) => ({
Expand Down Expand Up @@ -369,6 +373,7 @@ OrgUnitDimension.defaultProps = {
}

OrgUnitDimension.propTypes = {
displayNameProp: PropTypes.string,
hideGroupSelect: PropTypes.bool,
hideLevelSelect: PropTypes.bool,
hideUserOrgUnits: PropTypes.bool,
Expand Down

0 comments on commit 899358d

Please sign in to comment.