FIx: delete champs par default

This commit is contained in:
Matthieu
2025-09-25 11:25:43 +02:00
parent bdae2621c5
commit 7980aa186b
17 changed files with 32 additions and 218 deletions

View File

@@ -179,7 +179,7 @@ const normalizeCustomFields = (values = []) => {
return values.map((value) => ({
id: value.id,
label: value.customField?.name || 'Champ',
value: value.value || value.customField?.defaultValue || '—',
value: value.value || '—',
}))
}
@@ -217,7 +217,6 @@ export const buildMachinePrintContext = ({
machine,
machineName,
machineReference,
machineEmplacement,
machinePieces = [],
components = [],
selection,
@@ -300,7 +299,6 @@ export const buildMachinePrintContext = ({
description: machine?.description || '',
typeDescription: machine?.typeMachine?.description || '',
reference: machineReference,
emplacement: machineEmplacement,
site: machine?.site?.name || '',
category: machine?.typeMachine?.category || '',
badges: machineBadges,
@@ -348,7 +346,6 @@ export const buildMachinePrintHtml = (context, styles) => {
<div class="print-grid">
${renderPrintField('Nom', context.machine.name)}
${renderPrintField('Référence', context.machine.reference, 'Non définie')}
${renderPrintField('Emplacement', context.machine.emplacement, 'Non défini')}
${renderPrintField('Site', context.machine.site, 'Non défini')}
${renderPrintField('Constructeur', context.machine.constructeur?.name, 'Non défini')}
${renderPrintField('Contact Constructeur', context.machine.constructeur?.contact, 'Non défini')}
@@ -564,4 +561,4 @@ export const buildMachinePrintHtml = (context, styles) => {
</div>
</body>
</html>`
}
}