From dfe12e61022fa046b9ef59f4fabbf4d5cef20f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 16 Mar 2024 14:18:23 +0100 Subject: [PATCH] Take subtasks in Dashboard into account (TaskOverview) --- .../api/models/timemanager/tasks/TaskOverviewInfo.java | 10 ++++++++++ frontend/src/api/model/taskOverviewInfo.ts | 4 ++++ .../task-overview/task-overview.component.css | 10 ++++++++++ .../task-overview/task-overview.component.html | 5 ++++- .../dashboard/task-overview/task-overview.component.ts | 1 + openapi.yaml | 4 ++++ 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java index 18ec648..227e93e 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskOverviewInfo.java @@ -18,6 +18,7 @@ public class TaskOverviewInfo { private boolean overdue; private boolean finishable; + private boolean hasSubtasks; public TaskOverviewInfo(Task task) { this.taskID = task.getTaskID(); @@ -33,6 +34,7 @@ public class TaskOverviewInfo { this.overdue = LocalDate.now().isAfter(task.getDeadline()); } this.finishable = task.isFinishable(); + this.hasSubtasks = !task.getSubtasks().isEmpty(); } public long getTaskID() { @@ -90,4 +92,12 @@ public class TaskOverviewInfo { public void setFinishable(boolean finishable) { this.finishable = finishable; } + + public boolean isHasSubtasks() { + return hasSubtasks; + } + + public void setHasSubtasks(boolean hasSubtasks) { + this.hasSubtasks = hasSubtasks; + } } diff --git a/frontend/src/api/model/taskOverviewInfo.ts b/frontend/src/api/model/taskOverviewInfo.ts index 6fe5cbe..9929798 100644 --- a/frontend/src/api/model/taskOverviewInfo.ts +++ b/frontend/src/api/model/taskOverviewInfo.ts @@ -42,5 +42,9 @@ export interface TaskOverviewInfo { * determines whether the task can be finished */ finishable: boolean; + /** + * determines whether the task has subtasks + */ + hasSubtasks: boolean; } diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.css b/frontend/src/app/dashboard/task-overview/task-overview.component.css index 8c786e8..498becd 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.css +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.css @@ -31,3 +31,13 @@ text-decoration: none; color: black; } + +.task-title { + display: flex; + justify-content: space-between; +} + +.subtask-link { + color: #00bc8c; + text-decoration: none; +} diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.html b/frontend/src/app/dashboard/task-overview/task-overview.component.html index 07c8e49..5ced071 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.html +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.html @@ -2,7 +2,10 @@ -

{{task.taskName}}

+

+ {{task.taskName}} + +

ETA: {{task.activeTime}} / {{task.eta}}

Limit: {{task.limit}}

diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.ts b/frontend/src/app/dashboard/task-overview/task-overview.component.ts index 6c19c3f..fe4c8ae 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.ts +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.ts @@ -89,6 +89,7 @@ export class TaskOverviewComponent { activeTime: 0, overdue: res.overdue, taskgroupPath: [], + hasSubtasks: false, finishable: res.finishable } this.creationEmitter.emit({ diff --git a/openapi.yaml b/openapi.yaml index 5af759a..1abccaa 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2807,6 +2807,7 @@ components: - overdue - taskgroupPath - finishable + - hasSubtasks additionalProperties: false properties: taskID: @@ -2841,6 +2842,9 @@ components: finishable: type: boolean description: determines whether the task can be finished + hasSubtasks: + type: boolean + description: determines whether the task has subtasks ScheduleStatus: required: - activeMinutes