From 8487a573a1ad4b193f092a4ca4cc039ed3c4c814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 16 Mar 2024 14:04:57 +0100 Subject: [PATCH] Hide copy function for subtasks (daily) --- .../timemanager/tasks/TaskEntityInfo.java | 20 +++++++++++++++++++ frontend/src/api/model/taskEntityInfo.ts | 8 ++++++++ .../task-detail-overview.component.html | 2 +- openapi.yaml | 10 ++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java index bd5e11e..28404a9 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java @@ -29,6 +29,8 @@ public class TaskEntityInfo { private boolean hasPlannedSchedules; private boolean hasTaskSerie; + private boolean hasSubtasks; + private boolean hasParent; public TaskEntityInfo(Task task) { this.taskID = task.getTaskID(); @@ -49,6 +51,8 @@ public class TaskEntityInfo { this.hasActiveSchedules = task.hasActiveSchedule(); this.hasPlannedSchedules = task.hasPlannedSchedules(); this.hasTaskSerie = task.getTaskSerieItem() != null; + this.hasSubtasks = !task.getSubtasks().isEmpty(); + this.hasParent = task.getParent() != null; } public long getTaskID() { @@ -146,4 +150,20 @@ public class TaskEntityInfo { public void setHasTaskSerie(boolean hasTaskSerie) { this.hasTaskSerie = hasTaskSerie; } + + public boolean isHasSubtasks() { + return hasSubtasks; + } + + public void setHasSubtasks(boolean hasSubtasks) { + this.hasSubtasks = hasSubtasks; + } + + public boolean isHasParent() { + return hasParent; + } + + public void setHasParent(boolean hasParent) { + this.hasParent = hasParent; + } } diff --git a/frontend/src/api/model/taskEntityInfo.ts b/frontend/src/api/model/taskEntityInfo.ts index 3a2b2d0..5e18782 100644 --- a/frontend/src/api/model/taskEntityInfo.ts +++ b/frontend/src/api/model/taskEntityInfo.ts @@ -60,5 +60,13 @@ export interface TaskEntityInfo { * determines whether the task is associated with a taskserie */ hasTaskSerie: boolean; + /** + * determines whether a task has subtasks + */ + hasSubtasks: boolean; + /** + * determines whether a task is a top task or Not + */ + hasParent: boolean; } diff --git a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html index 92b3840..c530aad 100644 --- a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html +++ b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.html @@ -29,7 +29,7 @@ - + diff --git a/openapi.yaml b/openapi.yaml index 23db524..5af759a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2498,6 +2498,8 @@ components: - hasActiveSchedules - hasPlannedSchedules - hasTaskSerie + - hasSubtasks + - hasParent additionalProperties: false properties: taskID: @@ -2546,6 +2548,14 @@ components: type: boolean description: determines whether the task is associated with a taskserie example: false + hasSubtasks: + type: boolean + description: determines whether a task has subtasks + example: true + hasParent: + type: boolean + description: determines whether a task is a top task or Not + example: false TaskTaskgroupInfo: required: - taskID