Edit Task from TaskDetailView

This commit is contained in:
Sebastian 2023-10-24 19:31:55 +02:00
parent 9489245115
commit b8664124ca
2 changed files with 17 additions and 2 deletions

View File

@ -21,7 +21,7 @@
<div style="float: left">
<button mat-flat-button class="borderless-btn" color="primary" [routerLink]="['/taskgroups', taskgroup!.taskgroupID, 'tasks', task!.taskID, 'schedule']">Schedule</button>
<button mat-flat-button class="yellowBtn">Start now</button>
<button mat-flat-button class="grayBtn" >Edit</button>
<button mat-flat-button class="grayBtn" (click)="openTaskEditor()">Edit</button>
<!--<button mat-raised-button>Copy</button>-->
<button mat-flat-button class="greenBtn" >Finished</button>
</div>

View File

@ -3,6 +3,9 @@ import {NavigationLink, NavigationLinkListComponent} from "../../navigation-link
import {ActivatedRoute} from "@angular/router";
import {TaskEntityInfo, TaskgroupEntityInfo, TaskgroupService, TaskService} from "../../../api";
import {TaskDashboardComponent} from "../task-dashboard/task-dashboard.component";
import {MatDialog} from "@angular/material/dialog";
import {TaskEditorComponent} from "../task-editor/task-editor.component";
import {TaskEditorData} from "../task-editor/TaskEditorData";
@Component({
selector: 'app-task-detail-overview',
@ -31,7 +34,8 @@ export class TaskDetailOverviewComponent implements OnInit {
constructor(private activatedRoute: ActivatedRoute,
private taskgroupService: TaskgroupService,
private taskService: TaskService) {
private taskService: TaskService,
private dialog: MatDialog) {
}
ngOnInit(): void {
@ -65,4 +69,15 @@ export class TaskDetailOverviewComponent implements OnInit {
return "green";
}
openTaskEditor() {
if(this.task != undefined) {
const taskEditorInfo: TaskEditorData = {
task: this.task!,
taskgroupID: this.taskgroupID!
};
this.dialog.open(TaskEditorComponent, {data: taskEditorInfo, width: "600px"})
}
}
}