fix-issue-81 #88

Merged
sebastian merged 3 commits from fix-issue-81 into master 2023-12-20 10:54:27 +01:00
Showing only changes of commit 64e1a5c12f - Show all commits

View File

@ -41,6 +41,7 @@ export class TaskDetailOverviewComponent implements OnInit {
task: TaskEntityInfo | undefined task: TaskEntityInfo | undefined
schedules: ScheduleInfo[] = [] schedules: ScheduleInfo[] = []
schedulesLoaded: boolean = false;
taskStatus: string = "🟢" taskStatus: string = "🟢"
@ -88,6 +89,7 @@ export class TaskDetailOverviewComponent implements OnInit {
this.scheduleService.schedulesTaskIDGet(Number(params.get('taskID'))).subscribe({ this.scheduleService.schedulesTaskIDGet(Number(params.get('taskID'))).subscribe({
next: resp => { next: resp => {
this.schedules = resp; this.schedules = resp;
this.schedulesLoaded = true;
} }
}) })
} }
@ -97,7 +99,7 @@ export class TaskDetailOverviewComponent implements OnInit {
getStatusOfTask(task: TaskEntityInfo ) { getStatusOfTask(task: TaskEntityInfo ) {
if(moment(task.deadline, 'YYYY-MM-DDTHH:mm:ss.SSSZ').isBefore(moment())) { if(moment(task.deadline, 'YYYY-MM-DDTHH:mm:ss.SSSZ').isBefore(moment())) {
return "🔴"; return "🔴";
} else if(this.schedules.length == 0){ } else if(this.schedules.length == 0 && this.schedulesLoaded){
return "🟠"; return "🟠";
} else { } else {
return "🟢"; return "🟢";