fix: send showHierarchy for pivot table analytics requests - #384
Merged
HendrikThePendric merged 3 commits intoSep 22, 2026
Merged
Conversation
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>
Contributor
|
🚀 Deployed on https://pr-384.event-visualizer.netlify.dhis2.org |
edoardo
previously approved these changes
Sep 21, 2026
|
edoardo
approved these changes
Sep 22, 2026
HendrikThePendric
deleted the
fix/add-showHierarchy-to-pt-analytics-request
branch
September 22, 2026 08:03
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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
showHierarchywas never sent to the analytics API, so noouNameHierarchycame back.The app now sends
showHierarchywhen the option is on, and adds it to the request identity so toggling refetches. It is set on the pivot adapter rather than inANALYTICS_OPTIONS, which the line list shares and which must not start sending the parameter.That is all this app can do. The option still needs
@dhis2/analyticsto return different data before it works end to end — and, for event pivots, the backend to return the hierarchy at all.Dependency chain
ou(#25259)showHierarchy=trueEnrollment pivots work once 2 merges. Event pivots additionally need 1.
Merging 3 without 2 would make enrollment pivots worse than today: the option would blank the value grid rather than do nothing.
How to verify
Test against an instance built from dhis2-core#25259, such as https://dev.im.dhis2.org/org-unit-hierarchy. This PR has a d2-ci build of analytics#1846 pinned so the full solution can be tested using the Netlify link below as follows:
Sierra Leone / Bo), byte-identical valuesBo / Wondeis followed byBombali / Biriwa) and every value cell stays populated; of the org units present in both renderings, all 54 carry the same valueshowHierarchy=trueis on the request only while it is onQuality checklist
🤖 Generated with Claude Code | edited by @HendrikThePendric