Skip to content

Commit

Permalink
Merge pull request #6061 from ProcessMaker/bugfix/FOUR-13267
Browse files Browse the repository at this point in the history
bugfix/FOUR-13267
  • Loading branch information
ryancooley committed Jan 19, 2024
2 parents 8cf1775 + 76c0ade commit ed297c9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions resources/views/tasks/preview.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class="card border-0"
automaticLayout: true,
},
showJSONEditor: false,
windowParent: window.parent.ProcessMaker,
// Reassignment
selected: null,
selectedIndex: -1,
Expand Down Expand Up @@ -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();
});
},
Expand All @@ -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 () {
Expand Down Expand Up @@ -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;
Expand All @@ -351,19 +351,22 @@ 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
// to view error details. This is done in loadTask in Task.vue
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);
})
}
Expand Down

0 comments on commit ed297c9

Please sign in to comment.