issue-112 #115
@ -6,16 +6,18 @@
|
||||
</mat-card>
|
||||
<mat-card *ngIf="activeSchedule != undefined">
|
||||
<mat-card-header>
|
||||
<mat-card-title><a routerLink="/" class="link-no-deco">{{activeSchedule!.task.taskName}}</a></mat-card-title>
|
||||
<mat-card-title><a [routerLink]="['/taskgroups', taskgroupID, 'tasks', activeSchedule!.task.taskID]" class="link-no-deco">{{activeSchedule!.task.taskName}}</a></mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<span *ngFor="let taskgroupPath of activeSchedule!.taskgroupPath">{{taskgroupPath.taskgroupName}} /</span>
|
||||
<span *ngFor="let taskgroupPath of activeSchedule!.taskgroupPath">
|
||||
<a class="link-no-deco" [routerLink]="['/taskgroups', taskgroupPath.taskgroupID]"> {{taskgroupPath.taskgroupName}} </a>/
|
||||
</span>
|
||||
<p class="gray-text">Running for {{displayTime}}</p>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button class="btn btn-secondary" (click)="stopTask(false)">Stop</button>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-success">Finish</button>
|
||||
<button type="button" class="btn btn-success" (click)="finishSchedule()">Finish</button>
|
||||
<button type="button" class="btn btn-success dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="visually-hidden">Toggle Dropdown</span>
|
||||
</button>
|
||||
|
@ -1,5 +1,11 @@
|
||||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||
import {ScheduleInfo, ScheduleService, TaskOverviewInfo, TaskScheduleStopResponse} from "../../../api";
|
||||
import {
|
||||
ScheduleInfo,
|
||||
ScheduleService,
|
||||
TaskgroupEntityInfo,
|
||||
TaskOverviewInfo,
|
||||
TaskScheduleStopResponse
|
||||
} from "../../../api";
|
||||
import {StopActiveScheduleInfo} from "./StopActiveScheduleInfo";
|
||||
import {TaskOverviewComponent} from "../task-overview/task-overview.component";
|
||||
import {MatDialog} from "@angular/material/dialog";
|
||||
@ -19,6 +25,7 @@ export interface StopActiveScheduleEmitterInfo {
|
||||
})
|
||||
export class ActiveScheduleComponent implements OnInit{
|
||||
activeSchedule: ScheduleInfo | undefined
|
||||
taskgroupID: number | undefined
|
||||
|
||||
startTime: number = 0;
|
||||
currentTime: number = 0;
|
||||
@ -56,11 +63,15 @@ export class ActiveScheduleComponent implements OnInit{
|
||||
next: resp => {
|
||||
if(resp.scheduleID >= 0) {
|
||||
this.activateSchedule(resp);
|
||||
this.taskgroupID = resp.taskgroupPath[resp.taskgroupPath.length-1].taskgroupID
|
||||
console.log(this.taskgroupID)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
stopTask(finish: boolean) {
|
||||
@ -99,6 +110,14 @@ export class ActiveScheduleComponent implements OnInit{
|
||||
|
||||
}
|
||||
|
||||
finishSchedule() {
|
||||
this.scheduleService.schedulesScheduleIDStopFinishPost(this.activeSchedule!.scheduleID, true).subscribe({
|
||||
next: resp => {
|
||||
this.activeSchedule = undefined;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
finishManual() {
|
||||
const dialogRef = this.dialog.open(StopScheduleManuallyComponent, {
|
||||
data: this.activeSchedule,
|
||||
|
@ -23,16 +23,18 @@
|
||||
<mat-card *ngFor="let schedule of schedules">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
<a routerLink="/" class="link-no-deco">{{schedule.task.taskName}}</a>
|
||||
<a [routerLink]="['/taskgroups', schedule.taskgroupPath[schedule.taskgroupPath.length-1].taskgroupID, 'tasks', schedule.task.taskID]" class="link-no-deco">{{schedule.task.taskName}}</a>
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<span *ngFor="let taskgroupPath of schedule.taskgroupPath">{{taskgroupPath.taskgroupName}} /</span>
|
||||
<span *ngFor="let taskgroupPath of schedule.taskgroupPath">
|
||||
<a class="link-no-deco" [routerLink]="['/taskgroups', taskgroupPath.taskgroupID]"> {{taskgroupPath.taskgroupName}} /</a>
|
||||
</span>
|
||||
<p class="gray-text" *ngIf="schedule.scheduleType==='BASIC'">To be done sometime today</p>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button color="primary" class="primaryBtn" (click)="startSchedule(schedule)" [disabled]="activeScheduleComponent!.activeSchedule != undefined">Start now</button>
|
||||
<button mat-raised-button class="yellowBtn">Reschedule</button>
|
||||
<button mat-raised-button class="yellowBtn" [routerLink]="['/taskgroups', schedule.taskgroupPath[schedule.taskgroupPath.length-1].taskgroupID, 'tasks', schedule.task.taskID, 'schedule', schedule.scheduleID]">Reschedule</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
@ -5,6 +5,11 @@
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.navi-link-container {
|
||||
margin: 20px auto;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
margin-bottom: 2.5%;
|
||||
}
|
||||
|
@ -1,4 +1,8 @@
|
||||
<div class="navi-link-container">
|
||||
<app-navigation-link-list [navigationLinks]="defaultNavigationLinks"></app-navigation-link-list>
|
||||
</div>
|
||||
<div class="container">
|
||||
|
||||
<div class="calendar-container">
|
||||
<h1 mat-dialog-title>Register forgotten activity</h1>
|
||||
<mwl-calendar-day-view
|
||||
|
@ -17,6 +17,7 @@ import * as moment from "moment/moment";
|
||||
import {EventColor} from "calendar-utils";
|
||||
import {TaskOverviewData} from "../taskgroup-overview/taskgroup-overview.component";
|
||||
import {Router} from "@angular/router";
|
||||
import {NavigationLink} from "../../navigation-link-list/navigation-link-list.component";
|
||||
|
||||
|
||||
const colors: Record<string, EventColor> = {
|
||||
@ -65,6 +66,16 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
||||
},
|
||||
},
|
||||
];
|
||||
defaultNavigationLinks: NavigationLink[] = [
|
||||
{
|
||||
linkText: "Dashboard",
|
||||
routerLink: ['/']
|
||||
},
|
||||
{
|
||||
linkText: "Register Forgotten Activity",
|
||||
routerLink: ["/forgotten"]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
constructor(private router: Router,
|
||||
|
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
|
||||
<div style="float:right;">
|
||||
<button mat-raised-button color="warn">Delete</button>
|
||||
<button mat-raised-button color="warn" (click)="deleteTask()">Delete</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -187,4 +187,12 @@ export class TaskDetailOverviewComponent implements OnInit {
|
||||
minWidth: "400px"
|
||||
})
|
||||
}
|
||||
|
||||
deleteTask() {
|
||||
this.taskService.tasksTaskIDDelete(this.task!.taskID).subscribe({
|
||||
next: resp => {
|
||||
this.router.navigateByUrl("/")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user