feat(teams): new disapproval workflow, managers can uncheck tasks

This commit is contained in:
Sabe Jones
2021-04-23 15:47:58 -05:00
committed by SabreCat
parent bb9ba61d12
commit a5680836bd
4 changed files with 44 additions and 9 deletions
@@ -222,6 +222,7 @@ export default {
this.$root.$on('habitica:team-sync', () => {
this.loadTasks();
this.loadGroupCompletedTodos();
});
},
methods: {
+6 -2
View File
@@ -1046,9 +1046,13 @@ export default {
showTaskLockIcon () {
if (this.isUser) return false;
if (this.isGroupTask) {
if (this.isOpenTask) return false;
if (this.teamManagerAccess) return false;
if (this.isOpenTask) {
if (!this.task.completed) return false;
if (this.task.group.completedBy === this.user._id) return false;
return true;
}
if (this.task.group.assignedUsers.indexOf(this.user._id) !== -1) return false;
if (this.teamManagerAccess && this.task.completed) return false;
}
return true;
},
+9 -5
View File
@@ -56,11 +56,15 @@ export default {
const canScoreTask = await this.beforeTaskScore(task);
if (!canScoreTask) return;
try {
scoreTask({ task, user, direction });
} catch (err) {
this.text(err.message);
return;
if (direction === 'down' && task.group.completedBy && task.group.completedBy !== user._id) {
task.completed = false;
} else {
try {
scoreTask({ task, user, direction });
} catch (err) {
this.text(err.message);
return;
}
}
this.playTaskScoreSound(task, direction);