feat: enrich piece assignment labels and document previews

This commit is contained in:
Matthieu
2025-10-23 09:01:38 +02:00
parent 553600c34b
commit 417b34b45e
11 changed files with 364 additions and 51 deletions

View File

@@ -584,6 +584,7 @@ const sanitizePieceDefinition = (definition: ComponentModelPiece) =>
typePieceId: definition.typePieceId ?? null,
typePieceLabel: definition.typePieceLabel ?? null,
reference: definition.reference ?? null,
familyCode: (definition as any).familyCode ?? null,
})
const serializeStructureAssignments = (
@@ -697,8 +698,10 @@ const resolvePieceLabel = (piece: Record<string, any>) => {
parts.push(piece.typePiece.name)
} else if (piece.typePieceLabel) {
parts.push(piece.typePieceLabel)
} else if (piece.typePiece?.code) {
parts.push(`Famille ${piece.typePiece.code}`)
} else if (piece.familyCode) {
parts.push(piece.familyCode)
parts.push(`Famille ${piece.familyCode}`)
} else if (piece.typePieceId) {
parts.push(`#${piece.typePieceId}`)
}