diff --git a/.eslintrc.js b/.eslintrc.js index 15e339a43..f074c53ac 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,6 +5,10 @@ module.exports = { node: true }, + globals: { + ProcessMaker: "readonly" + }, + extends: [ "plugin:vue/recommended", "airbnb-base", diff --git a/src/components/ScreenTemplateCard.vue b/src/components/ScreenTemplateCard.vue index 71291a444..56c12bff5 100644 --- a/src/components/ScreenTemplateCard.vue +++ b/src/components/ScreenTemplateCard.vue @@ -3,7 +3,7 @@
- + 0 ) { return this.template.template_media[0].url; - } else if (this.template?.template_media?.thumbnail?.url) { + } + if (this.template?.template_media?.thumbnail?.url) { return this.template?.template_media.thumbnail.url; } return null; } }, - mounted() {}, + watch: { + activeTemplateId(newVal) { + this.isApplyOptionsActive = newVal === this.template.id; + } + }, methods: { - showDetails() { - this.showApplyOptions = !this.showApplyOptions; + toggleDetails() { + this.$emit("toggle-active", this.template.id); }, applyTemplate() { ProcessMaker.apiClient @@ -130,7 +152,7 @@ export default { templateOptions: this.selected, currentScreenPage: this.currentScreenPage }) - .then((response) => { + .then(() => { ProcessMaker.alert( this.$t("The template options have been applied."), "success" @@ -146,7 +168,7 @@ export default { }); }, onCancel() { - this.showApplyOptions = false; + this.isApplyOptionsActive = false; this.selected = []; }, toggleOption(value) { diff --git a/src/components/ScreenTemplates.vue b/src/components/ScreenTemplates.vue index ab477e95a..4edf2b73e 100644 --- a/src/components/ScreenTemplates.vue +++ b/src/components/ScreenTemplates.vue @@ -1,32 +1,29 @@ - +