From f3c491826b0f3796823d5422fcdb5ccfdd96a7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 16 Mar 2024 09:37:42 +0100 Subject: [PATCH] Disable daily task repetition when task is already part of a series --- .../api/models/timemanager/tasks/TaskEntityInfo.java | 10 ++++++++++ frontend/src/api/model/taskEntityInfo.ts | 4 ++++ .../task-detail-overview.component.html | 2 +- openapi.yaml | 5 +++++ 4 files changed, 20 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 32cc1f5..bd5e11e 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 @@ -28,6 +28,7 @@ public class TaskEntityInfo { private boolean hasActiveSchedules; private boolean hasPlannedSchedules; + private boolean hasTaskSerie; public TaskEntityInfo(Task task) { this.taskID = task.getTaskID(); @@ -47,6 +48,7 @@ public class TaskEntityInfo { this.finishable = task.isFinishable(); this.hasActiveSchedules = task.hasActiveSchedule(); this.hasPlannedSchedules = task.hasPlannedSchedules(); + this.hasTaskSerie = task.getTaskSerieItem() != null; } public long getTaskID() { @@ -136,4 +138,12 @@ public class TaskEntityInfo { public void setHasPlannedSchedules(boolean hasPlannedSchedules) { this.hasPlannedSchedules = hasPlannedSchedules; } + + public boolean isHasTaskSerie() { + return hasTaskSerie; + } + + public void setHasTaskSerie(boolean hasTaskSerie) { + this.hasTaskSerie = hasTaskSerie; + } } diff --git a/frontend/src/api/model/taskEntityInfo.ts b/frontend/src/api/model/taskEntityInfo.ts index e97b949..3a2b2d0 100644 --- a/frontend/src/api/model/taskEntityInfo.ts +++ b/frontend/src/api/model/taskEntityInfo.ts @@ -56,5 +56,9 @@ export interface TaskEntityInfo { * determines whether the task has schedules that can be started */ hasPlannedSchedules: boolean; + /** + * determines whether the task is associated with a taskserie + */ + hasTaskSerie: 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 7b87743..24038f3 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 4afa66e..2ff5ea4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2414,6 +2414,7 @@ components: - finishable - hasActiveSchedules - hasPlannedSchedules + - hasTaskSerie additionalProperties: false properties: taskID: @@ -2458,6 +2459,10 @@ components: hasPlannedSchedules: type: boolean description: determines whether the task has schedules that can be started + hasTaskSerie: + type: boolean + description: determines whether the task is associated with a taskserie + example: false TaskTaskgroupInfo: required: - taskID