diff --git a/package-lock.json b/package-lock.json index 7f85f216d..b7e67cc76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@processmaker/screen-builder", - "version": "2.77.7", + "version": "2.77.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@processmaker/screen-builder", - "version": "2.77.7", + "version": "2.77.9", "dependencies": { "axios-extensions": "^2.0.3", "lodash": "^4.17.21", diff --git a/package.json b/package.json index df1baf41f..dc4498fb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@processmaker/screen-builder", - "version": "2.77.7", + "version": "2.77.9", "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", diff --git a/src/components/editor/loop.vue b/src/components/editor/loop.vue index 32a608794..3e9bbe75c 100644 --- a/src/components/editor/loop.vue +++ b/src/components/editor/loop.vue @@ -138,9 +138,18 @@ export default { data() { return { items: [], + cancelledJobs: [] }; }, mounted() { + if ( + !localStorage.getItem("cancelledJobs") || + localStorage.getItem("cancelledJobs") === "null" + ) { + this.cancelledJobs = []; + } else { + this.cancelledJobs = JSON.parse(localStorage.getItem("cancelledJobs")); + } this.$root.$on("ai-form-generated", (formItems, nonce) => { this.previewAiChanges(formItems, nonce); }); @@ -202,6 +211,9 @@ export default { item.component === "AiSection" && nonce === item.config.aiConfig.nonce ) { + if (this.cancelledJobs.some((element) => element === nonce)) { + return; + } this.$set(item.config.aiConfig, "progress", progress); } }); diff --git a/src/components/editor/multi-column.vue b/src/components/editor/multi-column.vue index bfefdf838..bf8399225 100644 --- a/src/components/editor/multi-column.vue +++ b/src/components/editor/multi-column.vue @@ -150,9 +150,19 @@ export default { data() { return { items: [], + cancelledJobs: [] }; }, mounted() { + if ( + !localStorage.getItem("cancelledJobs") || + localStorage.getItem("cancelledJobs") === "null" + ) { + this.cancelledJobs = []; + } else { + this.cancelledJobs = JSON.parse(localStorage.getItem("cancelledJobs")); + } + this.$root.$on("ai-form-generated", (formItems, nonce) => { this.previewAiChanges(formItems, nonce); }); @@ -241,6 +251,9 @@ export default { item.component === "AiSection" && nonce === item.config.aiConfig.nonce ) { + if (this.cancelledJobs.some((element) => element === nonce)) { + return; + } this.$set(item.config.aiConfig, "progress", progress); } }); diff --git a/src/components/renderer/file-upload.vue b/src/components/renderer/file-upload.vue index 4bcc89205..11d29e092 100644 --- a/src/components/renderer/file-upload.vue +++ b/src/components/renderer/file-upload.vue @@ -112,7 +112,7 @@ export default { this.setPrefix(); if (this.$refs['uploader']) { this.$refs['uploader'].$forceUpdate(); - // Re-upload stored files; + // Re-upload stored files; // Files disappear when navigating between pages with the Page Navigation component if (this.files.length > 0) { this.$refs.uploader.uploader.addFiles(this.files); @@ -476,7 +476,7 @@ export default { if (file.ignored) { this.invalidFile = true; this.uploading = false; - window.ProcessMaker.alert(this.$t('File not allowed.'), 'danger'); + window.ProcessMaker.alert(this.$t('This file type is not accepted.'), 'danger'); return false; } } diff --git a/src/components/task.vue b/src/components/task.vue index 80536e494..87402c9fd 100644 --- a/src/components/task.vue +++ b/src/components/task.vue @@ -164,9 +164,16 @@ export default { task: { handler() { + if (!this.screen) { + // if no current screen show the interstitial screen if exists + this.screen = this.task && this.task.interstitial_screen; + } this.taskId = this.task.id; this.nodeId = this.task.element_id; this.listenForParentChanges(); + if (this.task.process_request.status === 'COMPLETED') { + this.$emit('completed', this.task.process_request.id); + } }, }, @@ -525,6 +532,15 @@ export default { this.nodeId = this.initialNodeId; this.requestData = this.value; this.loopContext = this.initialLoopContext; + if ( + this.$parent.task && + !this.$parent.task.screen && + this.$parent.task.allow_interstitial && + this.$parent.task.interstitial_screen + ) { + // if interstitial screen exists, show it + this.screen = this.$parent.task.interstitial_screen; + } }, destroyed() { this.unsubscribeSocketListeners(); diff --git a/src/components/vue-form-builder.vue b/src/components/vue-form-builder.vue index 6ba5f0c38..f2644b6ca 100644 --- a/src/components/vue-form-builder.vue +++ b/src/components/vue-form-builder.vue @@ -549,7 +549,8 @@ export default { variablesTree: [], language: "en", collator: null, - editorContentKey: 0 + editorContentKey: 0, + cancelledJobs: [] }; }, computed: { @@ -658,7 +659,17 @@ export default { this.initiateLanguageSupport(); }, mounted() { + if ( + !localStorage.getItem("cancelledJobs") || + localStorage.getItem("cancelledJobs") === "null" + ) { + this.cancelledJobs = []; + } else { + this.cancelledJobs = JSON.parse(localStorage.getItem("cancelledJobs")); + } + this.checkForCaptchaInLoops(); + this.$root.$on("nested-screen-updated", () => { this.checkForCaptchaInLoops(); }); @@ -1142,6 +1153,9 @@ export default { item.component === "AiSection" && nonce === item.config.aiConfig.nonce ) { + if (this.cancelledJobs.some((element) => element === nonce)) { + return; + } this.$set(item.config.aiConfig, "progress", progress); } });