From 40a8a5fa13e4f3557eb43be91df5c212dda0bb7e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 23 Oct 2023 20:17:31 +0200 Subject: [PATCH] Visualize Basic Schedules --- backend/.idea/workspace.xml | 15 ++++++------ .../scheduler/scheduler.component.html | 2 +- .../scheduler/scheduler.component.ts | 24 ++++++++++++++++--- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/backend/.idea/workspace.xml b/backend/.idea/workspace.xml index dfb3dad..a573d41 100644 --- a/backend/.idea/workspace.xml +++ b/backend/.idea/workspace.xml @@ -5,15 +5,9 @@ - - - - - + - - diff --git a/frontend/src/app/schedules/scheduler/scheduler.component.html b/frontend/src/app/schedules/scheduler/scheduler.component.html index 9542e2a..df2a7db 100644 --- a/frontend/src/app/schedules/scheduler/scheduler.component.html +++ b/frontend/src/app/schedules/scheduler/scheduler.component.html @@ -19,6 +19,6 @@ > - + diff --git a/frontend/src/app/schedules/scheduler/scheduler.component.ts b/frontend/src/app/schedules/scheduler/scheduler.component.ts index d1398ae..ee1abf5 100644 --- a/frontend/src/app/schedules/scheduler/scheduler.component.ts +++ b/frontend/src/app/schedules/scheduler/scheduler.component.ts @@ -1,7 +1,7 @@ import {Component, OnInit, ViewChild} from '@angular/core'; import {NavigationLink, NavigationLinkListComponent} from "../../navigation-link-list/navigation-link-list.component"; import { - BasicScheduleEntityInfo, + BasicScheduleEntityInfo, ScheduleService, TaskEntityInfo, TaskgroupEntityInfo, TaskgroupService, @@ -80,7 +80,8 @@ export class SchedulerComponent implements OnInit{ constructor(private activatedRoute: ActivatedRoute, private taskgroupService: TaskgroupService, - private taskService: TaskService) { + private taskService: TaskService, + private scheduleService: ScheduleService) { } ngOnInit(): void { @@ -102,6 +103,7 @@ export class SchedulerComponent implements OnInit{ next: resp => { this.task = resp; this.initializeNavigationLinkList() + this.fetchBasicSchedules(); } }) } @@ -135,6 +137,22 @@ export class SchedulerComponent implements OnInit{ allDay: true }) this.refresh.next(); - console.log(this.events) + } + + fetchBasicSchedules() { + this.scheduleService.schedulesTaskIDScheduleTypeGet(this.task!.taskID, "BASIC").subscribe({ + next: resp => { + resp.forEach(basicSchedule => { + this.events.push({ + start: new Date(basicSchedule.scheduleDate), + title: this.task!.taskName, + color: colors['red'], + allDay: true + }) + }) + this.refresh.next(); + } + }) + } }