mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Group plan fixes (#9437)
* Prevented title editing on personal page * Fixed claim/unlclaim from user task page * Removed task from local on delete * Immediately show unassigned bar * Add move to group tasks * Fixed group member count increase * Added upgrade when group plan is canceled
This commit is contained in:
@@ -76,24 +76,36 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
claim () {
|
||||
async claim () {
|
||||
if (!confirm('Are you sure you want to claim this task?')) return;
|
||||
|
||||
let taskId = this.task._id;
|
||||
// If we are on the user task
|
||||
if (this.task.userId) {
|
||||
taskId = this.task.group.taskId;
|
||||
}
|
||||
|
||||
this.$store.dispatch('tasks:assignTask', {
|
||||
taskId: this.task._id,
|
||||
taskId,
|
||||
userId: this.user._id,
|
||||
});
|
||||
this.task.group.assignedUsers.push(this.user._id);
|
||||
// @TODO: Reload user tasks?
|
||||
},
|
||||
unassign () {
|
||||
async unassign () {
|
||||
if (!confirm('Are you sure you want to unclaim this task?')) return;
|
||||
|
||||
let taskId = this.task._id;
|
||||
// If we are on the user task
|
||||
if (this.task.userId) {
|
||||
taskId = this.task.group.taskId;
|
||||
}
|
||||
|
||||
this.$store.dispatch('tasks:unassignTask', {
|
||||
taskId: this.task._id,
|
||||
taskId,
|
||||
userId: this.user._id,
|
||||
});
|
||||
let index = this.task.group.assignedUsers.indexOf(this.user._id);
|
||||
this.task.group.assignedUsers.splice(index, 1);
|
||||
// @TODO: Reload user tasks?
|
||||
},
|
||||
approve () {
|
||||
if (!confirm('Are you sure you want to approve this task?')) return;
|
||||
|
||||
Reference in New Issue
Block a user