Skip to content

fix: [DHIS2-21708] Org unit selector is expanded when form open if no org unit in top bar#4629

Open
henrikmv wants to merge 23 commits into
masterfrom
hv/fix/DHIS2-21708_expanded-org-unit-selector
Open

fix: [DHIS2-21708] Org unit selector is expanded when form open if no org unit in top bar#4629
henrikmv wants to merge 23 commits into
masterfrom
hv/fix/DHIS2-21708_expanded-org-unit-selector

Conversation

@henrikmv

@henrikmv henrikmv commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

DHIS2-21708

Refactors the SingleOrgUnitSelectField from an always-visible org unit tree into a collapsed dropdown with a popover. When no value is selected, the user sees a combobox trigger with a chevron icon. Clicking it opens a Popover containing the org unit tree, with a debounced search input embedded in the trigger.

Key changes:

  • SingleOrgUnitSelectField: replaces inline tree with a trigger + Popover pattern, adds keyboard navigation, debounced search, and open/close state management.
  • OrgUnitField: adds hideSearchField and searchText props so the parent can control search externally.

devin-ai-integration[bot]

This comment was marked as resolved.

@henrikmv henrikmv marked this pull request as draft June 26, 2026 13:24
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

Open in Devin Review

@github-actions

Copy link
Copy Markdown

@henrikmv henrikmv added testing and removed testing labels Jun 30, 2026
@henrikmv henrikmv added testing and removed testing labels Jun 30, 2026
@henrikmv henrikmv added testing and removed testing labels Jul 1, 2026
@henrikmv henrikmv marked this pull request as ready for review July 1, 2026 10:20
render() {
const { value } = this.props;
return value ? this.renderSelectedOrgUnit(value) : this.renderOrgUnitField();
return value ? this.renderSelectedOrgUnit(value) : this.renderCollapsedOrgUnitField();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was this bug confirmed by Product or UX? I am asking because it doesn't look like a bug to me. The org unit component is expanded throughout the entire app (e.g in forms with OrgUnit TEAs or DEs, when adding a new relationship, or when linking events, etc.). The only place that comes to mind where it is currently collapsed is the Context Top bar. So, in general, we seem to tend to have it expanded by default if there is space. I've attached a few examples where it appears expanded, but there are many others.

Image Image Image

Thank you!

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants