diff --git a/frontend/src/app/statistics/schedule-history/schedule-history.component.css b/frontend/src/app/statistics/schedule-history/schedule-history.component.css index 11b4a81..8ff1553 100644 --- a/frontend/src/app/statistics/schedule-history/schedule-history.component.css +++ b/frontend/src/app/statistics/schedule-history/schedule-history.component.css @@ -23,3 +23,8 @@ table { width: 100%; } + +.mat-column-delete { + width: 32px; + text-align: center; +} diff --git a/frontend/src/app/statistics/schedule-history/schedule-history.component.html b/frontend/src/app/statistics/schedule-history/schedule-history.component.html index c63091d..7268b91 100644 --- a/frontend/src/app/statistics/schedule-history/schedule-history.component.html +++ b/frontend/src/app/statistics/schedule-history/schedule-history.component.html @@ -35,6 +35,10 @@ Duration {{calcDuration(element.startTime, element.finishedTime)}} + + + + diff --git a/frontend/src/app/statistics/schedule-history/schedule-history.component.ts b/frontend/src/app/statistics/schedule-history/schedule-history.component.ts index c2b1dad..7df2c9a 100644 --- a/frontend/src/app/statistics/schedule-history/schedule-history.component.ts +++ b/frontend/src/app/statistics/schedule-history/schedule-history.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit} from '@angular/core'; -import {HistoryService, ScheduleInfo, TaskgroupEntityInfo} from "../../../api"; +import {HistoryService, ScheduleInfo, ScheduleService, TaskgroupEntityInfo} from "../../../api"; import * as moment from "moment"; import {NavigationLink} from "../../navigation-link-list/navigation-link-list.component"; @@ -27,7 +27,7 @@ export class ScheduleHistoryComponent implements OnInit{ selectedDate: Date = new Date(); schedules: ScheduleInfo[] = [] - displayedColumns: string[] = ['taskgroup', 'task', 'start', 'end', 'duration']; + displayedColumns: string[] = ['taskgroup', 'task', 'start', 'end', 'duration', 'delete']; ngOnInit() { this.historyService.historySchedulesDateGet(moment(this.selectedDate).format("YYYY-MM-DD")).subscribe({ @@ -37,7 +37,8 @@ export class ScheduleHistoryComponent implements OnInit{ }) } - constructor(private historyService: HistoryService) { + constructor(private historyService: HistoryService, + private scheduleService: ScheduleService) { } computeTaskgroupPath(taskgroupPath: TaskgroupEntityInfo[]) { @@ -67,4 +68,12 @@ export class ScheduleHistoryComponent implements OnInit{ } }) } + + deleteSchedule(deletedSchedule: ScheduleInfo) { + this.scheduleService.schedulesScheduleIDDelete(deletedSchedule.scheduleID).subscribe({ + next: resp => { + this.schedules = this.schedules.filter(schedule => schedule.scheduleID !== deletedSchedule.scheduleID) + } + }) + } }