issue-96: Fix TaskStatus #104
@ -16,6 +16,7 @@ import {TaskEditorComponent} from "../task-editor/task-editor.component";
|
||||
import {TaskEditorData} from "../task-editor/TaskEditorData";
|
||||
import * as moment from "moment";
|
||||
import {ScheduleDashboardComponent} from "../../schedules/schedule-dashboard/schedule-dashboard.component";
|
||||
import {TaskStatusService} from "../task-status.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-detail-overview',
|
||||
@ -53,7 +54,8 @@ export class TaskDetailOverviewComponent implements OnInit {
|
||||
private taskService: TaskService,
|
||||
private dialog: MatDialog,
|
||||
private scheduleService: ScheduleService,
|
||||
private router: Router) {
|
||||
private router: Router,
|
||||
private taskStatusService: TaskStatusService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@ -102,13 +104,8 @@ export class TaskDetailOverviewComponent implements OnInit {
|
||||
}
|
||||
|
||||
getStatusOfTask(task: TaskEntityInfo ) {
|
||||
if(moment(task.deadline, 'YYYY-MM-DDTHH:mm:ss.SSSZ').isBefore(moment())) {
|
||||
return "🔴";
|
||||
} else if(this.schedules.length == 0 && this.schedulesLoaded){
|
||||
return "🟠";
|
||||
} else {
|
||||
return "🟢";
|
||||
}
|
||||
const taskStatus = this.taskStatusService.computeTaskStatus(task);
|
||||
return this.taskStatusService.convertTaskStatusToColor(taskStatus);
|
||||
}
|
||||
|
||||
calcProgress() {
|
||||
|
Loading…
Reference in New Issue
Block a user