fix(web): make authoritative level selection non-null
This commit is contained in:
@@ -96,12 +96,10 @@ export function AuthoritativeInventoryConfigPage() {
|
|||||||
.finally(() => setLoading(false));
|
.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 selectedType = canonicalType(types, selectedKind);
|
||||||
const commonAttributes = useMemo(() => {
|
const commonAttributes = useMemo(() => {
|
||||||
const attributes = selectedType?.attributes.filter((attribute) => attribute.isActive) ?? [];
|
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'
|
return selectedKind === 'INSTALACION'
|
||||||
? attributes.filter((attribute) => attribute.code !== 'tipo_instalacion')
|
? attributes.filter((attribute) => attribute.code !== 'tipo_instalacion')
|
||||||
: attributes;
|
: attributes;
|
||||||
|
|||||||
Reference in New Issue
Block a user