Skip to content

feat: [DHIS2-21941] Self contained changelog widget - #4690

Open
henrikmv wants to merge 54 commits into
hv/feat/DHIS2-21655_uncomplete-event-view-modefrom
hv/chore/DHIS2-21941_SingleSourceChangelogValues
Open

feat: [DHIS2-21941] Self contained changelog widget#4690
henrikmv wants to merge 54 commits into
hv/feat/DHIS2-21655_uncomplete-event-view-modefrom
hv/chore/DHIS2-21941_SingleSourceChangelogValues

Conversation

@henrikmv

@henrikmv henrikmv commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

DHIS2-21941

Reason behind this initiative: The fourth implementation of the Changelog, introduced in #4657, highlighted the need to make it easier to reuse.

This PR makes changelog widgets self-contained by removing the entityData / eventData / trackedEntityData props that were passed down from parent components. Instead, the changelog now fetches current entity values directly from the tracker API via a new useCurrentEntityValues hook.

Key changes

  • New useCurrentEntityValues hook — fetches current values from tracker/events/{id} or tracker/trackedEntities/{id}, replacing the prop-based approach.

  • Improved isLatestValue detection — previously compared change.currentValue against a prop-provided snapshot. Now validates against both the newest changelog entry per field and fresh API data.

  • Centralized removeChangelogQueries — extracts duplicated cache invalidation into a shared utility, and adds invalidation for two new mutation sites: CompletionMenuItem and SkipAction.

  • Opening the changelog now fires one extra tiny tracker/{events|trackedEntities}/{id}?fields=…[…,value] fetch, but it runs in parallel with the (slower) changelog list request, is cached with staleTime: Infinity so reopens are free, and is skipped entirely for changelogs without FILE_RESOURCE/IMAGE fields. In return, the widget becomes fully self-contained — no more entityData prop drilled from three different-shaped parent sources, and no more fragile ?.value hack that silently broke on stale parent caches.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

devin-ai-integration[bot]

This comment was marked as resolved.

@henrikmv henrikmv added testing and removed testing labels Aug 5, 2026
@henrikmv
henrikmv marked this pull request as ready for review August 5, 2026 14:57
@henrikmv
henrikmv requested a review from a team as a code owner August 5, 2026 14:57
@henrikmv henrikmv added testing and removed testing labels Aug 5, 2026
@henrikmv
henrikmv marked this pull request as draft August 6, 2026 06:45
@henrikmv
henrikmv marked this pull request as ready for review August 6, 2026 06:48
@henrikmv henrikmv added testing and removed testing labels Aug 6, 2026
@henrikmv henrikmv changed the title feat: [DHIS2-21941] Single source for changelog values feat: [DHIS2-21941] Self contained changelog widget Aug 6, 2026
@henrikmv
henrikmv marked this pull request as draft August 15, 2026 20:00
@henrikmv henrikmv added testing and removed testing labels Aug 28, 2026
…/chore/DHIS2-21941_SingleSourceChangelogValues
@henrikmv
henrikmv marked this pull request as ready for review August 28, 2026 12:18
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@simonadomnisoru simonadomnisoru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good job! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants