issue-44 #75

Merged
sebastian merged 4 commits from issue-44 into master 2023-11-18 18:47:34 +01:00
Showing only changes of commit 5f60470e2a - Show all commits

View File

@ -12,7 +12,7 @@ import {DialogRef} from "@angular/cdk/dialog";
import {MatDialogRef} from "@angular/material/dialog";
import {filter, map, Observable, startWith, Subject} from "rxjs";
import {FormControl} from "@angular/forms";
import {CalendarEvent, CalendarEventTimesChangedEvent} from "angular-calendar";
import {CalendarEvent, CalendarEventAction, CalendarEventTimesChangedEvent} from "angular-calendar";
import * as moment from "moment/moment";
import {EventColor} from "calendar-utils";
import {TaskOverviewData} from "../taskgroup-overview/taskgroup-overview.component";
@ -55,6 +55,17 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
taskgroupSelected: boolean = false;
actions: CalendarEventAction[] = [
{
label: '<i class="fas fa-fw fa-trash-alt"></i>',
a11yLabel: 'Delete',
onClick: ({ event }: { event: CalendarEvent }): void => {
this.events = this.events.filter((iEvent) => iEvent !== event);
this.eventClicked('Deleted', event);
},
},
];
constructor(private router: Router,
private scheduleService: ScheduleService) {
@ -64,8 +75,6 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
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'],
@ -75,7 +84,12 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
resizable: {
beforeStart: false,
afterEnd: false
}
},
meta: {
taskID: schedule.task.taskID,
scheduleID: schedule.scheduleID,
taskgroupID: schedule.taskgroupPath[schedule.taskgroupPath.length-1].taskgroupID
},
})
})
this.refresh.next()
@ -132,7 +146,7 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
scheduleID: undefined,
taskgroupID: taskgroup.taskgroupID
},
//actions: this.actions
actions: this.actions
})
})
this.taskgroupID = taskgroup.taskgroupID;
@ -148,7 +162,10 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
}
eventClicked(click: string, event: CalendarEvent) {
if(click == 'Deleted') {
this.events = this.events.filter(se => se !== event);
this.taskgroupSelected = false;
}
}
register() {