fix(custom-fields) : pass machineContextOnly through structure serialize/hydrate
- componentStructure: include machineContextOnly in save payload value object - componentStructureHydrate: read machineContextOnly in hydrate and mapComponentCustomFields - pieceProductStructure: include machineContextOnly in sanitize and hydrate Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,10 +78,18 @@ export const hydrateCustomFields = (fields: any[]): any[] => {
|
||||
const customFieldId = typeof field?.customFieldId === 'string' ? field.customFieldId : undefined
|
||||
const orderIndex = typeof field?.orderIndex === 'number' ? field.orderIndex : index
|
||||
|
||||
const machineContextOnly =
|
||||
typeof field?.machineContextOnly === 'boolean'
|
||||
? field.machineContextOnly
|
||||
: typeof valueObject?.machineContextOnly === 'boolean'
|
||||
? valueObject.machineContextOnly
|
||||
: false
|
||||
|
||||
return {
|
||||
name,
|
||||
type,
|
||||
required,
|
||||
machineContextOnly,
|
||||
options,
|
||||
optionsText,
|
||||
defaultValue,
|
||||
@@ -153,6 +161,7 @@ export const mapComponentCustomFields = (fields: any[]) => {
|
||||
name: typeof field?.name === 'string' ? field.name : '',
|
||||
type: field?.type ?? 'text',
|
||||
required: !!field?.required,
|
||||
machineContextOnly: !!field?.machineContextOnly,
|
||||
options: Array.isArray(field?.options) ? field.options : [],
|
||||
optionsText: typeof field?.optionsText === 'string' ? field.optionsText : '',
|
||||
defaultValue,
|
||||
|
||||
Reference in New Issue
Block a user