Skip to content

fix(edit-content): handle null values in key-value field after import#35246

Merged
oidacra merged 3 commits intomainfrom
issue-32823-key-value-null-values-after-import
Apr 9, 2026
Merged

fix(edit-content): handle null values in key-value field after import#35246
oidacra merged 3 commits intomainfrom
issue-32823-key-value-null-values-after-import

Conversation

@oidacra
Copy link
Copy Markdown
Member

@oidacra oidacra commented Apr 7, 2026

Summary

  • Fix parseToDotKeyValue() to use data[key] ?? '' instead of data[key] so null values from imported content are displayed as empty strings instead of being silently dropped

Closes #32823

Acceptance Criteria

  • Key/value fields with null values after import display as empty strings
  • No regression on normal key/value field behavior

Test Plan

  • yarn nx test edit-content --testPathPattern=dot-edit-content-key-value — all tests pass
  • Manual: Import content with null key/value entries, verify they appear in the UI

Changed Files

File Change
libs/edit-content/src/lib/fields/dot-edit-content-key-value/components/key-value-field/key-value-field.component.ts:66 data[key]data[key] ?? ''

This PR fixes: #32823

Add null coalescing to parseToDotKeyValue() so that null values from
the API are displayed as empty strings instead of being dropped.

Closes #32823
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 7, 2026

Claude finished @oidacra's task in 1m 40s —— View job


Claude finished @oidacra's task in 1m 6s —— View job


I'll analyze this and get back to you.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 7, 2026

Claude finished @oidacra's task in 44s —— View job


I'll analyze this and get back to you.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 7, 2026

Rollback Safety Analysis

  • Read rollback-unsafe categories reference
  • Get full PR diff
  • Analyze diff against all unsafe categories
  • Apply label

Result: ✅ Safe To Rollback

This PR contains a single one-line change in a frontend TypeScript file:

core-web/libs/edit-content/src/lib/fields/dot-edit-content-key-value/components/key-value-field/key-value-field.component.ts:66
- value: data[key]
+ value: data[key] ?? ''

The change does not match any rollback-unsafe category:

Category Match?
C-1 Structural Data Model Change No — pure UI logic, no DB interaction
C-2 Elasticsearch Mapping Change No — no ES mapping code touched
C-3 Content JSON Model Version Bump No — no contentlet_as_json model changes
C-4 DROP TABLE / DROP COLUMN No — no schema changes
H-1 One-Way Data Migration No — no data transformation
H-2 RENAME TABLE/COLUMN No
H-3 PK Restructuring No
H-4 New ContentType Field Type No
H-5 Storage Provider Change No
H-6 DROP PROCEDURE/FUNCTION No
H-7 NOT NULL column without default No
M-1 Non-Broadening Column Type Change No
M-2 Push Publishing Bundle Format No
M-3 REST/GraphQL API Contract Change No — UI rendering fix only, not an API change
M-4 OSGi Plugin API Breakage No

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.

View job run

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/undefined values to '' when building the UI model.

@oidacra oidacra marked this pull request as ready for review April 8, 2026 13:49
…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.
@oidacra oidacra self-assigned this Apr 8, 2026
@oidacra oidacra added this pull request to the merge queue Apr 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 8, 2026
@oidacra oidacra added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit 200fc8c Apr 9, 2026
28 checks passed
@oidacra oidacra deleted the issue-32823-key-value-null-values-after-import branch April 9, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Edit Content]: Key/Value Fields Do Not Display null Values After Import

3 participants