From 98efb9150c3aec2d48de6fc26643446ac9012daf Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 28 Oct 2023 19:09:07 +0200 Subject: [PATCH] Add tasks from TaskOverview --- .../task-overview.component.html | 2 +- .../task-overview/task-overview.component.ts | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.html b/frontend/src/app/dashboard/task-overview/task-overview.component.html index b0b45fa..4f5a1c8 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.html +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.html @@ -1,4 +1,4 @@ - +

{{task.taskName}}

diff --git a/frontend/src/app/dashboard/task-overview/task-overview.component.ts b/frontend/src/app/dashboard/task-overview/task-overview.component.ts index aebc19c..c0d491b 100644 --- a/frontend/src/app/dashboard/task-overview/task-overview.component.ts +++ b/frontend/src/app/dashboard/task-overview/task-overview.component.ts @@ -1,6 +1,9 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; import {BasicScheduleEntityInfo, ScheduleInfo, ScheduleService, TaskOverviewInfo, TaskService} from "../../../api"; import {MatSnackBar} from "@angular/material/snack-bar"; +import {TaskEditorData} from "../../tasks/task-editor/TaskEditorData"; +import {TaskEditorComponent} from "../../tasks/task-editor/task-editor.component"; +import {MatDialog} from "@angular/material/dialog"; @Component({ selector: 'app-task-overview', @@ -16,7 +19,8 @@ export class TaskOverviewComponent { constructor(private scheduleService: ScheduleService, private snackbar: MatSnackBar, - private taskService: TaskService) { + private taskService: TaskService, + private dialog: MatDialog) { } startTaskNow(task: TaskOverviewInfo) { @@ -55,4 +59,24 @@ export class TaskOverviewComponent { } }) } + + openTaskCreation() { + const editorData: TaskEditorData = { + task: undefined, + taskgroupID: this.taskgroupID! + } + const dialogRef = this.dialog.open(TaskEditorComponent, {data: editorData, width: "600px"}) + dialogRef.afterClosed().subscribe(res => { + if(res != undefined) { + this.tasks.push({ + taskID: res.taskID, + eta: res.eta, + limit: res.deadline, + taskName: res.taskName, + activeTime: 0, + overdue: res.overdue + }) + } + }) + } }