show IS attrs in untyped unless the type has attrs

feat/vaults
Tomáš Mládek 2021-06-20 17:21:56 +02:00
parent 942ccf1c40
commit 8d02371d17
1 changed files with 24 additions and 18 deletions

View File

@ -238,28 +238,34 @@ export default defineComponent({
); );
untypedAttributes.length = 0; untypedAttributes.length = 0;
attributes.value attributes.value.forEach(([entryAddr, entry]) => {
.filter(([_, entry]) => entry.attribute !== "IS") const entryTypes = Object.entries(allTypes.value).filter(([_, t]) =>
.forEach(([entryAddr, entry]) => { t.attributes.includes(entry.attribute)
const entryTypes = Object.entries(allTypes.value).filter(([_, t]) => );
t.attributes.includes(entry.attribute) if (entryTypes.length > 0) {
); entryTypes.forEach(([addr, _]) => {
if (entryTypes.length > 0) { if (typedAttributes[addr] == undefined) {
entryTypes.forEach(([addr, _]) => { typedAttributes[addr] = [];
if (typedAttributes[addr] == undefined) { }
typedAttributes[addr] = []; typedAttributes[addr].push([entryAddr, entry]);
} });
typedAttributes[addr].push([entryAddr, entry]); } else {
}); untypedAttributes.push([entryAddr, entry]);
} else { }
untypedAttributes.push([entryAddr, entry]); });
} });
});
const filteredUntypedAttributes = computed(() => {
return untypedAttributes.filter(
([_, entry]) =>
entry.attribute !== "IS" ||
!Object.keys(typedAttributes).includes(entry.value.c)
);
}); });
return { return {
typedAttributes, typedAttributes,
untypedAttributes, untypedAttributes: filteredUntypedAttributes,
backlinks, backlinks,
error, error,
mutate, mutate,