schedule-refactor #45

Merged
sebastian merged 18 commits from schedule-refactor into master 2023-11-11 18:56:16 +01:00
3 changed files with 7 additions and 27 deletions
Showing only changes of commit 4d532c4dbc - Show all commits

View File

@ -13,21 +13,12 @@
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;
}
export namespace ForgottenActivityRequest {
export type ModeEnum = 'MANUAL' | 'LAST' | 'PLANNED';
export const ModeEnum = {
Manual: 'MANUAL' as ModeEnum,
Last: 'LAST' as ModeEnum,
Planned: 'PLANNED' as ModeEnum
};
endTime: string;
}

View File

@ -25,7 +25,7 @@
<div mat-dialog-actions align="end">
<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>

View File

@ -5,7 +5,6 @@ import {DialogRef} from "@angular/cdk/dialog";
import {MatDialogRef} from "@angular/material/dialog";
import {filter, map, Observable, startWith} from "rxjs";
import {FormControl} from "@angular/forms";
import ModeEnum = ForgottenActivityRequest.ModeEnum;
@Component({
selector: 'app-forgotten-task-start-dialog',
@ -53,7 +52,7 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
registerActivity() {
const task = this.tasks.find(task => task.taskName === this.myControl.value);
if(task != undefined) {
this.scheduleService.schedulesTaskIDForgottenPost(task.taskID, {
/*this.scheduleService.schedulesTaskIDForgottenPost(task.taskID, {
mode: this.determineRegisterMode(),
minutesSpent: this.minutesSpentControl.value
}).subscribe({
@ -71,17 +70,7 @@ export class ForgottenTaskStartDialogComponent implements OnInit{
this.snackbar.open("Unexpected error", "", {duration: 2000});
}
}
})
}
}
private determineRegisterMode(): ModeEnum {
if(this.lastSchedule) {
return "LAST";
} else if(this.plannedSchedule) {
return "PLANNED";
} else {
return "MANUAL";
})*/
}
}
}