fix(edit-content): parse single-option label|value fields correctly#36319
Merged
oidacra merged 1 commit intoJun 25, 2026
Merged
Conversation
Open
14 tasks
Contributor
|
Claude finished @oidacra's task in 50s —— View job Rollback Safety Analysis — Complete
Result: ✅ Safe To Rollback The diff touches only two frontend TypeScript files:
Checklist against all unsafe categories:
This is a pure frontend bug fix — rolling back to the previous release leaves no persistent artifacts (no DB migrations, no ES reindexing, no data transformations). The label "AI: Safe To Rollback" has been applied. |
Contributor
🤖 Bedrock Review —
|
hmoreras
approved these changes
Jun 25, 2026
erickgonzalez
approved these changes
Jun 25, 2026
Single-option Checkbox/Radio/Select/Multiselect fields rendered the raw "label|value" string (e.g. "Yes|yes") instead of just the label. The parser used a global isPipeFormat flag that only treated input as pipe format when it contained a line break or started with "|", so a lone "Yes|yes" fell through to the comma branch and was used verbatim as both label and value. Switch getSingleSelectableFieldOptions to per-item pipe detection so each option is split independently. This fixes the single-option case, also corrects comma-separated pipe options, and preserves multi-line, the "|true" checkbox special case, plain comma, and data-type casting. Closes #36157
fe6f8b4 to
25dbd57
Compare
Contributor
🤖 Bedrock Review —
|
|
Tick the box to add this pull request to the merge queue (same as
|
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
Single-option Checkbox, Radio, Select, and Multiselect fields in the new Edit Contentlet displayed the raw
label|valuestring (e.g.Yes|yes) instead of just the label (Yes). The value after the|is what should be stored; only the label should be shown.Root cause:
getSingleSelectableFieldOptionsused a globalisPipeFormatflag that only treated input as pipe format when it contained a line break or started with|. A loneYes|yes(no line break, not starting with|) fell through to the comma branch, where label and value were both set to the rawYes|yes.Fix: Switched to per-item pipe detection (
item.includes('|')) so each option is parsed independently. This fixes the single-option case, also corrects comma-separated pipe options (label1|value1,label2|value2), and preserves multi-line pipe format, the|truecheckbox-without-label special case, plain comma format, and data-type casting. All four field types delegate to this shared util, so one change covers them all — no component changes needed.Closes #36157
Acceptance Criteria
Yes|yes->Yes)|(yes)|(Yes) uses the whole string as both label and valueTest Plan
Unit tests added/updated in
functions.util.spec.ts:Single-option pipe format (issue #36157)block:'Yes|yes'->{label:'Yes', value:'yes'}(AC8);'Yes'->{label:'Yes', value:'Yes'}(AC9); parameterizedit.eachacross Checkbox/Radio/Select/Multiselect (AC10)'label1|value1,label2|value2'now asserts correctly split optionsVerification:
pnpm nx lint edit-content(0 errors) andpnpm nx test edit-content --testPathPattern=functions.util(1962 passed, 1 pre-existing skip).Changed Files
core-web/libs/edit-content/src/lib/utils/functions.util.tscore-web/libs/edit-content/src/lib/utils/functions.util.spec.tsThis PR fixes: #36157