From 8d02371d1739443b5083778aa3ee617d57d40ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sun, 20 Jun 2021 17:21:56 +0200 Subject: [PATCH] show IS attrs in untyped unless the type has attrs --- ui/src/views/Inspect.vue | 42 +++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/ui/src/views/Inspect.vue b/ui/src/views/Inspect.vue index c848a8e..3c4d967 100644 --- a/ui/src/views/Inspect.vue +++ b/ui/src/views/Inspect.vue @@ -238,28 +238,34 @@ export default defineComponent({ ); untypedAttributes.length = 0; - attributes.value - .filter(([_, entry]) => entry.attribute !== "IS") - .forEach(([entryAddr, entry]) => { - const entryTypes = Object.entries(allTypes.value).filter(([_, t]) => - t.attributes.includes(entry.attribute) - ); - if (entryTypes.length > 0) { - entryTypes.forEach(([addr, _]) => { - if (typedAttributes[addr] == undefined) { - typedAttributes[addr] = []; - } - typedAttributes[addr].push([entryAddr, entry]); - }); - } else { - untypedAttributes.push([entryAddr, entry]); - } - }); + attributes.value.forEach(([entryAddr, entry]) => { + const entryTypes = Object.entries(allTypes.value).filter(([_, t]) => + t.attributes.includes(entry.attribute) + ); + if (entryTypes.length > 0) { + entryTypes.forEach(([addr, _]) => { + if (typedAttributes[addr] == undefined) { + typedAttributes[addr] = []; + } + typedAttributes[addr].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 { typedAttributes, - untypedAttributes, + untypedAttributes: filteredUntypedAttributes, backlinks, error, mutate,