fix(edit-content): handle null values in key-value field after import#35246
Merged
fix(edit-content): handle null values in key-value field after import#35246
Conversation
Add null coalescing to parseToDotKeyValue() so that null values from the API are displayed as empty strings instead of being dropped. Closes #32823
Contributor
Contributor
Rollback Safety Analysis
Result: ✅ Safe To Rollback This PR contains a single one-line change in a frontend TypeScript file: The change does not match any rollback-unsafe category:
The change only affects how null values are rendered in the key-value field editor component. Rolling back to N-1 simply reverts this UI fix — null values would again be silently dropped in the display, but no data loss or structural incompatibility occurs. Label AI: Safe To Rollback has been applied. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes how the Edit Content key/value field renders imported data when a key’s value is null, ensuring the key is still displayed (with an empty string value) rather than effectively disappearing in the UI.
Changes:
- Update key/value parsing to coalesce
null/undefinedvalues to''when building the UI model.
…test Align the generic type with the actual runtime shape from imports (Record<string, string | null>) and add a regression test for null value coalescing.
adrianjm-dotCMS
approved these changes
Apr 8, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
parseToDotKeyValue()to usedata[key] ?? ''instead ofdata[key]so null values from imported content are displayed as empty strings instead of being silently droppedCloses #32823
Acceptance Criteria
Test Plan
yarn nx test edit-content --testPathPattern=dot-edit-content-key-value— all tests passChanged Files
libs/edit-content/src/lib/fields/dot-edit-content-key-value/components/key-value-field/key-value-field.component.ts:66data[key]→data[key] ?? ''This PR fixes: #32823