-
{{schedule.scheduleDate | date:'EEEE, d MMM. y'}}
-
-
-
+
+
+
{{ toBasicSchedule(schedule).scheduleDate | date:'EEEE, d MMM. y'}}
+
+
+
+
-
+
+
+
diff --git a/frontend/src/app/schedules/schedule-dashboard/schedule-dashboard.component.ts b/frontend/src/app/schedules/schedule-dashboard/schedule-dashboard.component.ts
index 82de4b0..67583f9 100644
--- a/frontend/src/app/schedules/schedule-dashboard/schedule-dashboard.component.ts
+++ b/frontend/src/app/schedules/schedule-dashboard/schedule-dashboard.component.ts
@@ -1,5 +1,11 @@
import {Component, Input, OnInit} from '@angular/core';
-import {BasicScheduleEntityInfo, ScheduleService, TaskEntityInfo, TaskgroupEntityInfo} from "../../../api";
+import {
+ BasicScheduleEntityInfo, BasicScheduleInfo,
+ ScheduleInfo,
+ ScheduleService,
+ TaskEntityInfo,
+ TaskgroupEntityInfo
+} from "../../../api";
import {MatSnackBar} from "@angular/material/snack-bar";
@Component({
@@ -12,7 +18,7 @@ export class ScheduleDashboardComponent implements OnInit{
@Input('taskgroup') taskgroup: TaskgroupEntityInfo | undefined
@Input('task') task: TaskEntityInfo | undefined
- schedules: BasicScheduleEntityInfo[] = []
+ schedules: ScheduleInfo[] = []
constructor(private scheduleService: ScheduleService,
private snackbar: MatSnackBar) {
@@ -20,7 +26,7 @@ export class ScheduleDashboardComponent implements OnInit{
}
ngOnInit() {
- this.scheduleService.schedulesTaskIDScheduleTypeGet(this.task!.taskID, "BASIC").subscribe({
+ this.scheduleService.schedulesTaskIDGet(this.task!.taskID).subscribe({
next: resp => {
this.schedules = resp;
}
@@ -31,8 +37,8 @@ export class ScheduleDashboardComponent implements OnInit{
//todo
}
- deleteSchedule(deletedSchedule: BasicScheduleEntityInfo) {
- this.scheduleService.schedulesScheduleIDScheduleTypeDelete(deletedSchedule.scheduleID, 'BASIC').subscribe({
+ deleteSchedule(deletedSchedule: ScheduleInfo) {
+ this.scheduleService.schedulesScheduleIDDelete(deletedSchedule.scheduleID).subscribe({
next: resp => {
this.schedules = this.schedules.filter(schedule => schedule.scheduleID !== deletedSchedule.scheduleID);
},
@@ -47,4 +53,8 @@ export class ScheduleDashboardComponent implements OnInit{
}
})
}
+
+ toBasicSchedule(schedule: ScheduleInfo) {
+ return schedule as BasicScheduleInfo
+ }
}
diff --git a/frontend/src/app/schedules/scheduler/scheduler.component.ts b/frontend/src/app/schedules/scheduler/scheduler.component.ts
index a5aea85..6d5755f 100644
--- a/frontend/src/app/schedules/scheduler/scheduler.component.ts
+++ b/frontend/src/app/schedules/scheduler/scheduler.component.ts
@@ -1,7 +1,7 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {NavigationLink, NavigationLinkListComponent} from "../../navigation-link-list/navigation-link-list.component";
import {
- BasicScheduleEntityInfo, ScheduleService,
+ BasicScheduleEntityInfo, BasicScheduleInfo, ScheduleService,
TaskEntityInfo,
TaskgroupEntityInfo,
TaskgroupService,
@@ -136,26 +136,33 @@ export class SchedulerComponent implements OnInit{
fetschSchedules() {
this.scheduleService.schedulesGet().subscribe({
next: resp => {
- resp.forEach(schedule => {
- let color: EventColor = colors['red']
- if(schedule.scheduleID === this.scheduleID) {
- color = colors['yellow']
+ resp.forEach(abstractSchedule => {
+ if(abstractSchedule.scheduleType == 'BASIC') {
+ this.handleFetchedBasicSchedule(abstractSchedule as BasicScheduleInfo)
}
- if(schedule.scheduleType === 'BASIC') {
- this.events.push({
- start: new Date(schedule.schedule.scheduleDate),
- title: this.computeTaskPath(schedule.taskgroupPath, schedule.task),
- color: color,
- allDay: true,
- })
- }
})
this.refresh.next();
}
})
}
+ handleFetchedBasicSchedule(schedule: BasicScheduleInfo) {
+ let color: EventColor = colors['red']
+ if(schedule.scheduleID === this.scheduleID) {
+ color = colors['yellow']
+ }
+
+ if(schedule.scheduleType === 'BASIC') {
+ this.events.push({
+ start: new Date(schedule.scheduleDate),
+ title: this.computeTaskPath(schedule.taskgroupPath, schedule.task),
+ color: color,
+ allDay: true,
+ })
+ }
+ }
+
eventClicked({ event }: { event: CalendarEvent }): void {
this.router.navigateByUrl("/taskgroups/" + this.taskgroupID.toString() + "/tasks/" + this.task!.taskID )
}
diff --git a/openapi.yaml b/openapi.yaml
index 7137880..bf0dad5 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -1270,7 +1270,7 @@ paths:
items:
$ref: '#/components/schemas/ScheduleInfo'
- /schedules/{taskID}/{scheduleType}:
+ /schedules/{taskID}:
get:
security:
- API_TOKEN: []
@@ -1286,16 +1286,6 @@ paths:
schema:
type: number
example: 1
- - name: scheduleType
- in: path
- description: internal id of task
- required: true
- schema:
- type: string
- enum:
- - BASIC
- - MODERATE
- - ADVANCED
responses:
200:
description: operation successfull
@@ -1304,7 +1294,7 @@ paths:
schema:
type: array
items:
- $ref: '#/components/schemas/BasicScheduleEntityInfo'
+ $ref: '#/components/schemas/ScheduleInfo'
403:
description: No permission
content:
@@ -1319,7 +1309,6 @@ paths:
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
- /schedules/{taskID}/basic:
put:
security:
- API_TOKEN: []
@@ -1347,7 +1336,7 @@ paths:
application/json:
schema:
type: object
- $ref: '#/components/schemas/BasicScheduleEntityInfo'
+ $ref: '#/components/schemas/ScheduleInfo'
403:
description: No permission
content:
@@ -1362,7 +1351,7 @@ paths:
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
- /schedules/{scheduleID}/basic:
+ /schedules/{scheduleID}:
post:
security:
- API_TOKEN: []
@@ -1390,7 +1379,7 @@ paths:
application/json:
schema:
type: object
- $ref: '#/components/schemas/SimpleStatusResponse'
+ $ref: '#/components/schemas/ScheduleInfo'
403:
description: No permission
content:
@@ -1405,7 +1394,6 @@ paths:
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
- /schedules/{scheduleID}/{scheduleType}:
delete:
security:
- API_TOKEN: []
@@ -1421,16 +1409,6 @@ paths:
schema:
type: number
example: 1
- - name: scheduleType
- in: path
- description: internal id of task
- required: true
- schema:
- type: string
- enum:
- - BASIC
- - MODERATE
- - ADVANCED
responses:
200:
description: operation successfull
@@ -1453,7 +1431,7 @@ paths:
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
- /schedules/today/{activateable}:
+ /schedules/{date}/{startable}:
get:
security:
- API_TOKEN: []
@@ -1462,7 +1440,15 @@ paths:
description: get all schedules of today
summary: get today's schedules
parameters:
- - name: activateable
+ - name: date
+ in: path
+ description: determines the scheduled dates of the schedules
+ required: true
+ schema:
+ type: string
+ format: date
+ nullable: true
+ - name: startable
in: path
description: determines whether only schedules that can be started should be included or all schedules of today
required: true
@@ -2182,7 +2168,6 @@ components:
- startTime
- finishTime
- activeMinutes
- - schedule
- task
- taskgroupPath
additionalProperties: false
@@ -2211,10 +2196,6 @@ components:
type: number
description: number in minutes that the schedule was active
example: 10
- schedule:
- type: object
- oneOf:
- - $ref: '#/components/schemas/BasicScheduleFieldInfo'
task:
type: object
$ref: '#/components/schemas/TaskShortInfo'
@@ -2222,7 +2203,17 @@ components:
type: array
items:
$ref: '#/components/schemas/TaskgroupEntityInfo'
-
+ BasicScheduleInfo:
+ allOf:
+ - $ref: '#/components/schemas/ScheduleInfo'
+ - type: object
+ required:
+ - scheduleDate
+ additionalProperties: false
+ properties:
+ scheduleDate:
+ type: string
+ format: date
TaskShortInfo:
required:
- taskID
@@ -2342,19 +2333,16 @@ components:
example: true
ForgottenActivityRequest:
required:
- - mode
+ - startTime
+ - endTime
additionalProperties: false
properties:
- mode:
+ startTime:
type: string
- description: mode of register forgotten activity
- example: MANUAL
- enum:
- - MANUAL
- - LAST
- - PLANNED
- minutesSpent:
- type: number
- description: number of minutes spent on task
- example: 10
+ format: date
+ description: time the schedule was started
+ endTime:
+ type: string
+ format: date
+ description: time the schedule was stopped
\ No newline at end of file