Fix Status Color of Tasks
This commit is contained in:
parent
bb55951fb1
commit
1ae6cd2a02
@ -26,6 +26,8 @@ public class TaskEntityInfo {
|
||||
|
||||
private boolean hasActiveSchedules;
|
||||
|
||||
private boolean hasPlannedSchedules;
|
||||
|
||||
public TaskEntityInfo(Task task) {
|
||||
this.taskID = task.getTaskID();
|
||||
this.taskName = task.getTaskName();
|
||||
@ -39,6 +41,7 @@ public class TaskEntityInfo {
|
||||
this.workTime = task.getWorkTime();
|
||||
this.finishable = task.isFinishable();
|
||||
this.hasActiveSchedules = task.hasActiveSchedule();
|
||||
this.hasPlannedSchedules = task.hasPlannedSchedules();
|
||||
}
|
||||
|
||||
public long getTaskID() {
|
||||
@ -120,4 +123,12 @@ public class TaskEntityInfo {
|
||||
public void setHasActiveSchedules(boolean hasActiveSchedules) {
|
||||
this.hasActiveSchedules = hasActiveSchedules;
|
||||
}
|
||||
|
||||
public boolean isHasPlannedSchedules() {
|
||||
return hasPlannedSchedules;
|
||||
}
|
||||
|
||||
public void setHasPlannedSchedules(boolean hasPlannedSchedules) {
|
||||
this.hasPlannedSchedules = hasPlannedSchedules;
|
||||
}
|
||||
}
|
||||
|
@ -198,4 +198,13 @@ public class Task {
|
||||
}
|
||||
return activeMinutes;
|
||||
}
|
||||
|
||||
public boolean hasPlannedSchedules() {
|
||||
for(AbstractSchedule schedule : getBasicTaskSchedules()) {
|
||||
if(!schedule.isCompleted()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
7
frontend/openapitools.json
Normal file
7
frontend/openapitools.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||
"spaces": 2,
|
||||
"generator-cli": {
|
||||
"version": "7.1.0"
|
||||
}
|
||||
}
|
@ -52,5 +52,9 @@ export interface TaskEntityInfo {
|
||||
* determines whether the task has active schedules
|
||||
*/
|
||||
hasActiveSchedules: boolean;
|
||||
/**
|
||||
* determines whether the task has schedules that can be started
|
||||
*/
|
||||
hasPlannedSchedules: boolean;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ export class TaskDashboardComponent implements OnChanges{
|
||||
getStatusOfTask(task: TaskEntityInfo) {
|
||||
if(moment(task.deadline, 'YYYY-MM-DDTHH:mm:ss.SSSZ').isBefore(moment())) {
|
||||
return "🔴";
|
||||
} else if(task.finishable){
|
||||
} else if(task.finishable && !task.hasPlannedSchedules){
|
||||
return "🟠";
|
||||
} else {
|
||||
return "🟢";
|
||||
|
@ -2223,6 +2223,7 @@ components:
|
||||
- workTime
|
||||
- finishable
|
||||
- hasActiveSchedules
|
||||
- hasPlannedSchedules
|
||||
additionalProperties: false
|
||||
properties:
|
||||
taskID:
|
||||
@ -2264,6 +2265,9 @@ components:
|
||||
hasActiveSchedules:
|
||||
type: boolean
|
||||
description: determines whether the task has active schedules
|
||||
hasPlannedSchedules:
|
||||
type: boolean
|
||||
description: determines whether the task has schedules that can be started
|
||||
TaskTaskgroupInfo:
|
||||
required:
|
||||
- taskID
|
||||
|
Loading…
Reference in New Issue
Block a user