From 2a9ccdcffd6acb406f7b0852169ad0753dcc4b7f Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Thu, 20 Feb 2020 07:23:38 -0800 Subject: [PATCH] added controls for remove and duplicate criteria --- .../condition/components/Condition.vue | 1 + .../condition/components/Criterion.vue | 26 +++++++++++++++++++ .../condition/components/condition.scss | 9 +++++++ 3 files changed, 36 insertions(+) diff --git a/src/plugins/condition/components/Condition.vue b/src/plugins/condition/components/Condition.vue index c930fee550..f3983ac912 100644 --- a/src/plugins/condition/components/Condition.vue +++ b/src/plugins/condition/components/Condition.vue @@ -117,6 +117,7 @@ :criterion="criterion" :index="index" :trigger="trigger" + :is-default="domainObject.configuration.criteria.length === 1" @persist="persist" /> diff --git a/src/plugins/condition/components/Criterion.vue b/src/plugins/condition/components/Criterion.vue index 0bd865f828..046ca4a19e 100644 --- a/src/plugins/condition/components/Criterion.vue +++ b/src/plugins/condition/components/Criterion.vue @@ -46,6 +46,15 @@ > +
+ + +
@@ -72,6 +81,10 @@ export default { trigger: { type: String, required: true + }, + isDefault: { + type: Boolean, + default: false } }, data() { @@ -91,6 +104,7 @@ export default { mounted() { this.updateMetadataOptions(); this.updateOperationInputVisibility(); + console.log('this.isDefault', this.isDefault); }, methods: { updateMetadataOptions() { @@ -113,6 +127,18 @@ export default { updateMetadataSelection() { this.updateOperationInputVisibility(); }, + removeCriterion(ev) { + console.log('removeCriterion', this.index); + // this.$emit('removeCondition', this.conditionIdentifier); + }, + cloneCriterion(ev) { + console.log('cloneCriterion') + // this.$emit('cloneCondition', { + // identifier: this.conditionIdentifier, + // index: Number(ev.target.closest('.widget-condition').getAttribute('data-condition-index')) + // }); + }, + persist() { this.$emit('persist', this.criterion); } diff --git a/src/plugins/condition/components/condition.scss b/src/plugins/condition/components/condition.scss index b6e4e47bd2..d5503456db 100644 --- a/src/plugins/condition/components/condition.scss +++ b/src/plugins/condition/components/condition.scss @@ -197,3 +197,12 @@ border-radius: 2px; } } + +.temp { + width: 24px; + + .c-c__duplicate, + .c-c__trash { + display: inline-block; + } +}