diff --git a/resources/views/tasks/preview.blade.php b/resources/views/tasks/preview.blade.php index 04dce53701..9a0a1bdf37 100644 --- a/resources/views/tasks/preview.blade.php +++ b/resources/views/tasks/preview.blade.php @@ -166,7 +166,7 @@ class="card border-0" automaticLayout: true, }, showJSONEditor: false, - + windowParent: window.parent.ProcessMaker, // Reassignment selected: null, selectedIndex: -1, @@ -264,7 +264,7 @@ class="card border-0" is_self_service: 0, }) .then(response => { - window.ProcessMaker.alert(this.$t('The task was successfully claimed'), 'primary', 5, true); + this.windowParent.alert(this.$t('The task was successfully claimed'), 'primary', 5, true); parent.location.reload(); }); }, @@ -278,7 +278,7 @@ class="card border-0" }) .then(response => { this.fieldsToUpdate.splice(0); - ProcessMaker.alert(this.$t('The request data was saved.'), "success"); + this.windowParent.alert(this.$t('The request data was saved.'), "success"); }); }, saveJsonData () { @@ -339,7 +339,7 @@ class="card border-0" }, submit(task) { if (this.isSelfService) { - ProcessMaker.alert(this.$t('Claim the Task to continue.'), 'warning'); + this.windowParent.alert(this.$t('Claim the Task to continue.'), 'warning'); } else { if (this.submitting) { return; @@ -351,7 +351,7 @@ class="card border-0" ProcessMaker.apiClient .put("tasks/" + taskId, {status:"COMPLETED", data: this.formData}) .then(() => { - window.ProcessMaker.alert(message, 'success', 5, true); + this.windowParent.alert(message, 'success', 5, true); }) .catch(error => { // If there are errors, the user will be redirected to the request page @@ -359,11 +359,14 @@ class="card border-0" if (error.response?.status && error.response?.status === 422) { // Validation error Object.entries(error.response.data.errors).forEach(([key, value]) => { - window.ProcessMaker.alert(`${key}: ${value[0]}`, 'danger', 0); + this.windowParent.alert(`${key}: ${value[0]}`, 'danger', 0); }); } }).finally(() => { this.submitting = false; + setTimeout(() => { + parent.location.reload(); + }, 200); }) }