You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: stop merging analytics response metadata into the global store (#286)
* fix: stop merging analytics response metadata into the global store
The /api/analytics enrollments aggregate response carries the generic
backend field name "Organisation unit" keyed by the compound stage-OU id
(e.g. "stageId.ou"). When the analytics-merge ingested this into the
metadata store, it clobbered the program-specific label set from
program.displayOrgUnitLabel — visible as the "Event org. unit" chip on
a PT switching to "Organisation unit" after Update.
The merge was redundant for every consumer of the store. Layout dimension
records, fixed-dimension labels, and selected items come from the
visualization-load (vis.metaData echoes selected items with their names).
Dimension modals write selected item names at selection time. Option-set
and legend-set names come from dedicated follow-up requests. The PT/LL
table cells consume analyticsResponse.metaData.items ephemerally and
never read the store for cell values.
Removes addAnalyticsResponseMetadata, the analytics-data.ts module, and
the onResponsesReceived prop plumbing through PluginWrapper, the PT/LL
plugins and their hooks. Spinner control gets a simpler onDataAvailable
signal in their place.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: drop unneeded type assertion on second setVisualizationMetadata call
Sonar S4325: TypeScript infers the type after the first call, so the cast
on the second one is redundant. Extracting the cast to a local removes it
without altering behaviour.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* refactor: keep the onResponseReceived name on the spinner-control callback
Reverting the onDataAvailable rename from the previous commit. Despite the
callback no longer carrying the response data, the name still describes the
event we're responding to (an analytics response arrived); the rename was
beyond the scope of the fix.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* chore: adjust visualization loading state assertion
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments