From 1e38295164b5c46c00197b587417eaefcb7cb86e Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sun, 1 Aug 2021 23:28:04 +0200 Subject: [PATCH] All properties added to the sheet now use the type/library/create UX --- app/imports/constants/PROPERTIES.js | 2 +- .../creature/character/CharacterSheetFab.vue | 118 ++---- .../AddCreaturePropertyDialog.vue | 352 ++++++++++-------- .../CreaturePropertyDialog.vue | 35 +- app/imports/ui/dialogStack/DialogBase.vue | 12 +- .../properties/shared/PropertySelectCard.vue | 57 +++ .../ui/properties/shared/PropertySelector.vue | 136 ++++--- .../shared/SelectablePropertyDialog.vue | 6 + 8 files changed, 397 insertions(+), 321 deletions(-) create mode 100644 app/imports/ui/properties/shared/PropertySelectCard.vue diff --git a/app/imports/constants/PROPERTIES.js b/app/imports/constants/PROPERTIES.js index fa38c80e..d1ee0bb7 100644 --- a/app/imports/constants/PROPERTIES.js +++ b/app/imports/constants/PROPERTIES.js @@ -47,7 +47,7 @@ const PROPERTIES = Object.freeze({ name: 'Container', helpText: 'A container holds items in the inventory', examples: 'Coin pouch, backpack', - suggestedParents: [], + suggestedParents: ['folder'], }, damage: { icon: '$vuetify.icons.damage', diff --git a/app/imports/ui/creature/character/CharacterSheetFab.vue b/app/imports/ui/creature/character/CharacterSheetFab.vue index ae1ec668..8339122b 100644 --- a/app/imports/ui/creature/character/CharacterSheetFab.vue +++ b/app/imports/ui/creature/character/CharacterSheetFab.vue @@ -31,10 +31,10 @@ :key="type" color="primary" :data-id="`insert-creature-property-type-${type}`" - :label="'New ' + properties[type].name" - :icon="properties[type].icon" + :label="type ? 'New ' + properties[type].name : 'New Property'" + :icon="type ? properties[type].icon : 'mdi-plus'" :disabled="!editPermission" - @click="insertPropertyOfType(type)" + @click="addProperty(type)" />