Skip to content

feat: unapplied changes status indicator and update button removal from modals [DHIS2-22011] - #365

Draft
HendrikThePendric wants to merge 18 commits into
masterfrom
feat/unapplied-changes-DHIS2-22011
Draft

HendrikThePendric wants to merge 18 commits into
masterfrom
feat/unapplied-changes-DHIS2-22011

Conversation

@HendrikThePendric

@HendrikThePendric HendrikThePendric commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Implements DHIS2-22011

Description

This PR consists of two main points:

  1. The update button is removed from the options/dimension modals and we now only have a single "Done" button. Having a single update-button on the modal was misaligned with the 3 update-or-switch-buttons in the layout-panel. It was decided to remove the update button completely and switch to a different UX model where the user first applies changes to the options/layout via the modals and then applies these changes to the visualization via on of the 3 update-or-switch-buttons.
  2. Adds an "unapplied changes" indicator to inform the user that the visualization and the layout are out-of-sync.

This new UX brings much more clarity at the cost of an extra click.


Quality checklist

  • Cypress and/or Jest tests added/updated
  • Docs added N/A
  • d2-ci dependency replaced N/A

Known issues

  • The UI for the "unapplied changes status" is not final yet. This can be addressed later on
  • This PR has not touched the custom value feature, because that is going to be changed significantly in the near future. Two things that will need to be addressed/checked:
    • The modal should work the same as the options and dimension modals: one "Done" button that only hides the modal
    • The check for "unapplied changes" needs to take into account the custom value fields unconditionally. I suspect this could actually need no work once the custom value feature has been updated, but needs to be verified.

@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-365.event-visualizer.netlify.dhis2.org

@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 09:48 Inactive
@HendrikThePendric
HendrikThePendric force-pushed the feat/unapplied-changes-DHIS2-22011 branch from 235e427 to 4693c1e Compare September 2, 2026 10:17
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 10:18 Inactive
@HendrikThePendric
HendrikThePendric force-pushed the feat/unapplied-changes-DHIS2-22011 branch from 4693c1e to 87f019f Compare September 2, 2026 12:00
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 12:01 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 12:16 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 12:19 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 14:28 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 14:43 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 15:10 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 2, 2026 15:18 Inactive
HendrikThePendric and others added 15 commits September 3, 2026 08:58
metadata, populatedVis, and the STAGE_ID/DIMENSION_ID constants were
duplicated verbatim across unapplied-changes-notice.spec.tsx and
use-has-unapplied-changes.spec.ts, including the digitGroupSeparator
explanatory comment. Extract them into a shared fixture module, following
the existing __fixtures__ convention used elsewhere in src/components.
…2011]

The submit handler received the event and ignored it, so closing relied on
Chromium aborting the navigation because React had already unmounted the
disconnected form — and it logged a console warning on every dismiss.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…n [DHIS2-22011]

The comparison ran an API-shaped visualization against a builder-shaped one for
the first time, and the API returns more than the builder can rebuild: option
sets and legend sets carry their name, a repetition carries the context the
backend derives, and the custom value carries its name and aggregation type.
Each difference read as an unapplied change.

Nested metadata refs now compare by id. The wire-only dy/latitude/longitude
dimensions are dropped when normalizing instead of downstream, which also
flips the legacy flag since it changes the persisted shape.

Load-path tests cover each case; every one of them fails without the fix.
…ttom bar [DHIS2-22011]

A pill floating over the canvas sat below the line list's fetch overlay and was
not reliably visible. The bottom bar holds the buttons that apply the change, so
the note belongs beside them, styled like the title bar's Edited suffix.

It now shows only when a change can actually be applied: no applicable output
type means nothing to hint at, and a selected output type that is no longer
applicable means the config changed since it was applied. Output type validity
moves out of useActionButton into a pure module so the buttons and the note
share one source of truth, and gains the check it was missing -- a tracked
entity output with no tracked entity type in the layout now disables the
button, which was previously enabled and threw on click.
The section described sibling DHIS2 apps' helpers, none of which exist in this
repo, so it pointed readers at symbols they could not find.
@HendrikThePendric
HendrikThePendric force-pushed the feat/unapplied-changes-DHIS2-22011 branch from 76ac58b to 3822ec4 Compare September 3, 2026 06:59
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 3, 2026 07:00 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 3, 2026 08:09 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 3, 2026 08:14 Inactive
@HendrikThePendric HendrikThePendric self-assigned this Sep 3, 2026

export type TooltipConfig = { content: string; openDelay?: number } | undefined

const getRegistrationOuTooltipContent = (): TooltipConfig => ({

@edoardo edoardo Sep 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In my PR I renamed these functions to get[something]TooltipConfig since the returned value is a tooltip config object, not just the content.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Odd.... I don't get any conflicts? Maybe you refer to an open PR?

…pplied-changes-DHIS2-22011

# Conflicts:
#	i18n/en.pot
#	src/components/options/options-modal.tsx
@HendrikThePendric
HendrikThePendric marked this pull request as ready for review September 9, 2026 15:31
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 9, 2026 15:32 Inactive
@HendrikThePendric
HendrikThePendric removed the request for review from cooper-joe September 9, 2026 15:33
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@HendrikThePendric
HendrikThePendric marked this pull request as draft September 10, 2026 07:00
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