Fix Status Color of Tasks
All checks were successful
Java CI with Maven / test (push) Successful in 35s
Java CI with Maven / build-and-push-frontend (push) Successful in 2m10s
Java CI with Maven / build-and-push-backend (push) Successful in 1m34s

This commit is contained in:
Sebastian 2023-12-18 14:07:05 +01:00
parent bb55951fb1
commit 1ae6cd2a02
6 changed files with 36 additions and 1 deletions

View File

@ -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;
}
} }

View File

@ -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;
}
} }

View File

@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.1.0"
}
}

View File

@ -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;
} }

View File

@ -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 "🟢";

View File

@ -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