From edcd0f6c77ee0439464c7708fed17f2db7ffb272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 18 Nov 2023 18:38:11 +0100 Subject: [PATCH] Display existing schedules in forgetten schedules scheduler --- .../scheduleInfos/ScheduleInfo.java | 4 ++-- .../java/core/entities/timemanager/Task.java | 1 + .../forgotten-task-start-dialog.component.ts | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/ScheduleInfo.java b/backend/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/ScheduleInfo.java index 1d2fe62..792b19d 100644 --- a/backend/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/ScheduleInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/ScheduleInfo.java @@ -17,7 +17,7 @@ public abstract class ScheduleInfo { @JsonProperty private LocalDateTime startTime; @JsonProperty - private LocalDateTime stopTime; + private LocalDateTime finishedTime; @JsonProperty private int activeMinutes; @JsonProperty @@ -29,7 +29,7 @@ public abstract class ScheduleInfo { this.scheduleID = scheduleID; this.scheduleType = scheduleType; this.startTime = startTime; - this.stopTime = stopTime; + this.finishedTime = stopTime; this.activeMinutes = activeMinutes; this.task = new TaskShortInfo(task); this.taskgroupPath = taskgroupPath; diff --git a/backend/src/main/java/core/entities/timemanager/Task.java b/backend/src/main/java/core/entities/timemanager/Task.java index e2fb81e..5209379 100644 --- a/backend/src/main/java/core/entities/timemanager/Task.java +++ b/backend/src/main/java/core/entities/timemanager/Task.java @@ -39,6 +39,7 @@ public class Task { private int workTime; public Task() { + this.basicTaskSchedules = new ArrayList<>(); } public Task(Taskgroup taskgroup, TaskFieldInfo taskFieldInfo) { diff --git a/frontend/src/app/dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component.ts b/frontend/src/app/dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component.ts index dadc140..ba407bc 100644 --- a/frontend/src/app/dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component.ts +++ b/frontend/src/app/dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component.ts @@ -61,7 +61,27 @@ export class ForgottenTaskStartDialogComponent implements OnInit{ } ngOnInit() { + this.scheduleService.schedulesDateStartableGet(moment().format("yyyy-MM-DD"), false).subscribe({ + next: resp => { + resp.forEach(schedule => { + console.log(schedule.startTime) + console.log(schedule.finishedTime) + this.events.push({ + title: this.computeTaskPath(schedule.taskgroupPath, schedule.task), + color: colors['red'], + start: new Date(schedule.startTime), + end: new Date(schedule.finishedTime!), + draggable: false, + resizable: { + beforeStart: false, + afterEnd: false + } + }) + }) + this.refresh.next() + } + }) }