[FIX] v43 scope legacy app tutorials to the DHIS2 versions that ship those apps - #255
Open
anagperal wants to merge 3 commits into
Open
[FIX] v43 scope legacy app tutorials to the DHIS2 versions that ship those apps#255anagperal wants to merge 3 commits into
anagperal wants to merge 3 commits into
Conversation
…hip those apps The Data Entry, Tracker Capture and Pivot Tables modules point at apps that are no longer part of the DHIS2 core: dhis-web-pivot was folded into Data Visualizer in 2.37, and dhis-web-dataentry and dhis-web-tracker-capture were retired in 2.42. On newer instances the tutorial iframe loads a 404. Their dhisAuthorities may also no longer be granted there, in which case list() filters the module out for non-superusers too. Set dhisVersionRange on each so validateDhisVersion marks them incompatible beyond their last supported release, which hides them from the landing page while keeping them listed in Settings with a warning. Bump their revision so instances that already imported them pick up the change on next load. No tutorial content, launch URL or authority is modified: all remain correct for the versions each module is now scoped to.
BundleMonNo change in files bundle size Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
The version selector stopped at 2.42, so modules with an explicit version range could not be marked compatible with 2.43 and were hidden on v43 instances.
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.
📌 References
📝 Implementation
The
data-entry,tracker-captureandpivot-tablesbundled modules pointed at apps that are no longer part of the DHIS2 core, so the tutorial iframe loaded a 404 on recent instances.dhis-web-pivotwas folded into Data Visualizer in 2.37;dhis-web-dataentryanddhis-web-tracker-capturewere retired in 2.42.Set
dhisVersionRangeinside each module zip so they are only offered on the versions that actually ship those apps:data-entrytracker-capturepivot-tablesBumped their
revisioninpublic/modules/config.json(7 → 8) so instances that already imported them pick up the change on next load. The zips andconfig.jsonmust ship together: if the bump reaches an instance without the corrected zips, it re-imports the old module at revision 8 and the real fix no longer propagates.The auto-update only reaches modules that are not locally edited:
listAllpartitions outdated modules by theirdirtyflag and re-imports only the clean ones, flagging the rest with a "There's a new version of this module, please reset to default values to update" warning. On instances where these three modules were never customised — the default — the fix applies without manual intervention. Instances that customised any of them will need a manual reset to default values.One code change: added 2.43 to the
dhisVersionsselector inGeneralInfoStep.tsx, which stopped at 2.42 — modules with an explicit version range could not be marked compatible with v43 and were hidden thereNo tutorial content,
dhisLaunchUrlordhisAuthoritiesis modified — all remain correct for the versions each module is now scoped to.Resulting behaviour: incompatible modules disappear from the landing page, but stay listed in Settings → Modules with a "Module does not support this DHIS2 version" warning, so admins keep visibility and control.
🚧 Pending product decision (not addressed in this PR)
This PR hides the legacy modules; it does not replace them. From 2.42 onwards users have no Data Entry or Tracker Capture tutorial at all. Three decisions are needed to fill that gap.
Decision 1 — Aggregate Data Entry (the app that replaced the legacy one). No module exists for it. Creating one means new tutorial content recorded against the new UI, plus a new module with authority
M_dhis-web-aggregate-data-entryand url/dhis-web-aggregate-data-entry/index.html. It should not reuse thedata-entryid: that would swap the content under existing users while keeping their old progress, and landing pages reference modules by id. Suggested id:aggregate-data-entry.Decision 2 — Tracker programs in Capture. The bundled
Capturemodule (event-capture) covers event programs only; its 8 steps are all event workflows. Tracker workflows are uncovered from 2.42 onwards, now that Tracker Capture is gone. Either extendevent-capturewith tracker steps, or add a separate module pointing at the same app. A separate module keeps per-module progress meaningful (an 18-step module gives misleading completion percentages to someone who only cares about tracker) and preserves the landing-page slot where the old Tracker Capture tile used to sit.Decision 3 — Naming, only relevant once 1 or 2 lands. With the new modules left unscoped (see the constraint below), both the legacy and the new Data Entry module are visible on 2.39–2.41. That is correct rather than a duplicate — both apps genuinely ship in those versions and a user may be on either — and the overlap closes by itself at 2.42. If it is judged confusing in the meantime, the fix is naming, not version scoping: rename the old ones to "Data Entry (legacy)" and "Tracker Capture (legacy)". Cost to weigh:
nameis aTranslatableText, so a rename means redoing the es/fr translations and bumping the module revision again.Leave
dhisVersionRangeempty on any new module. Do not fill in the version selector, even though the field is right there in the creation wizard and this PR does the opposite for the legacy modules.What reads as "2.30–2.41" in the table above is really the string
"2.30,2.31,2.32,…,2.41"spelled out in full. There is no way to express "2.42 and above." So a new module scoped to"2.42,2.43"disappears from every instance the day DHIS2 44 ships, and bringing it back requires a code change, a repackaged zip, a revision bump and an app release — on every DHIS2 release, forever. That treadmill is exactly the bug this PR's code change fixes: the selector had stopped at 2.42.With the field left empty,
dhisAuthoritiesdoes the gating instead, and it maintains itself:M_dhis-web-aggregate-data-entrydoes not exist on older instances, so no user holds it and the module is filtered out. When DHIS2 retires an app, its authority goes with it and the module hides itself. No code change ever.Two things to be aware of, neither of which changes the recommendation:
ALL) bypass the authority filter, so they will see the module on instances where the app is absent. Cosmetic, and limited to one class of user.Why this PR does the opposite for the legacy modules — not a contradiction, an asymmetry. Their version list is closed forever (those apps are never coming back), so it never needs editing. And authorities would not work for them:
M_dhis-web-tracker-capturestill exists in v43, so the authority filter hides nothing — that is precisely the "tile visible, opens a blank iframe" symptom this PR fixes. Closed list → enumerate versions. Open-ended list → let authorities gate.📹 Screenshots/Screen capture
NEW:
Screencast.from.2026-07-22.09-23-44.webm
OLD:
Screencast.from.2026-07-22.09-26-31.webm
🔥 How to test it? (If there is any special consideration or the reviewer does not know how to test it)
Build the app and check old modules do not appear and in settings page they have a warning message
📑 Others