From 7785671684880d425ba800630b0174c6a359d87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 3 Jul 2021 20:43:08 +0200 Subject: [PATCH] also make backlinks a Table --- ui/src/components/AttributeView.vue | 5 ++ ui/src/components/widgets/Table.vue | 132 +++++++++++++++++----------- ui/src/views/Inspect.vue | 17 +--- 3 files changed, 89 insertions(+), 65 deletions(-) diff --git a/ui/src/components/AttributeView.vue b/ui/src/components/AttributeView.vue index 6b05cca..8ae1a84 100644 --- a/ui/src/components/AttributeView.vue +++ b/ui/src/components/AttributeView.vue @@ -7,6 +7,7 @@ v-bind="component.props" :attributes="attributes" :insertable="insertable" + :reverse="reverse" @edit="processChange" /> @@ -42,6 +43,10 @@ export default defineComponent({ type: Boolean, default: false, }, + reverse: { + type: Boolean, + default: false, + }, }, computed: { components(): ComponentOptions[] { diff --git a/ui/src/components/widgets/Table.vue b/ui/src/components/widgets/Table.vue index 80d4039..c42a68d 100644 --- a/ui/src/components/widgets/Table.vue +++ b/ui/src/components/widgets/Table.vue @@ -2,60 +2,85 @@
- + - - - - - - - - -
AttributeValue
- - - {{ entry.attribute }} - -
-
@@ -94,6 +119,10 @@ export default defineComponent({ type: Boolean, default: false, }, + reverse: { + type: Boolean, + default: false, + }, }, data() { return { @@ -102,6 +131,10 @@ export default defineComponent({ }; }, setup(props) { + const editable = computed(() => { + return (props.deletable || props.insertable) && !props.reverse; + }); + // Enable IntersectionObserver for performance reasons const addressEls = ref[]>([]); const resolve = reactive<{ [key: string]: boolean }>({}); @@ -129,6 +162,7 @@ export default defineComponent({ }); return { + editable, addressEls, resolve, limitedAttributes, diff --git a/ui/src/views/Inspect.vue b/ui/src/views/Inspect.vue index 470c4d6..bea3b78 100644 --- a/ui/src/views/Inspect.vue +++ b/ui/src/views/Inspect.vue @@ -41,22 +41,7 @@