diff --git a/website/client/src/components/tasks/approvalFooter.vue b/website/client/src/components/tasks/approvalFooter.vue index 7a8080667b..c1db06e9f5 100644 --- a/website/client/src/components/tasks/approvalFooter.vue +++ b/website/client/src/components/tasks/approvalFooter.vue @@ -2,58 +2,12 @@
- - -
@@ -132,78 +86,6 @@ export default { ) return true; return false; }, - approvalRequested () { - if ( - (this.task.approvals && this.task.approvals.length === 1) - || (this.task.group && this.task.group.approval && this.task.group.approval.requested) - ) { - return true; - } - return false; - }, - multipleApprovalsRequested () { - if (this.task.approvals && this.task.approvals.length > 1) return true; - return false; - }, - }, - methods: { - async claim () { - let taskId = this.task._id; - // If we are on the user task - if (this.task.userId) { - taskId = this.task.group.taskId; - } - - await this.$store.dispatch('tasks:assignTask', { - taskId, - userId: this.user._id, - }); - this.task.group.assignedUsers.push(this.user._id); - this.sync(); - }, - async unassign () { - if (!window.confirm(this.$t('confirmUnClaim'))) return; // eslint-disable-line no-alert - - let taskId = this.task._id; - // If we are on the user task - if (this.task.userId) { - taskId = this.task.group.taskId; - } - - await this.$store.dispatch('tasks:unassignTask', { - taskId, - userId: this.user._id, - }); - const index = this.task.group.assignedUsers.indexOf(this.user._id); - this.task.group.assignedUsers.splice(index, 1); - - this.sync(); - }, - approve () { - const userIdToApprove = this.task.group.assignedUsers[0]; - this.$store.dispatch('tasks:approve', { - taskId: this.task._id, - userId: userIdToApprove, - }); - this.task.group.assignedUsers.splice(0, 1); - this.task.approvals.splice(0, 1); - - this.sync(); - }, - needsWork () { - if (!window.confirm(this.$t('confirmNeedsWork'))) return; // eslint-disable-line no-alert - const userIdNeedsMoreWork = this.task.group.assignedUsers[0]; - this.$store.dispatch('tasks:needsWork', { - taskId: this.task._id, - userId: userIdNeedsMoreWork, - }); - this.task.approvals.splice(0, 1); - - this.sync(); - }, - showRequests () { - this.$root.$emit('bv::show::modal', 'approval-modal'); - }, }, };