From e18e86e918a67015dc00d1c402e8eb788eaaa90d Mon Sep 17 00:00:00 2001 From: enlineawork Date: Fri, 11 Sep 2026 14:44:42 -0300 Subject: [PATCH] =?UTF-8?q?fix(web):=20reconocer=20Instalaci=C3=B3n=20de?= =?UTF-8?q?=20superficie=20en=20ficha=20compacta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-v2/src/pages/AssetEditorPage.tsx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/web-v2/src/pages/AssetEditorPage.tsx b/web-v2/src/pages/AssetEditorPage.tsx index 5dcb14b..489661a 100644 --- a/web-v2/src/pages/AssetEditorPage.tsx +++ b/web-v2/src/pages/AssetEditorPage.tsx @@ -78,6 +78,14 @@ function hasAttributeValue(definition: AssetAttributeDefinition, value: unknown) return value !== undefined && value !== null && String(value).trim() !== ''; } +function normalizeStructuralType(value: string | null | undefined): string { + return (value ?? '') + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .trim() + .toLowerCase(); +} + export function AssetEditorPage() { const { id } = useParams(); const editing = Boolean(id); @@ -343,9 +351,15 @@ export function AssetEditorPage() { ? 'companies' : 'territory'; - const structuralTypeCode = selectedType?.code.trim().toLowerCase() ?? ''; - const compactStructuralSummary = editing - && (structuralTypeCode === 'instalacion' || structuralTypeCode === 'subinstalacion'); + const structuralTypeCode = normalizeStructuralType(selectedType?.code); + const structuralTypeName = normalizeStructuralType(selectedType?.name); + const compactStructuralSummary = editing && ( + ['instalacion', 'instalacion-superficie', 'instalacion_de_superficie', 'instalacion-de-superficie', 'subinstalacion'] + .includes(structuralTypeCode) + || structuralTypeName === 'instalacion' + || structuralTypeName === 'instalacion de superficie' + || structuralTypeName === 'subinstalacion' + ); const technicalFilledCount = definitions.filter( (definition) => hasAttributeValue(definition, attributeValues[definition.id]),