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) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 13:22:38 +02:00
parent 7da78b3b3e
commit 51b491097e

View File

@@ -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
}