Skip to content

feat: axis disabling [DHIS2-21565]#249

Open
HendrikThePendric wants to merge 13 commits into
masterfrom
chore/axis-disabling-DHIS2-21565
Open

feat: axis disabling [DHIS2-21565]#249
HendrikThePendric wants to merge 13 commits into
masterfrom
chore/axis-disabling-DHIS2-21565

Conversation

@HendrikThePendric
Copy link
Copy Markdown
Contributor

@HendrikThePendric HendrikThePendric commented May 29, 2026

Implements DHIS2-21565

Description

This PR implements the following axis disabling features for pivot tables:

  • Disabling Axis for Drag and Drop
  • Disabling Axis in menu items
  • Changing behaviour of the + button when an axis is disabled
  • In the conditions modal, ensure the Add to filter and Hide are the only modal actions

Disabling happens for dimensions that are not aggregatable, and a dimension is classified as aggregatable when:

  • Its dimensionType is one of:
    • PROGRAM_INDICATOR
    • STATUS
    • CATEGORY
    • CATEGORY_OPTION_GROUP_SET
    • ORGANISATION_UNIT_GROUP_SET
  • OR its valueType is numeric:
    • NUMBER
    • UNIT_INTERVAL
    • PERCENTAGE
    • INTEGER
    • INTEGER_POSITIVE
    • INTEGER_NEGATIVE
    • INTEGER_ZERO_OR_POSITIVE
    • BOOLEAN
    • TRUE_ONLY

Multi select

When in multi-select mode we use the same logic as we do when dragging a single dimension, but we apply the check to all items. So this means that if one out of many items is "non-aggregatable" the axis is disabled.

DnD hooks and helpers

While working on the DraggableDimensionItem I found that the component was starting to get boated, so I created a hook to encapsulate the DnD logic. I found this to be quite a nice pattern so I decided to do it for the layout chip. Similarly, I needed to export a new helper from the DnD provider dir, and found some of the current helpers to be exported from a hook file, so I created a new dnd-data.ts file and moved the helpers there.


Quality checklist

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

ToDo


Screenshots

Screenshot 2026-05-29 at 09 24 15

@dhis2-bot
Copy link
Copy Markdown

dhis2-bot commented May 29, 2026

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

@dhis2-bot dhis2-bot temporarily deployed to netlify May 29, 2026 09:46 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify May 29, 2026 09:59 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify May 29, 2026 10:17 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify June 1, 2026 07:46 Inactive
@cooper-joe
Copy link
Copy Markdown
Member

I've pushed a commit for the styles, which are now applied to the inner .content rather than on the main .container.

cursor: not-allowed is not having an effect because there is no collision when hovering a disabled container. I think we may want to adjust that behaviour, but I'm leaving noting as an enhancement that we can do following this PR. I've also noted a few dragging styles that need adjustment, so I'll log them together.

So, design LGTM. Logic needs adjustment, as noted in Slack, we can discuss there.

@dhis2-bot dhis2-bot temporarily deployed to netlify June 1, 2026 08:53 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify June 1, 2026 14:59 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify June 2, 2026 13:03 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify June 2, 2026 13:52 Inactive
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

@HendrikThePendric HendrikThePendric enabled auto-merge (squash) June 3, 2026 09:35
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