From 957aabcb822e8e34c8a34263445d0a4e2f48e9a8 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Tue, 13 Jun 2023 12:48:35 +0200 Subject: [PATCH] Improved property viewers Slot fill data included in library viewer Breadcrumbs and children in lib view breadcrumbs and children work on tree tab --- .../client/ui/components/TreeDetailLayout.vue | 2 +- .../character/characterSheetTabs/TreeTab.vue | 1 + .../creatureProperties/Breadcrumbs.vue | 28 ++-- .../CreaturePropertyDialog.vue | 66 ++------- .../client/ui/library/LibraryAndNode.vue | 2 +- .../client/ui/library/LibraryNodeDialog.vue | 52 ++++--- .../client/ui/properties/PropertyForm.vue | 4 +- .../ui/properties/shared/PropertyViewer.vue | 128 +++++++++++++++++- .../properties/viewers/SlotFillerViewer.vue | 26 ---- app/imports/constants/PROPERTIES.js | 2 +- 10 files changed, 197 insertions(+), 114 deletions(-) diff --git a/app/imports/client/ui/components/TreeDetailLayout.vue b/app/imports/client/ui/components/TreeDetailLayout.vue index 0bba4362..2077e6a5 100644 --- a/app/imports/client/ui/components/TreeDetailLayout.vue +++ b/app/imports/client/ui/components/TreeDetailLayout.vue @@ -13,7 +13,7 @@
diff --git a/app/imports/client/ui/creature/character/characterSheetTabs/TreeTab.vue b/app/imports/client/ui/creature/character/characterSheetTabs/TreeTab.vue index 4d92e0b1..a133f0b9 100644 --- a/app/imports/client/ui/creature/character/characterSheetTabs/TreeTab.vue +++ b/app/imports/client/ui/creature/character/characterSheetTabs/TreeTab.vue @@ -46,6 +46,7 @@ :_id="selectedNodeId" @removed="selectedNodeId = undefined" @duplicated="id => selectedNodeId = id" + @select-sub-property="clickNode" /> diff --git a/app/imports/client/ui/creature/creatureProperties/Breadcrumbs.vue b/app/imports/client/ui/creature/creatureProperties/Breadcrumbs.vue index 228e47f2..54703e43 100644 --- a/app/imports/client/ui/creature/creatureProperties/Breadcrumbs.vue +++ b/app/imports/client/ui/creature/creatureProperties/Breadcrumbs.vue @@ -4,11 +4,14 @@ :class="{'no-icons': noIcons}" > - + mdi-account + + mdi-book-open-blank-variant + fetchDocByRef(ref)) - .filter(prop => prop.type !== 'propertySlot'); + .filter(prop => (this.collection !== 'creatureProperties' || prop.type !== 'propertySlot')); }, }, methods: { - click(id){ + click(id) { + if (this.embedded) { + this.$emit('select-sub-property', id); + return; + } const store = this.$store; // Check if there is a dialog open for this doc already let dialogFound; @@ -92,9 +104,12 @@ // Pop dialogs until we get to it store.dispatch('popDialogStacks', dialogsToPop); } else { + const component = this.collection === 'creatureProperties' ? 'creature-property-dialog' + : this.collection === 'libraryNodes' ? 'library-node-dialog' + : undefined; // Otherwise open it as a new dialog store.commit('pushDialogStack', { - component: 'creature-property-dialog', + component, elementId: `breadcrumb-${id}`, data: { _id: id, @@ -139,9 +154,6 @@ .breadcrumbs { margin-bottom: 16px; opacity: 0.8; -} -.no-icons { - } diff --git a/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue b/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue index 606e270b..ce6e3c83 100644 --- a/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue +++ b/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue @@ -16,12 +16,12 @@
- + {{ typeName }} @@ -43,31 +43,12 @@ @select-sub-property="selectSubProperty" />
-
- - - - - - -
+
+ +
+ + + + {{ typeName }} + +
+
@@ -41,16 +59,13 @@ @add-child="addLibraryNode" @select-sub-property="selectSubProperty" /> - -

- This property can't be viewed yet. -

- + > + + + + +
+ + {{ tag }} + +
+
+ + + +
+
This property can't be viewed yet.
@@ -13,15 +106,40 @@ diff --git a/app/imports/client/ui/properties/viewers/SlotFillerViewer.vue b/app/imports/client/ui/properties/viewers/SlotFillerViewer.vue index fc53aec7..2e24617e 100644 --- a/app/imports/client/ui/properties/viewers/SlotFillerViewer.vue +++ b/app/imports/client/ui/properties/viewers/SlotFillerViewer.vue @@ -1,32 +1,6 @@