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 hasActiveSchedules;
|
||||||
|
|
||||||
|
private boolean hasPlannedSchedules;
|
||||||
|
|
||||||
public TaskEntityInfo(Task task) {
|
public TaskEntityInfo(Task task) {
|
||||||
this.taskID = task.getTaskID();
|
this.taskID = task.getTaskID();
|
||||||
this.taskName = task.getTaskName();
|
this.taskName = task.getTaskName();
|
||||||
@ -39,6 +41,7 @@ public class TaskEntityInfo {
|
|||||||
this.workTime = task.getWorkTime();
|
this.workTime = task.getWorkTime();
|
||||||
this.finishable = task.isFinishable();
|
this.finishable = task.isFinishable();
|
||||||
this.hasActiveSchedules = task.hasActiveSchedule();
|
this.hasActiveSchedules = task.hasActiveSchedule();
|
||||||
|
this.hasPlannedSchedules = task.hasPlannedSchedules();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTaskID() {
|
public long getTaskID() {
|
||||||
@ -120,4 +123,12 @@ public class TaskEntityInfo {
|
|||||||
public void setHasActiveSchedules(boolean hasActiveSchedules) {
|
public void setHasActiveSchedules(boolean hasActiveSchedules) {
|
||||||
this.hasActiveSchedules = 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;
|
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
|
* determines whether the task has active schedules
|
||||||
*/
|
*/
|
||||||
hasActiveSchedules: boolean;
|
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) {
|
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(task.finishable){
|
} else if(task.finishable && !task.hasPlannedSchedules){
|
||||||
return "🟠";
|
return "🟠";
|
||||||
} else {
|
} else {
|
||||||
return "🟢";
|
return "🟢";
|
||||||
|
@ -2223,6 +2223,7 @@ components:
|
|||||||
- workTime
|
- workTime
|
||||||
- finishable
|
- finishable
|
||||||
- hasActiveSchedules
|
- hasActiveSchedules
|
||||||
|
- hasPlannedSchedules
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
properties:
|
properties:
|
||||||
taskID:
|
taskID:
|
||||||
@ -2264,6 +2265,9 @@ components:
|
|||||||
hasActiveSchedules:
|
hasActiveSchedules:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: determines whether the task has active schedules
|
description: determines whether the task has active schedules
|
||||||
|
hasPlannedSchedules:
|
||||||
|
type: boolean
|
||||||
|
description: determines whether the task has schedules that can be started
|
||||||
TaskTaskgroupInfo:
|
TaskTaskgroupInfo:
|
||||||
required:
|
required:
|
||||||
- taskID
|
- taskID
|
||||||
|
Loading…
Reference in New Issue
Block a user