issue-20 #46
@ -6,18 +6,10 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="ScheduleNow test with running advanced Schedule">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/AdvancedScheduleFieldInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/AdvancedScheduleFieldInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/BasicScheduleFieldInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/BasicScheduleFieldInfo.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/schedules/advanced-scheduler/advanced-scheduler.component.css" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/schedules/advanced-scheduler/advanced-scheduler.component.css" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../frontend/src/app/schedules/advanced-scheduler/advanced-scheduler.component.html" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/schedules/advanced-scheduler/advanced-scheduler.component.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../frontend/src/app/schedules/advanced-scheduler/advanced-scheduler.component.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/schedules/advanced-scheduler/advanced-scheduler.component.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../frontend/src/app/schedules/scheduler/scheduler.component.css" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/schedules/scheduler/scheduler.component.css" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../frontend/src/app/schedules/scheduler/scheduler.component.html" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/schedules/scheduler/scheduler.component.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/AdvancedScheduleInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/AdvancedScheduleInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/BasicScheduleInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/scheduleInfos/BasicScheduleInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/BasicTaskSchedule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/BasicTaskSchedule.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../frontend/src/app/schedules/scheduler/scheduler.component.ts" beforeDir="false" afterPath="$PROJECT_DIR$/../frontend/src/app/schedules/scheduler/scheduler.component.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../openapi.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../openapi.yaml" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -228,7 +220,7 @@
|
||||
<workItem from="1699473376129" duration="1423000" />
|
||||
<workItem from="1699639316405" duration="9267000" />
|
||||
<workItem from="1699684493731" duration="1121000" />
|
||||
<workItem from="1699769541677" duration="1606000" />
|
||||
<workItem from="1699769541677" duration="2562000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Structure Taskgroups in Hierarchies">
|
||||
<option name="closed" value="true" />
|
||||
|
@ -8,28 +8,28 @@ import java.util.List;
|
||||
|
||||
public class AdvancedScheduleInfo extends ScheduleInfo {
|
||||
|
||||
private LocalDateTime plannedStartTime;
|
||||
private LocalDateTime plannedStopTime;
|
||||
private LocalDateTime scheduleStartTime;
|
||||
private LocalDateTime scheduleStopTime;
|
||||
|
||||
public AdvancedScheduleInfo(long scheduleID, ScheduleType scheduleType, LocalDateTime startTime, LocalDateTime stopTime, int activeMinutes, Task task, List<TaskgroupEntityInfo> taskgroupPath, LocalDateTime plannedStartTime, LocalDateTime plannedStopTime) {
|
||||
super(scheduleID, scheduleType, startTime, stopTime, activeMinutes, task, taskgroupPath);
|
||||
this.plannedStartTime = plannedStartTime;
|
||||
this.plannedStopTime = plannedStopTime;
|
||||
this.scheduleStartTime = plannedStartTime;
|
||||
this.scheduleStopTime = plannedStopTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getPlannedStartTime() {
|
||||
return plannedStartTime;
|
||||
public LocalDateTime getScheduleStartTime() {
|
||||
return scheduleStartTime;
|
||||
}
|
||||
|
||||
public void setPlannedStartTime(LocalDateTime plannedStartTime) {
|
||||
this.plannedStartTime = plannedStartTime;
|
||||
public void setScheduleStartTime(LocalDateTime scheduleStartTime) {
|
||||
this.scheduleStartTime = scheduleStartTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getPlannedStopTime() {
|
||||
return plannedStopTime;
|
||||
public LocalDateTime getScheduleStopTime() {
|
||||
return scheduleStopTime;
|
||||
}
|
||||
|
||||
public void setPlannedStopTime(LocalDateTime plannedStopTime) {
|
||||
this.plannedStopTime = plannedStopTime;
|
||||
public void setScheduleStopTime(LocalDateTime scheduleStopTime) {
|
||||
this.scheduleStopTime = scheduleStopTime;
|
||||
}
|
||||
}
|
||||
|
@ -11,8 +11,10 @@ import java.util.List;
|
||||
public class BasicScheduleInfo extends ScheduleInfo{
|
||||
|
||||
private LocalDate scheduleDate;
|
||||
public BasicScheduleInfo(long scheduleID, ScheduleType scheduleType, LocalDateTime startTime, LocalDateTime stopTime, int activeMinutes, Task task, List<TaskgroupEntityInfo> taskgroupPath) {
|
||||
|
||||
public BasicScheduleInfo(long scheduleID, ScheduleType scheduleType, LocalDateTime startTime, LocalDateTime stopTime, int activeMinutes, Task task, List<TaskgroupEntityInfo> taskgroupPath, LocalDate scheduleDate) {
|
||||
super(scheduleID, scheduleType, startTime, stopTime, activeMinutes, task, taskgroupPath);
|
||||
this.scheduleDate = scheduleDate;
|
||||
}
|
||||
|
||||
public BasicScheduleInfo(long scheduleID) {
|
||||
|
@ -45,7 +45,7 @@ public class BasicTaskSchedule extends AbstractSchedule{
|
||||
public ScheduleInfo toScheduleInfo() {
|
||||
int activeMinutes = calcActiveMinutes();
|
||||
List<TaskgroupEntityInfo> taskgroupEntityInfos = Taskgroup.getAncestorList(task.getTaskgroup()).stream().map(TaskgroupEntityInfo::new).toList();
|
||||
return new BasicScheduleInfo(scheduleID, ScheduleType.BASIC, startTime, stopTime, activeMinutes, task, taskgroupEntityInfos);
|
||||
return new BasicScheduleInfo(scheduleID, ScheduleType.BASIC, startTime, stopTime, activeMinutes, task, taskgroupEntityInfos, scheduleDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -173,10 +173,11 @@ export class SchedulerComponent implements OnInit{
|
||||
resp.forEach(abstractSchedule => {
|
||||
if(abstractSchedule.scheduleType == 'BASIC') {
|
||||
this.handleFetchedBasicSchedule(abstractSchedule as BasicScheduleInfo)
|
||||
} else if(abstractSchedule.scheduleType == 'ADVANCED') {
|
||||
this.handleFetchedAdvancedSchedule(abstractSchedule as AdvancedScheduleInfo)
|
||||
}
|
||||
|
||||
})
|
||||
this.refresh.next();
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -194,6 +195,7 @@ export class SchedulerComponent implements OnInit{
|
||||
color: color,
|
||||
allDay: true,
|
||||
})
|
||||
this.refresh.next();
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,12 +216,17 @@ export class SchedulerComponent implements OnInit{
|
||||
return this.task!;
|
||||
}
|
||||
|
||||
findEventByTaskPath(taskPath: string) {
|
||||
return this.events.find(event => event.title == taskPath);
|
||||
findEventByTaskPath(taskPath: string, advanced: boolean) {
|
||||
const events : CalendarEvent<any>[] = this.events.filter(event => event.title == taskPath);
|
||||
if(advanced) {
|
||||
return events.find(calendarEvent => !calendarEvent.allDay)
|
||||
} else {
|
||||
return events.find(calendarEvent => calendarEvent.allDay)
|
||||
}
|
||||
}
|
||||
|
||||
eventTimesExternalChange(selectedDate: Date, start: boolean) {
|
||||
const event: CalendarEvent<any>| undefined = this.findEventByTaskPath(this.computeTaskPath(this.taskgroupPath, this.task!));
|
||||
const event: CalendarEvent<any>| undefined = this.findEventByTaskPath(this.computeTaskPath(this.taskgroupPath, this.task!), true);
|
||||
if(event == undefined) {
|
||||
if(start) {
|
||||
this.events.push({
|
||||
@ -258,7 +265,7 @@ export class SchedulerComponent implements OnInit{
|
||||
}
|
||||
|
||||
onAdvancedSchedule(schedule: AdvancedScheduleInfo) {
|
||||
const event: CalendarEvent<any>| undefined = this.findEventByTaskPath(this.computeTaskPath(schedule.taskgroupPath, schedule.task));
|
||||
const event: CalendarEvent<any>| undefined = this.findEventByTaskPath(this.computeTaskPath(schedule.taskgroupPath, schedule.task), true);
|
||||
if(event == undefined) {
|
||||
this.events.push({
|
||||
title: this.computeTaskPath(schedule.taskgroupPath, schedule.task),
|
||||
@ -278,7 +285,24 @@ export class SchedulerComponent implements OnInit{
|
||||
beforeStart: false,
|
||||
afterEnd: false
|
||||
}
|
||||
this.refresh.next();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private handleFetchedAdvancedSchedule(schedule: AdvancedScheduleInfo) {
|
||||
let color: EventColor = colors['red']
|
||||
if(schedule.scheduleID === this.scheduleID) {
|
||||
color = colors['yellow']
|
||||
}
|
||||
|
||||
this.events.push({
|
||||
start: new Date(schedule.scheduleStartTime),
|
||||
end: new Date(schedule.scheduleStopTime),
|
||||
title: this.computeTaskPath(schedule.taskgroupPath, schedule.task),
|
||||
color: color,
|
||||
allDay: false,
|
||||
})
|
||||
this.refresh.next();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user