feat(search) : display reference alongside name in all entity select components
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -85,7 +85,8 @@ export const componentOptionLabel = (component?: ComponentOption | null): string
|
||||
if (!component) {
|
||||
return 'Composant sans nom'
|
||||
}
|
||||
return component.name || 'Composant sans nom'
|
||||
const name = component.name || 'Composant sans nom'
|
||||
return component.reference ? `${name} — ${component.reference}` : name
|
||||
}
|
||||
|
||||
export const componentOptionDescription = (component?: ComponentOption | null): string => {
|
||||
@@ -110,9 +111,10 @@ export const componentOptionDescription = (component?: ComponentOption | null):
|
||||
|
||||
export const pieceOptionLabel = (piece?: PieceOption | null): string => {
|
||||
if (!piece) {
|
||||
return 'Pi\u00e8ce'
|
||||
return 'Pièce'
|
||||
}
|
||||
return piece.name || 'Pi\u00e8ce'
|
||||
const name = piece.name || 'Pièce'
|
||||
return piece.reference ? `${name} — ${piece.reference}` : name
|
||||
}
|
||||
|
||||
export const pieceOptionDescription = (piece?: PieceOption | null): string => {
|
||||
@@ -139,7 +141,8 @@ export const productOptionLabel = (product?: ProductOption | null): string => {
|
||||
if (!product) {
|
||||
return 'Produit'
|
||||
}
|
||||
return product.name || product.reference || 'Produit'
|
||||
const name = product.name || 'Produit'
|
||||
return product.reference ? `${name} — ${product.reference}` : name
|
||||
}
|
||||
|
||||
export const productOptionDescription = (product?: ProductOption | null): string => {
|
||||
|
||||
Reference in New Issue
Block a user