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: enable ou tree and levels/groups with user orgunits and display decent title (DHIS2-18066) #1702

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

janhenrikoverland
Copy link
Collaborator

@janhenrikoverland janhenrikoverland commented Sep 23, 2024

Implements DHIS2-18066


Description

The ability to combine the ou tree and levels/groups with user orgunits is a very powerful and useful feature for users. This was supported earlier, but it was enable due to problems with e.g. priting labels in a meaningful way.

We have decided to re-enable this feature as users really want need it. A fix has been included so that the filter title in pivot tables at least says e.g. "Facility level in User organisation unit" instead of "Facility level in USER_ORG_UNIT".


TODO

  • Manual testing

Screenshots

Before - Org unit selector - When User organisation unit is selected, the tree and levels/groups get disabled):
Screenshot from 2024-09-23 12-29-37

After - Org unit selector - All option enabled:
Screenshot from 2024-09-23 12-29-49

After - Org unit selector - All three user orgunit options selected and a level:
Screenshot from 2024-09-23 12-30-26

After - Pivot table - Filter title showing "User organisation unit" etc instead of "USER_ORG_UNIT":
Screenshot from 2024-09-23 12-30-34

@@ -28,7 +28,9 @@ export const getOuLevelAndGroupText = (filter, metaData) => {

const getLevelAndGroupText = (items, metaData, isLevel) => {
const getNameFromMetadata = (id) =>
metaData.items[id] ? metaData.items[id].name : id
metaData.items[id]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a jest test that covers this code change?

Copy link
Collaborator

@jenniferarnesen jenniferarnesen left a comment

Choose a reason for hiding this comment

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

Please add jest tests for both OrgUnitDimension and getOuLevelAndGroupText. (Copilot can help, also look at PeriodDimension for doing a test on a component)

@janhenrikoverland janhenrikoverland changed the title fix: enable ou tree and levels/groups with user orgunits and display decent title fix: enable ou tree and levels/groups with user orgunits and display decent title (DHIS2-18066) Oct 10, 2024
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.

2 participants