Skip to content

fix: use the vis type for the file menu dialog labels of event visualizations (DHIS2-22681) - #1883

Open
HendrikThePendric wants to merge 2 commits into
masterfrom
fix/DHIS2-22681-file-menu-dialog-label
Open

HendrikThePendric wants to merge 2 commits into
masterfrom
fix/DHIS2-22681-file-menu-dialog-label

Conversation

@HendrikThePendric

@HendrikThePendric HendrikThePendric commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Implements DHIS2-22681

Key features

  1. The Delete, Rename and Save as dialogs base their label on the vis type for eventVisualization, so a pivot table in IDV says "pivot table" instead of "line list".

Description

IDV passes type="eventVisualization" to FileMenu, and labelForFileType mapped that to the fixed string "line list". IDV also saves pivot tables under that type. type still sets the API endpoint, so it stays as it is.

labelForFileType(fileType, visType) now takes the vis type as an optional second argument. For eventVisualization it looks up a lower-case label for every EventVisualizationType, so new vis types in IDV get a fitting label without another change here:

vis type label
LINE_LIST or none line list
PIVOT_TABLE pivot table
COLUMN, STACKED_COLUMN, BAR, STACKED_BAR, LINE, AREA, STACKED_AREA, PIE, RADAR, SCATTER, BUBBLE e.g. column chart, stacked bar chart, bubble chart
YEAR_OVER_YEAR_LINE, YEAR_OVER_YEAR_COLUMN year over year line chart, year over year column chart
GAUGE, SINGLE_VALUE gauge, single value
anything unknown visualization

The labels are separate lower-case i18n strings rather than lower-cased getDisplayNameByVisType output, because lower-casing translated strings breaks some languages (German nouns, for example) and some display names read oddly mid-sentence ("Year over year (column)").

Wiring:

  • RenameDialog and SaveAsDialog read object.type.
  • DeleteDialog gets a new optional visType prop, which FileMenu fills from fileObject.type.

Other apps:

  • Data Visualizer (visualization), Maps (map), event reports: no change, since only eventVisualization uses the vis type.
  • Line Listing: LINE_LIST and a missing vis type both keep "line list".

New i18n strings: one lower-case label per vis type (see table).


Quality checklist

  • Dashboard tested N/A
  • Cypress and/or Jest tests added/updated
  • Docs added N/A
  • Tester approved (Name of tester, App(s) tested)

Jest tests added for labelForFileType (including one that every EventVisualizationType has its own label), the three dialogs, and the FileMenu → DeleteDialog wiring. Not tested in a running app yet.

Follow-up: bump @dhis2/analytics in IDV once this is released.

🤖 Generated with Claude Code

HendrikThePendric and others added 2 commits December 3, 2026 16:20
…izations (DHIS2-22681)

The Delete, Rename and Save as dialogs used the fixed label "line list"
for every eventVisualization. IDV also saves pivot tables as
eventVisualization, so those dialogs said "line list" for pivot tables.

The label for eventVisualization now comes from the vis type: "line
list" for LINE_LIST (and when no vis type is set), "pivot table" for
PIVOT_TABLE and "visualization" for anything else. Labels for the other
file types are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…681)

Look up a lower-case label for every EventVisualizationType, so new vis
types in IDV get a fitting label in the Delete, Rename and Save as
dialogs without another change here. Unknown types still fall back to
"visualization".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

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.

1 participant