[Batch Edit] Persist every edited language for localized data object fields (#2492)#3893
Closed
xIrusux wants to merge 2 commits into
Closed
[Batch Edit] Persist every edited language for localized data object fields (#2492)#3893xIrusux wants to merge 2 commits into
xIrusux wants to merge 2 commits into
Conversation
…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>
|
Contributor
Author
|
Superseded by #3895 (targets and based on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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'snamebetween 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
useBatchEditLocalesForm.Itemper language (only selected visible); noinitialValueon localized items so untouched languages aren't submitteditemssignature (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.
tscpasses with no dangling references.Notes / risks
package-buildarchive); no build artifacts committed.name={key}— separate concern if per-locale is ever needed there.🤖 Generated with Claude Code