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:
@@ -124,6 +124,11 @@
|
|||||||
Obligatoire
|
Obligatoire
|
||||||
</div>
|
</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
|
<textarea
|
||||||
v-if="field.type === 'select'"
|
v-if="field.type === 'select'"
|
||||||
v-model="field.optionsText"
|
v-model="field.optionsText"
|
||||||
|
|||||||
@@ -121,6 +121,10 @@
|
|||||||
<input v-model="field.required" type="checkbox" class="checkbox checkbox-xs" />
|
<input v-model="field.required" type="checkbox" class="checkbox checkbox-xs" />
|
||||||
Obligatoire
|
Obligatoire
|
||||||
</div>
|
</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
|
<textarea
|
||||||
v-if="field.type === 'select'"
|
v-if="field.type === 'select'"
|
||||||
v-model="field.optionsText"
|
v-model="field.optionsText"
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ const toEditorField = (
|
|||||||
...(typeof input?.id === 'string' && input.id ? { id: input.id } : {}),
|
...(typeof input?.id === 'string' && input.id ? { id: input.id } : {}),
|
||||||
...(typeof input?.customFieldId === 'string' && input.customFieldId ? { customFieldId: input.customFieldId } : {}),
|
...(typeof input?.customFieldId === 'string' && input.customFieldId ? { customFieldId: input.customFieldId } : {}),
|
||||||
orderIndex: typeof input?.orderIndex === 'number' ? input.orderIndex : index,
|
orderIndex: typeof input?.orderIndex === 'number' ? input.orderIndex : index,
|
||||||
|
machineContextOnly: Boolean(input?.machineContextOnly),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +163,7 @@ const buildPayload = (
|
|||||||
type,
|
type,
|
||||||
required,
|
required,
|
||||||
orderIndex: index,
|
orderIndex: index,
|
||||||
|
machineContextOnly: Boolean(field.machineContextOnly),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field.id) {
|
if (field.id) {
|
||||||
@@ -286,6 +288,7 @@ export function usePieceStructureEditorLogic(deps: Deps) {
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
required: false,
|
required: false,
|
||||||
optionsText: '',
|
optionsText: '',
|
||||||
|
machineContextOnly: false,
|
||||||
orderIndex,
|
orderIndex,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export function useStructureNodeCrud(props: StructureNodeCrudDeps) {
|
|||||||
required: false,
|
required: false,
|
||||||
optionsText: '',
|
optionsText: '',
|
||||||
options: [],
|
options: [],
|
||||||
|
machineContextOnly: false,
|
||||||
orderIndex: nextIndex,
|
orderIndex: nextIndex,
|
||||||
})
|
})
|
||||||
reindexCustomFields()
|
reindexCustomFields()
|
||||||
|
|||||||
Reference in New Issue
Block a user