Skip to content

[Batch Edit] Persist every edited language for localized data object fields (#2492)#3893

Closed
xIrusux wants to merge 2 commits into
2026.2from
fix/2492-batch-edit-multi-language
Closed

[Batch Edit] Persist every edited language for localized data object fields (#2492)#3893
xIrusux wants to merge 2 commits into
2026.2from
fix/2492-batch-edit-multi-language

Conversation

@xIrusux

@xIrusux xIrusux commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #2492

Problem

Batch-editing a localized data object field only persisted the language selected at save time. Editing e.g. German and English submitted only {"localizedfields":{"name":{"de":"…"}}}.

Root cause: the language selector swapped a single Form.Item's name between languages. antd/rc-field-form keys the field by its name path, so a name change unmounts the old-language field; at submit, getFieldsValue() only collects currently-registered fields — so every language except the last-selected was dropped.

Fix

  • data-object-adapter-component.tsx — builds per-language entries via useBatchEditLocales
  • batch-edit-form-item.tsx — renders one mounted Form.Item per language (only selected visible); no initialValue on localized items so untouched languages aren't submitted
  • use-batch-edit-locales.ts, get-batch-edit-field-name.ts — the helpers it relies on
  • classification-store + object-brick — updated to the new items signature (single entry, behavior unchanged)

Editing multiple languages now yields {"localizedfields":{"name":{"de":"…","en":"…"}}}; languages the user didn't touch are omitted (not overwritten with null).

Scope

Reverted six unrelated generic batch-edit component changes to HEAD and dropped a now-unused wrapper, keeping the fix scoped to the data-object adapter path. tsc passes with no dangling references.

Notes / risks

  • Frontend build is regenerated by CI (package-build archive); no build artifacts committed.
  • Advanced classification-store / object-brick localized fields keep their prior single-language behavior (out of scope for [Grid][Batch editing] edit several languages at the same time #2492).
  • Non-data-object (asset metadata) generic components are back to flat name={key} — separate concern if per-locale is ever needed there.

🤖 Generated with Claude Code

xIrusux and others added 2 commits July 15, 2026 15:53
…fields (#2492)

Batch-editing a localized data object field only saved the language selected
at save time. The language selector swapped a single Form.Item's name between
languages; antd unmounts the field on a name change and only collects values
from currently-registered fields at submit, so every language except the last
selected was dropped.

Render one Form.Item per required language (all kept mounted, only the selected
one visible) so every edited language is submitted. Localized items carry no
initialValue, so languages the user did not touch are omitted from the payload
instead of being sent as null (which would overwrite existing translations).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xIrusux
xIrusux requested a review from vin0401 July 15, 2026 13:59
@xIrusux xIrusux self-assigned this Jul 15, 2026
@xIrusux xIrusux modified the milestones: 2026.2.1, 2026.3.0 Jul 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

@xIrusux xIrusux closed this Jul 15, 2026
@xIrusux
xIrusux deleted the fix/2492-batch-edit-multi-language branch July 15, 2026 14:00
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 2026
@xIrusux

xIrusux commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #3895 (targets and based on 2026.x instead of 2026.2).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant