feat(custom-fields) : add machineContextOnly toggle in structure editors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 10:51:05 +02:00
parent 54203db328
commit 500b6b1620
4 changed files with 13 additions and 0 deletions

View File

@@ -124,6 +124,11 @@
Obligatoire
</div>
<div class="flex items-center gap-2 text-xs">
<input v-model="field.machineContextOnly" type="checkbox" class="checkbox checkbox-xs">
Contexte machine uniquement
</div>
<textarea
v-if="field.type === 'select'"
v-model="field.optionsText"

View File

@@ -121,6 +121,10 @@
<input v-model="field.required" type="checkbox" class="checkbox checkbox-xs" />
Obligatoire
</div>
<div class="flex items-center gap-2 text-xs">
<input v-model="field.machineContextOnly" type="checkbox" class="checkbox checkbox-xs">
Contexte machine uniquement
</div>
<textarea
v-if="field.type === 'select'"
v-model="field.optionsText"

View File

@@ -88,6 +88,7 @@ const toEditorField = (
...(typeof input?.id === 'string' && input.id ? { id: input.id } : {}),
...(typeof input?.customFieldId === 'string' && input.customFieldId ? { customFieldId: input.customFieldId } : {}),
orderIndex: typeof input?.orderIndex === 'number' ? input.orderIndex : index,
machineContextOnly: Boolean(input?.machineContextOnly),
}
}
@@ -162,6 +163,7 @@ const buildPayload = (
type,
required,
orderIndex: index,
machineContextOnly: Boolean(field.machineContextOnly),
}
if (field.id) {
@@ -286,6 +288,7 @@ export function usePieceStructureEditorLogic(deps: Deps) {
type: 'text',
required: false,
optionsText: '',
machineContextOnly: false,
orderIndex,
})

View File

@@ -56,6 +56,7 @@ export function useStructureNodeCrud(props: StructureNodeCrudDeps) {
required: false,
optionsText: '',
options: [],
machineContextOnly: false,
orderIndex: nextIndex,
})
reindexCustomFields()