refactor: reorganise visualization module - #367
Draft
HendrikThePendric wants to merge 8 commits into
Draft
HendrikThePendric wants to merge 8 commits into
HendrikThePendric wants to merge 8 commits into
Conversation
Contributor
|
🚀 Deployed on https://pr-367.event-visualizer.netlify.dhis2.org |
edoardo
previously approved these changes
Sep 4, 2026
HendrikThePendric
force-pushed
the
feat/unapplied-changes-DHIS2-22011
branch
from
September 22, 2026 09:45
52c0035 to
92a36c5
Compare
…2-22011] Deciding whether there are unapplied changes needs to know which output types the current config can produce, which until now only the action button hook could work out. Pure move: the existing tests cover it unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…[DHIS2-22011] Validity only asked whether the layout held more than one tracked entity type. A layout holding none — only context-free dimensions such as Last updated on — passed every check, so the button stayed enabled and clicking it threw. Found while reusing this validity check for the unapplied changes indicator, which has to know whether an output type can be produced at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…n [DHIS2-22011] A legacy Event Report persists its value column as a dy/latitude/longitude dimension. The app expresses that with the custom value fields instead and holds no layout position for them, so they survived a load without ever being rebuildable from visUiConfig — enough on its own to make a freshly loaded visualization look edited. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
areVisualizationsEquivalent only had to answer "does the saved visualization differ from the current one". Comparing the current visualization against the one visUiConfig would produce needs the same notion of equivalence, so export it and fold the per-field rules into one helper. Fields the API returns richer than visUiConfig can rebuild now compare by id: option sets and legend sets carry a name, a repetition carries the context the backend derives from its dimension, and the custom value carries both a name and an aggregation type. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…22011] Editing the layout or the options changes visUiConfig, which does not reach the visualization on screen until the user applies it. Nothing said so, which left the canvas silently disagreeing with the panel next to it. The indicator only appears when the user can act on it: it stays hidden when no output type can be produced from the config at all, since every button that would apply the change is disabled in that case. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The section described sibling DHIS2 apps' helpers, none of which exist in this repo, so it pointed readers at symbols they could not find. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
HendrikThePendric
force-pushed
the
feat/unapplied-changes-DHIS2-22011
branch
from
September 22, 2026 13:07
92a36c5 to
5f3f681
Compare
HendrikThePendric
force-pushed
the
refactor/reorganise-visualization-module
branch
from
September 22, 2026 14:00
5540ae7 to
60d66f3
Compare
Some files had grown a bit out of control
HendrikThePendric
force-pushed
the
refactor/reorganise-visualization-module
branch
from
September 22, 2026 14:16
60d66f3 to
afe4bd7
Compare
|
HendrikThePendric
force-pushed
the
feat/unapplied-changes-DHIS2-22011
branch
from
September 23, 2026 15:23
5f3f681 to
5d728ed
Compare
Base automatically changed from
feat/unapplied-changes-DHIS2-22011
to
master
September 24, 2026 15:13
HendrikThePendric
dismissed
edoardo’s stale review
September 24, 2026 15:13
The base branch was changed.
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 N/A
Description
This does not need a thorough review since all this PR does is move some stuff around.
The main issue was that
state.tsheld six unrelated concerns in 684 lines. Each now lives in a file with a more specific name. I tried to stick to the general guideline that says "a file should be named for what it produces", but this didn't always work completely, so we now ended up withguards,normalize-legacy,ui-config,save, andcurrent-vis(which now also hasbuildCurrentVisFromVisUiConfigfrom the store, since that produces aCurrentVisualization).state.tskeeps the comparison.removeDimensionPropertiesBeforeSavingwas moved to the dimension domain: it produces aDimensionArrayand has callers in two concerns.Quality checklist
ToDo