Skip to content

[fix]: Update org unit parameter changes in v42#387

Open
deeonwuli wants to merge 5 commits into
developmentfrom
fix/tracker-data-population-v42
Open

[fix]: Update org unit parameter changes in v42#387
deeonwuli wants to merge 5 commits into
developmentfrom
fix/tracker-data-population-v42

Conversation

@deeonwuli
Copy link
Copy Markdown

@deeonwuli deeonwuli commented Mar 4, 2026

📌 References

📝 Implementation

  • Refactored buildOrgUnitMode to check the api version and return the ou parameters correctly

🔥 Notes for the reviewer

📹 Screenshots/Screen capture

Screen.Recording.2026-03-04.at.17.08.34.mov

📑 Others

#869cb326m

@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented Mar 4, 2026

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
1.72MB (+152B +0.01%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Copy Markdown

@gqcorneby gqcorneby left a comment

Choose a reason for hiding this comment

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

Thanks @deeonwuli! Just a minor comment

Comment thread src/data/Dhis2RelationshipTypes.ts Outdated
return { ouMode, orgUnit: buildOrgUnitsParameter(orgUnits) };
const orgUnitsParam = buildOrgUnitsParameter(majorVersion, orgUnits);
if (majorVersion >= 42) return { orgUnitMode: ouMode, orgUnits: orgUnitsParam };
else if (majorVersion === 41) return { ouMode: ouMode, orgUnit: orgUnitsParam };
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks like the return for this is the same as the one in the else branch, we can remove this else if branch, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Right 👌

@deeonwuli deeonwuli requested a review from gqcorneby March 5, 2026 07:28
Copy link
Copy Markdown

@gqcorneby gqcorneby left a comment

Choose a reason for hiding this comment

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

All good!

@deeonwuli deeonwuli requested a review from MatiasArriola March 24, 2026 10:47
@deeonwuli
Copy link
Copy Markdown
Author

I have added @MatiasArriola to review these changes as he suggested some improvements.

Copy link
Copy Markdown

@MatiasArriola MatiasArriola left a comment

Choose a reason for hiding this comment

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

Now the getVersion call is cached, getExistingTeis handles v42, and the !isOuReq condition is handled.

All of this was because I was evaluating the approach to support v42 in generic apps.
I think this PR is the most sensible short-term approach, until we have new releases of d2-api available.
Once we have d2-api ready to support these v42 changes, we could replace this implementation.

Thanks for the updates @deeonwuli !

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.

3 participants