Reset select task in forgotten task scheduler
This commit is contained in:
parent
edcd0f6c77
commit
5f60470e2a
@ -12,7 +12,7 @@ import {DialogRef} from "@angular/cdk/dialog";
|
|||||||
import {MatDialogRef} from "@angular/material/dialog";
|
import {MatDialogRef} from "@angular/material/dialog";
|
||||||
import {filter, map, Observable, startWith, Subject} from "rxjs";
|
import {filter, map, Observable, startWith, Subject} from "rxjs";
|
||||||
import {FormControl} from "@angular/forms";
|
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 * as moment from "moment/moment";
|
||||||
import {EventColor} from "calendar-utils";
|
import {EventColor} from "calendar-utils";
|
||||||
import {TaskOverviewData} from "../taskgroup-overview/taskgroup-overview.component";
|
import {TaskOverviewData} from "../taskgroup-overview/taskgroup-overview.component";
|
||||||
@ -55,6 +55,17 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
|||||||
|
|
||||||
taskgroupSelected: boolean = false;
|
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,
|
constructor(private router: Router,
|
||||||
private scheduleService: ScheduleService) {
|
private scheduleService: ScheduleService) {
|
||||||
@ -64,8 +75,6 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
|||||||
this.scheduleService.schedulesDateStartableGet(moment().format("yyyy-MM-DD"), false).subscribe({
|
this.scheduleService.schedulesDateStartableGet(moment().format("yyyy-MM-DD"), false).subscribe({
|
||||||
next: resp => {
|
next: resp => {
|
||||||
resp.forEach(schedule => {
|
resp.forEach(schedule => {
|
||||||
console.log(schedule.startTime)
|
|
||||||
console.log(schedule.finishedTime)
|
|
||||||
this.events.push({
|
this.events.push({
|
||||||
title: this.computeTaskPath(schedule.taskgroupPath, schedule.task),
|
title: this.computeTaskPath(schedule.taskgroupPath, schedule.task),
|
||||||
color: colors['red'],
|
color: colors['red'],
|
||||||
@ -75,7 +84,12 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
|||||||
resizable: {
|
resizable: {
|
||||||
beforeStart: false,
|
beforeStart: false,
|
||||||
afterEnd: false
|
afterEnd: false
|
||||||
}
|
},
|
||||||
|
meta: {
|
||||||
|
taskID: schedule.task.taskID,
|
||||||
|
scheduleID: schedule.scheduleID,
|
||||||
|
taskgroupID: schedule.taskgroupPath[schedule.taskgroupPath.length-1].taskgroupID
|
||||||
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.refresh.next()
|
this.refresh.next()
|
||||||
@ -132,7 +146,7 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
|||||||
scheduleID: undefined,
|
scheduleID: undefined,
|
||||||
taskgroupID: taskgroup.taskgroupID
|
taskgroupID: taskgroup.taskgroupID
|
||||||
},
|
},
|
||||||
//actions: this.actions
|
actions: this.actions
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.taskgroupID = taskgroup.taskgroupID;
|
this.taskgroupID = taskgroup.taskgroupID;
|
||||||
@ -148,7 +162,10 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
eventClicked(click: string, event: CalendarEvent) {
|
eventClicked(click: string, event: CalendarEvent) {
|
||||||
|
if(click == 'Deleted') {
|
||||||
|
this.events = this.events.filter(se => se !== event);
|
||||||
|
this.taskgroupSelected = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
register() {
|
register() {
|
||||||
|
Loading…
Reference in New Issue
Block a user