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: deduplicate organisation unit trees [DHIS2-17994] #2995

Closed
wants to merge 3 commits into from

Conversation

tomzemp
Copy link
Member

@tomzemp tomzemp commented Nov 13, 2024

This PR deduplicates organisation units in the legacy maintenance app. The issue was noticed in the context of merging organisation units (the backend is amending user's organisation units on merge operation, hence see the context of the original ticket: https://dhis2.atlassian.net/browse/DHIS2-17994)

(The deduplication of organisation unit roots will be fixed in our UI Organisation Unit Tree by the following https://dhis2.atlassian.net/jira/software/c/projects/LIBS/issues/LIBS-702; this ticket just pertains to the legacy maintenance app)

Before
image

After
image
(i.e. Split 1, Split 2 OUs only show up in the actual position of Sierra Leone > Bo > Baoma, and not also as separate roots)

Notes:

  • code is copied from maintenance-app-beta (https://github.com/dhis2/maintenance-app-beta/blob/16814c1061ccfc853ca058215df8b0c4c82a9480/src/lib/organisationUnit/findMinimumRootUnits.ts#L12) with some minor modification, in particular for the below point:
  • I have only applied the deduplication on the presentation of the organisation unit trees without any search terms. The application of the search filters currently returns matches that are then passed to the organisation unit tree components as roots, such that when searching for 'Bo', you get results "outside" of the normal tree, for example you'll get Bombali (which has a descendant Bombali Sebora) and then the next result/root will be Bombali Sebora. I'm not sure this is great UI 🙃, but I think it's better to leave it alone
image

@tomzemp tomzemp requested review from Birkbjo and a team November 14, 2024 08:28
@tomzemp tomzemp closed this Nov 26, 2024
@tomzemp
Copy link
Member Author

tomzemp commented Nov 26, 2024

We have decided not to deuplicate in the org unit tree as roots at different level may intentionally be used by some. The underlying issue that prompted this PR (issues relating to split orgunit assignment) has been fixed on the back end.

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.

1 participant