mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-10 13:44:30 +00:00
Add reclaim assigned tasks button
This commit is contained in:
@@ -122,4 +122,8 @@ export class ApiService {
|
||||
return this.http.post(this.url + `/project/hard_reset/${pid}`, null, this.options);
|
||||
}
|
||||
|
||||
reclaimAssignedTasks(pid: number) {
|
||||
return this.http.post(this.url + `/project/reclaim_assigned_tasks/${pid}`, null, this.options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,6 +85,10 @@
|
||||
<mat-icon>warning</mat-icon>
|
||||
{{"dashboard.hard_reset"|translate}}
|
||||
</button>
|
||||
<button mat-raised-button color="accent" (click)="reclaimAssignedTasks()">
|
||||
<mat-icon>replay</mat-icon>
|
||||
{{"dashboard.reclaim"|translate}}
|
||||
</button>
|
||||
</mat-expansion-panel>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
@@ -442,4 +442,20 @@ export class ProjectDashboardComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
reclaimAssignedTasks() {
|
||||
this.dialog.open(AreYouSureComponent, {
|
||||
width: '250px',
|
||||
}).afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this.apiService.reclaimAssignedTasks(this.project.id).subscribe(data => {
|
||||
this.translate.get('project.reclaim_response').subscribe(t =>
|
||||
this.messenger.show(t + data['content']['affected_tasks']));
|
||||
}, error => {
|
||||
this.translate.get('messenger.unauthorized').subscribe(t =>
|
||||
this.messenger.show(t));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
"secret": "Secret",
|
||||
"reset_response": "Reset failed tasks: ",
|
||||
"hard_reset_response": "Deleted tasks: ",
|
||||
"reclaim_response": "Reclaimed tasks: ",
|
||||
"assign_rate": "Task assign rate limit",
|
||||
"submit_rate": "Task submit rate limit",
|
||||
"rate": "per second",
|
||||
@@ -87,7 +88,8 @@
|
||||
"reset_failed": "Reset failed tasks",
|
||||
"pause": "Pause",
|
||||
"resume": "Resume",
|
||||
"hard_reset": "Hard_reset"
|
||||
"hard_reset": "Hard reset",
|
||||
"reclaim": "Reclaim assigned tasks"
|
||||
},
|
||||
"login": {
|
||||
"title": "Login",
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
"version": "Version git (hash du commit)",
|
||||
"reset_response": "Réinitialisé les tâches en échec: ",
|
||||
"hard_reset_response": "Supprimé toutes les tâches: ",
|
||||
"reclaim_response": "Désaffecté les tâches: ",
|
||||
"assign_rate": "Taux d'assignation de tâches",
|
||||
"submit_rate": "Taux de soumission de tâches",
|
||||
"rate": "par seconde",
|
||||
@@ -83,7 +84,8 @@
|
||||
"metadata": "Métadonnés du projet",
|
||||
"empty": "Aucune tâche",
|
||||
"refresh": "Rafraîchir",
|
||||
"actions": "Actions"
|
||||
"actions": "Actions",
|
||||
"reclaim": "Déaffecter les tâches"
|
||||
},
|
||||
"login": {
|
||||
"title": "Ouvrir un session",
|
||||
|
||||
Reference in New Issue
Block a user