schedule-refactor #45
@ -13,21 +13,12 @@
|
|||||||
|
|
||||||
export interface ForgottenActivityRequest {
|
export interface ForgottenActivityRequest {
|
||||||
/**
|
/**
|
||||||
* mode of register forgotten activity
|
* time the schedule was started
|
||||||
*/
|
*/
|
||||||
mode: ForgottenActivityRequest.ModeEnum;
|
startTime: string;
|
||||||
/**
|
/**
|
||||||
* number of minutes spent on task
|
* time the schedule was stopped
|
||||||
*/
|
*/
|
||||||
minutesSpent?: number;
|
endTime: string;
|
||||||
}
|
|
||||||
export namespace ForgottenActivityRequest {
|
|
||||||
export type ModeEnum = 'MANUAL' | 'LAST' | 'PLANNED';
|
|
||||||
export const ModeEnum = {
|
|
||||||
Manual: 'MANUAL' as ModeEnum,
|
|
||||||
Last: 'LAST' as ModeEnum,
|
|
||||||
Planned: 'PLANNED' as ModeEnum
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<div mat-dialog-actions align="end">
|
<div mat-dialog-actions align="end">
|
||||||
<button mat-raised-button>Cancel</button>
|
<button mat-raised-button>Cancel</button>
|
||||||
<button mat-raised-button color="primary" (click)="registerActivity()">Register</button>
|
<button mat-raised-button color="primary" (click)="registerActivity()" [disabled]="true">Register</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import {DialogRef} from "@angular/cdk/dialog";
|
|||||||
import {MatDialogRef} from "@angular/material/dialog";
|
import {MatDialogRef} from "@angular/material/dialog";
|
||||||
import {filter, map, Observable, startWith} from "rxjs";
|
import {filter, map, Observable, startWith} from "rxjs";
|
||||||
import {FormControl} from "@angular/forms";
|
import {FormControl} from "@angular/forms";
|
||||||
import ModeEnum = ForgottenActivityRequest.ModeEnum;
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-forgotten-task-start-dialog',
|
selector: 'app-forgotten-task-start-dialog',
|
||||||
@ -53,7 +52,7 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
|||||||
registerActivity() {
|
registerActivity() {
|
||||||
const task = this.tasks.find(task => task.taskName === this.myControl.value);
|
const task = this.tasks.find(task => task.taskName === this.myControl.value);
|
||||||
if(task != undefined) {
|
if(task != undefined) {
|
||||||
this.scheduleService.schedulesTaskIDForgottenPost(task.taskID, {
|
/*this.scheduleService.schedulesTaskIDForgottenPost(task.taskID, {
|
||||||
mode: this.determineRegisterMode(),
|
mode: this.determineRegisterMode(),
|
||||||
minutesSpent: this.minutesSpentControl.value
|
minutesSpent: this.minutesSpentControl.value
|
||||||
}).subscribe({
|
}).subscribe({
|
||||||
@ -71,17 +70,7 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
|
|||||||
this.snackbar.open("Unexpected error", "", {duration: 2000});
|
this.snackbar.open("Unexpected error", "", {duration: 2000});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})*/
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private determineRegisterMode(): ModeEnum {
|
|
||||||
if(this.lastSchedule) {
|
|
||||||
return "LAST";
|
|
||||||
} else if(this.plannedSchedule) {
|
|
||||||
return "PLANNED";
|
|
||||||
} else {
|
|
||||||
return "MANUAL";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user