fix(web): make authoritative level selection non-null
This commit is contained in:
@@ -96,12 +96,10 @@ export function AuthoritativeInventoryConfigPage() {
|
||||
.finally(() => setLoading(false));
|
||||
}, []);
|
||||
|
||||
const level = LEVELS.find((item) => item.kind === selectedKind) ?? LEVELS[0];
|
||||
const level = LEVELS.find((item) => item.kind === selectedKind) ?? LEVELS[0]!;
|
||||
const selectedType = canonicalType(types, selectedKind);
|
||||
const commonAttributes = useMemo(() => {
|
||||
const attributes = selectedType?.attributes.filter((attribute) => attribute.isActive) ?? [];
|
||||
// "Tipo de instalación" is represented by inventoryFamilyId, not duplicated
|
||||
// as a free-text value in the authoritative structural presentation.
|
||||
return selectedKind === 'INSTALACION'
|
||||
? attributes.filter((attribute) => attribute.code !== 'tipo_instalacion')
|
||||
: attributes;
|
||||
|
||||
Reference in New Issue
Block a user