From 6fba2ac50f6219b6e56c404c067b9fadd95985ac Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 24 Jul 2024 17:17:46 -0400 Subject: [PATCH 1/3] Fix task initialization for webentries --- src/components/task.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/task.vue b/src/components/task.vue index 19de0e5a0..81ed914d7 100644 --- a/src/components/task.vue +++ b/src/components/task.vue @@ -102,6 +102,7 @@ export default { loading: { type: Number, default: null }, alwaysAllowEditing: { type: Boolean, default: false }, disableInterstitial: { type: Boolean, default: false }, + waitLoadingListeners: { type: Boolean, default: false }, }, data() { return { @@ -122,7 +123,7 @@ export default { redirecting: null, loadingButton: false, loadingTask: false, - loadingListeners: true, + loadingListeners: this.waitLoadingListeners, }; }, watch: { @@ -258,6 +259,10 @@ export default { } }, loadTask() { + if (!this.taskId) { + return; + } + const url = `/${this.taskId}?include=data,user,draft,requestor,processRequest,component,screen,requestData,loopContext,bpmnTagName,interstitial,definition,nested,userRequestPermission,elementDestination`; // For Vocabularies if (window.ProcessMaker && window.ProcessMaker.packages && window.ProcessMaker.packages.includes('package-vocabularies')) { From dd252ebf694722502d28778a9923f0715db02dac Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Wed, 24 Jul 2024 18:24:15 -0400 Subject: [PATCH 2/3] Check if task is not null --- src/components/task.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/task.vue b/src/components/task.vue index 81ed914d7..d32b8bc65 100644 --- a/src/components/task.vue +++ b/src/components/task.vue @@ -417,7 +417,7 @@ export default { * Emits a closed event. */ async emitClosedEvent() { - this.$emit("closed", this.task.id, await this.getDestinationUrl()); + this.$emit("closed", this.task?.id, await this.getDestinationUrl()); }, /** * Retrieves the destination URL for the closed event. @@ -473,6 +473,7 @@ export default { const url = `?user_id=${this.userId}&status=ACTIVE&process_request_id=${requestId}&include_sub_tasks=1${timestamp}`; return this.$dataProvider .getTasks(url).then((response) => { + console.log(url, response.data); if (response.data.data.length > 0) { let task = response.data.data[0]; if (task.process_request_id !== this.requestId) { From 6cf6ebdfdfb83cfcdf671fe0fe59803c77786d3d Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Thu, 25 Jul 2024 10:20:33 -0400 Subject: [PATCH 3/3] Remove debug code --- src/components/task.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/task.vue b/src/components/task.vue index d32b8bc65..507ae99ab 100644 --- a/src/components/task.vue +++ b/src/components/task.vue @@ -473,7 +473,6 @@ export default { const url = `?user_id=${this.userId}&status=ACTIVE&process_request_id=${requestId}&include_sub_tasks=1${timestamp}`; return this.$dataProvider .getTasks(url).then((response) => { - console.log(url, response.data); if (response.data.data.length > 0) { let task = response.data.data[0]; if (task.process_request_id !== this.requestId) {