issue-32 #34

Merged
sebastian merged 6 commits from issue-32 into master 2023-10-29 12:35:11 +01:00
3 changed files with 35 additions and 13 deletions
Showing only changes of commit 38d27c3dac - Show all commits

View File

@ -4,15 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Load worked minutes when reloading dashboard"> <list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="List missed Schedules">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../frontend/src/app/missed-schedules/missed-schedules.component.html" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/missed-schedules/missed-schedules.component.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/api/controller/ScheduleController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/controller/ScheduleController.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../frontend/src/app/missed-schedules/missed-schedules.component.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/missed-schedules/missed-schedules.component.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/repositories/timemanager/BasicTaskScheduleRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/repositories/timemanager/BasicTaskScheduleRepository.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../frontend/src/api/api/schedule.service.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/api/api/schedule.service.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../frontend/src/app/app.module.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/app.module.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../frontend/src/app/dashboard/dashboard.component.html" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/dashboard/dashboard.component.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../openapi.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../openapi.yaml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -249,7 +243,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1698569793571</updated> <updated>1698569793571</updated>
</task> </task>
<option name="localTasksCounter" value="18" /> <task id="LOCAL-00018" summary="List missed Schedules">
<option name="closed" value="true" />
<created>1698570969924</created>
<option name="number" value="00018" />
<option name="presentableId" value="LOCAL-00018" />
<option name="project" value="LOCAL" />
<updated>1698570969924</updated>
</task>
<option name="localTasksCounter" value="19" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -274,7 +276,8 @@
<MESSAGE value="Start task now from Taskoverview in Dashboard" /> <MESSAGE value="Start task now from Taskoverview in Dashboard" />
<MESSAGE value="Load worked minutes when reloading dashboard" /> <MESSAGE value="Load worked minutes when reloading dashboard" />
<MESSAGE value="Check if there is another active schedule when starting task now" /> <MESSAGE value="Check if there is another active schedule when starting task now" />
<option name="LAST_COMMIT_MESSAGE" value="Check if there is another active schedule when starting task now" /> <MESSAGE value="List missed Schedules" />
<option name="LAST_COMMIT_MESSAGE" value="List missed Schedules" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>

View File

@ -10,7 +10,7 @@
</div> </div>
<div style="width: 100%" class="reschedule-actions-container"> <div style="width: 100%" class="reschedule-actions-container">
<button mat-raised-button color="primary" class="rescheduleBtn">Reschedule</button> <button mat-raised-button color="primary" class="rescheduleBtn">Reschedule</button>
<button mat-raised-button color="warn" class="deleteBtn">Forget</button> <button mat-raised-button color="warn" class="deleteBtn" (click)="forgetSchedule(schedule)">Forget</button>
</div> </div>
</div> </div>
</mat-card-content> </mat-card-content>

View File

@ -1,6 +1,7 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {ScheduleInfo, ScheduleService} from "../../api"; import {ScheduleInfo, ScheduleService} from "../../api";
import {NavigationLink} from "../navigation-link-list/navigation-link-list.component"; import {NavigationLink} from "../navigation-link-list/navigation-link-list.component";
import {MatSnackBar} from "@angular/material/snack-bar";
@Component({ @Component({
selector: 'app-missed-schedules', selector: 'app-missed-schedules',
@ -20,7 +21,8 @@ export class MissedSchedulesComponent implements OnInit{
routerLink: ["/reschedule"] routerLink: ["/reschedule"]
} }
] ]
constructor(private scheduleService: ScheduleService) { constructor(private scheduleService: ScheduleService,
private snackbar: MatSnackBar) {
} }
ngOnInit() { ngOnInit() {
@ -30,4 +32,21 @@ export class MissedSchedulesComponent implements OnInit{
} }
}) })
} }
forgetSchedule(scheduleInfo: ScheduleInfo) {
this.scheduleService.schedulesScheduleIDScheduleTypeDelete(scheduleInfo.scheduleID, "BASIC").subscribe({
next: resp => {
this.missedSchedules = this.missedSchedules.filter(schedule => schedule.scheduleID !== scheduleInfo.scheduleID)
},
error: err => {
if(err.status == 403) {
this.snackbar.open("No permission", "", {duration: 2000})
} else if(err.status == 404) {
this.snackbar.open("Schedule not found", "", {duration: 2000});
} else {
this.snackbar.open("Unexpected error", "", {duration: 2000});
}
}
})
}
} }