From 51b491097e335ece8262ae2372dcc52b1cbf76b2 Mon Sep 17 00:00:00 2001 From: r-dev Date: Fri, 3 Apr 2026 13:22:38 +0200 Subject: [PATCH] fix(custom-fields) : preserve machineContextOnly through sanitizeCustomFields The sanitize layer was reconstructing the field object without machineContextOnly, causing it to always be false in the save payload regardless of checkbox state. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/app/shared/model/componentStructureSanitize.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/app/shared/model/componentStructureSanitize.ts b/frontend/app/shared/model/componentStructureSanitize.ts index 440bdb7..0902a0e 100644 --- a/frontend/app/shared/model/componentStructureSanitize.ts +++ b/frontend/app/shared/model/componentStructureSanitize.ts @@ -85,7 +85,10 @@ export const sanitizeCustomFields = (fields: any[]): ComponentModelCustomField[] } } - const result: ComponentModelCustomField = { name, type, required } + const machineContextOnly = + typeof valueObject?.machineContextOnly === 'boolean' ? valueObject.machineContextOnly : !!field?.machineContextOnly + + const result: ComponentModelCustomField = { name, type, required, machineContextOnly } if (options) { result.options = options }