Skip to content

fix: send the skipTranslation param when saving a visualization - #3482

Merged
janhenrikoverland merged 2 commits into
masterfrom
fix/skip-translation-param
Dec 1, 2026
Merged

janhenrikoverland merged 2 commits into
masterfrom
fix/skip-translation-param

Conversation

@janhenrikoverland

@janhenrikoverland janhenrikoverland commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Description

When saving a visualization the app sent skipTranslations=true, but the api only knows skipTranslation (singular, see DefaultMetadataImportService.getParamsFromMap in dhis2-core). The misspelled parameter was silently ignored: it behaves exactly like sending no parameter.

The app fetches translations with the visualization and sends them back in the save payload, so on every save (PUT) the stored translations were replaced with the ones the app had in memory. Two consequences:

  • Translate a visualization via File > Translate, then save without reloading: the translation that was just entered is reverted, because the app does not refresh its in-memory translations after the dialog.
  • Translations changed elsewhere while the visualization is open are overwritten on save.

With the correct parameter the api leaves the stored translations alone on save.

Only saving an existing visualization (PUT) changes behaviour. The parameter is also sent on "Save as" (POST), but the api never stores payload translations on create, with or without the parameter, so the copy has no translations before and after this change. skipSharing was already spelled correctly.

Same fix as dhis2/individual-data-visualizer-app#517. No Jira issue is linked yet.


Testing

Verified against live 2.41.11, 2.42.7.1 and 2.43.2.1 instances, with identical results on all three.

Request Payload translations Stored before Stored after
PUT ?skipTranslations=true&skipSharing=true (before) stale fr newer fr, nb overwritten with the stale fr, nb lost
PUT ?skipTranslation=true&skipSharing=true (this PR) stale fr newer fr, nb unchanged
PUT with this PR's param, translations: [] or omitted none fr, nb unchanged (wiped without the param)
POST (save as), either param or none fr, nb n/a copy created without translations

All requests returned 200/201 with empty errorReports; other changed fields were saved and sharing was untouched.

In the app (build of master versus build of this branch, on 2.42; this branch also on 2.41 and 2.43):

  • Open a translated visualization, change its translations out-of-band, change the type and save: master overwrites the stored translations, this branch keeps them. The type change is saved in both.
  • File > Translate, then save in the same session: master reverts the new translation, this branch keeps it.
  • File > Rename and File > Save as work as before.

Jest: 41 suites / 190 tests pass; the new spec fails against the master source. Cypress saveAndRename.cy.js passes locally (6/6).

Not tested: 2.40 (no instance available; dhis2-core reads skipTranslation on the 2.40 branch too) and non-admin users.


Quality checklist

  • Dashboard tested — N/A
  • Cypress and/or Jest tests added/updated
  • Docs added — N/A
  • d2-ci dependency replaced — N/A
  • Tester approved (name) — N/A (verified against live instances as described above)

🤖 Generated with Claude Code

The api only knows skipTranslation, so the misspelled skipTranslations
was ignored and a save replaced the stored translations with the ones
the app had loaded with the visualization.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@dhis2-dev-status

Copy link
Copy Markdown

Release check (trial)

Jira issue Missing
Issue type Missing
Expected commit type chore, refactor, perf, test, docs, ci, build (title uses fix ✗)
Issue target versions Missing
PR target version 2.44, 2.43.3 (frozen), 2.42.8, 2.41.12
PR fix version 2.44, 2.42.8, 2.41.12 (if merged now)
PR fixed app version v101.6.7 if merged now (fix → patch; latest is v101.6.6)
Frozen version Yes: patch/2.43.3 pins v101.6.5, so this reaches 2.43.3 only if the pin moves

@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-3482.data-visualizer.netlify.dhis2.org

@dhis2-bot
dhis2-bot temporarily deployed to netlify November 30, 2026 13:58 Inactive
@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

@dhis2-bot
dhis2-bot temporarily deployed to netlify December 1, 2026 23:18 Inactive
@janhenrikoverland
janhenrikoverland merged commit 3685d4b into master Dec 1, 2026
65 of 70 checks passed
@janhenrikoverland
janhenrikoverland deleted the fix/skip-translation-param branch December 1, 2026 23:44
dhis2-bot added a commit that referenced this pull request Dec 1, 2026
## [101.6.8](v101.6.7...v101.6.8) (2026-12-01)

### Bug Fixes

* send the skipTranslation param when saving a visualization ([#3482](#3482)) ([3685d4b](3685d4b))
@dhis2-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 101.6.8 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

This branch was previously deployed

1 inactive deployment
netlify — aad8c871 Deployed Dec 1, 2026 by dhis2-bot
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