Skip to content

Conversation

@edoardo
Copy link
Member

@edoardo edoardo commented Dec 10, 2025

Implements DHIS2-20667

Description

This PR adds the DimensionModal component.
This renders the modal, modal title and action buttons.
The content for the modal is going to be implemented in several components depending of the dimension type.

The PR also has some fixes on types.

The Chip menu actions are now connected to the Redux store, so it's possible to move a dimension between the layout axes and remove a dimension from any axes.
The same reducer action is used for the split button in the dimension modal, which shows for dimensions that are not yet added to the layout (ie. in the main sidebar).


Quality checklist

Add N/A to items that are not applicable and check them.


ToDos

  • check the GenericMetadataItem type I added to avoid type errors in normalisation.spec.ts.

Screenshots

Examples of dimension modal opened:
Screenshot 2025-12-10 at 16 17 53
Screenshot 2025-12-10 at 16 17 47
Screenshot 2025-12-10 at 16 17 41

@dhis2-bot
Copy link

dhis2-bot commented Dec 10, 2025

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

@dhis2-bot dhis2-bot temporarily deployed to netlify December 10, 2025 15:19 Inactive
Copy link
Collaborator

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

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

Looking good! I did leave a few comments though.

@dhis2-bot dhis2-bot temporarily deployed to netlify December 15, 2025 10:35 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify December 15, 2025 12:39 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify December 15, 2025 13:00 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify December 15, 2025 13:24 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify December 15, 2025 14:18 Inactive
@edoardo edoardo marked this pull request as ready for review December 15, 2025 14:54
@edoardo edoardo force-pushed the feat/dimension-modal branch from 8f059ae to 5c9e1f8 Compare December 15, 2025 15:18
@dhis2-bot dhis2-bot temporarily deployed to netlify December 15, 2025 15:19 Inactive
@edoardo edoardo changed the title feat: implement Dimension modal component feat: implement Dimension modal component [DHIS2-20667] Dec 15, 2025
@edoardo edoardo merged commit e5891f8 into master Dec 15, 2025
22 of 23 checks passed
@edoardo edoardo deleted the feat/dimension-modal branch December 15, 2025 15:26
HendrikThePendric added a commit that referenced this pull request Jan 5, 2026
* chore: add dnd-kit dependency

* refactor: make ChipBase a purely presentational component

* chore: add reducers to add move and remove dimensions from the layout

* chore: add drag and drop provider components

* chore: add DndContextProvider to AppWrapper

* chore: make Axis a SortableContext with axis id

* chore: add DndMonitor to DnDContextProvider

* chore: make chip draggable WIP

* chore: add tests for reordering same axis

* chore: tweak drag-and-drop-types

* chore: refactor DimensionMonitor component to useDimensionDragEndMonitor hook and implement correct sorting

* chore: implement insert marker and dragging onto empty dimension

* fix: do not use DnD hooks outside of their context

* chore: add tests for `useOnDragEnd`

* chore: fix unit tests

* chore: defer implementation of adding metadata to store from sidebar

* fix: use chip-end activation div for all chips

This helps when the chips are multiple lines:
this way you can always insert after and before any given chip

* feat: implement Dimension modal component [DHIS2-20667] (#112)

* chore: delegate sorting responsibility fully to the reducer

* chore: omprove DnD testing by adding provider to mock app and adding test attributes

* chore: implement sorting logic in reducer and tests for edge cases

* fix: do no show insert marker on chips adjacent to the active chip

* chore: fix cypress component drag-and-drop test

* fix: do not show insert marker on adjacent items

* fix: drag to empty axis bug and prevent types being any

* chore: add tests for insert marker display logic

* chore: fix types again

* chore: tweak dragging styles

* chore: remove displayName from LayoutDimension

* chore: rename deleteVisUiConfigLayoutDimension to removeVisUiConfigLayoutDimension

* chore: exclude active item from collisions

* chore: remove empty axis drop area and make axis a drop zone

* chore: fix metadata store dev tools

* chore: improve collision detector

* chore: improve chip dragging behaviour

* fix: prevent flash when entering chip at end

* fix: reimplement insert marker to address jumpiness

* chore: fix failing DnD Cypress tests

* chore: add unit test for marker visibility and position

---------

Co-authored-by: Edoardo Sabadelli <edoardo@dhis2.org>
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.

4 participants