diff --git a/app/imports/client/ui/tabletop/TabletopBuffCard.vue b/app/imports/client/ui/tabletop/TabletopBuffCard.vue index e0e94529..531f994e 100644 --- a/app/imports/client/ui/tabletop/TabletopBuffCard.vue +++ b/app/imports/client/ui/tabletop/TabletopBuffCard.vue @@ -4,51 +4,42 @@ rounded :class="cardClasses" > -
+
-
- + +
{{ model.name || propertyName }}
-
-
- {{ targetingError }} -
- -
+
+
+ + + mdi-delete + +
- -
+ @@ -59,17 +50,20 @@ import doAction from '/imports/client/ui/creature/actions/doAction'; import PropertyIcon from '/imports/client/ui/properties/shared/PropertyIcon.vue'; import MarkdownText from '/imports/client/ui/components/MarkdownText.vue'; import { snackbar } from '/imports/client/ui/components/snackbars/SnackbarQueue.js'; -import TreeNodeList from '/imports/client/ui/components/tree/TreeNodeList.vue'; import { docsToForest } from '/imports/api/parenting/parentingFunctions'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; import { some } from 'lodash'; import { getFilter } from '/imports/api/parenting/parentingFunctions'; +import softRemoveProperty from '/imports/api/creature/creatureProperties/methods/softRemoveProperty'; +import getPropertyTitle from '/imports/client/ui/properties/shared/getPropertyTitle'; +import restoreProperty from '/imports/api/creature/creatureProperties/methods/restoreProperty'; +import CardHighlight from '/imports/client/ui/components/CardHighlight.vue'; export default { components: { MarkdownText, PropertyIcon, - TreeNodeList, + CardHighlight, }, inject: { context: { @@ -181,6 +175,22 @@ export default { this.doActionLoading = false; }); }, + remove(){ + const _id = this.model._id; + softRemoveProperty.call({_id}); + if (this.embedded){ + this.$emit('removed'); + } else { + this.$store.dispatch('popDialogStack'); + } + snackbar({ + text: `Deleted ${getPropertyTitle(this.model)}`, + callbackName: 'undo', + callback(){ + restoreProperty.call({_id}); + }, + }); + }, shwing() { this.activated = true; setTimeout(() => {