Skip to content

fix: send showHierarchy for pivot table analytics requests - #384

Draft
HendrikThePendric wants to merge 1 commit into
masterfrom
fix/add-showHierarchy-to-pt-analytics-request
Draft

HendrikThePendric wants to merge 1 commit into
masterfrom
fix/add-showHierarchy-to-pt-analytics-request

Conversation

@HendrikThePendric

@HendrikThePendric HendrikThePendric commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Implements DHIS2-22094

Description

"Display organisation unit hierarchy" is offered in the pivot table Style tab but has no effect. The option reached the pivot engine, but showHierarchy was never sent to the analytics API, so no ouNameHierarchy came back.

Sends showHierarchy when the option is on, and adds it to the request identity so toggling refetches. Set on the pivot adapter rather than in ANALYTICS_OPTIONS, which the line list shares and which must not start sending the parameter.

Dependency chain

# Where What Status
1 dhis2-core DHIS2-22119 — no hierarchy metadata returned for a stage-qualified ou open
2 dhis2/analytics#1846 engine finds the org unit dimension and applies the hierarchy open
3 this PR sends showHierarchy=true here

Enrollment pivots work once 2 merges. Event pivots additionally need 1 — until then the backend returns no hierarchy for <stageId>.ou and the option stays inert for them.

Merging 3 without 2 would make enrollment pivots worse than today: the option would blank the table rather than do nothing.


Quality checklist


ToDos


Known issues

  • Event pivots stay inert until DHIS2-22119 is fixed.

🤖 Generated with Claude Code

The "Display organisation unit hierarchy" option reached the pivot table
engine but was never sent to the analytics API, so no ouNameHierarchy
came back and the option had no effect.

Send showHierarchy when the option is on, and include it in the request
identity so toggling it refetches. It is set on the pivot adapter rather
than in ANALYTICS_OPTIONS, which the line list shares and which must not
start sending the parameter.

Points @dhis2/analytics at a d2-ci build for testing; to be replaced with
a released version once that PR is merged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-384.event-visualizer.netlify.dhis2.org

@sonarqubecloud

Copy link
Copy Markdown

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