issue-18 #28

Merged
sebastian merged 55 commits from issue-18 into master 2023-10-28 19:36:14 +02:00
2 changed files with 21 additions and 18 deletions
Showing only changes of commit c598515899 - Show all commits

View File

@ -15,7 +15,7 @@
</div>
<mwl-calendar-week-view [viewDate]="viewDate" [daysInWeek]="daysInWeek" [dayStartHour]="7" [dayEndHour]="21" [refresh]="refresh"
(dayHeaderClicked)="timeClick($event.day.date)"
(hourSegmentClicked)="timeClick($event.date)" [events]="events"
(hourSegmentClicked)="timeClick($event.date)" [events]="events" (eventClicked)="eventClicked($event)"
>
</mwl-calendar-week-view>

View File

@ -7,7 +7,7 @@ import {
TaskgroupService,
TaskService
} from "../../../api";
import {ActivatedRoute} from "@angular/router";
import {ActivatedRoute, Router} from "@angular/router";
import {CalendarDateFormatter, CalendarEvent, CalendarView} from "angular-calendar";
import { Subject } from 'rxjs';
import {CalendarDatePipe} from "angular-calendar/modules/common/calendar-date/calendar-date.pipe";
@ -62,26 +62,15 @@ export class SchedulerComponent implements OnInit{
viewDate = new Date();
daysInWeek = 7;
refresh: Subject<void> = new Subject<void>()
events: CalendarEvent[] = [
{
title: 'An all day event',
color: colors['yellow'],
start: new Date(),
allDay: true,
},
{
title: 'A non all day event',
color: colors['blue'],
start: new Date(),
},
]
events: CalendarEvent[] = []
@ViewChild('basicScheduler') basicScheduler: BasicSchedulerComponent | undefined
constructor(private activatedRoute: ActivatedRoute,
private taskgroupService: TaskgroupService,
private taskService: TaskService,
private scheduleService: ScheduleService) {
private scheduleService: ScheduleService,
private router: Router) {
}
ngOnInit(): void {
@ -145,9 +134,9 @@ export class SchedulerComponent implements OnInit{
resp.forEach(basicSchedule => {
this.events.push({
start: new Date(basicSchedule.scheduleDate),
title: this.task!.taskName,
title: this.computeTaskPath(),
color: colors['red'],
allDay: true
allDay: true,
})
})
this.refresh.next();
@ -155,4 +144,18 @@ export class SchedulerComponent implements OnInit{
})
}
eventClicked({ event }: { event: CalendarEvent }): void {
this.router.navigateByUrl("/taskgroups/" + this.taskgroupID.toString() + "/tasks/" + this.task!.taskID )
}
computeTaskPath() {
let result = "";
this.taskgroupPath.forEach(taskgroupPathPart => {
result += taskgroupPathPart.taskgroupName + "/"
});
result += this.taskgroup!.taskgroupName + "/"
result += this.task!.taskName
return result;
}
}