issue-18 #28
@ -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>
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user