Merge pull request 'issue-29' (#30) from issue-29 into master

Reviewed-on: Sebastian/TimeManager#30
This commit is contained in:
Sebastian 2023-10-29 07:13:46 +01:00
commit 836247ff73
6 changed files with 26 additions and 11 deletions

View File

@ -5,11 +5,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Load worked minutes when reloading dashboard">
<change afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/ScheduleStatus.java" afterDir="false" />
<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/ActiveMinutesInformation.java" beforeDir="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" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -107,7 +103,9 @@
<workItem from="1698298897364" duration="4242000" />
<workItem from="1698426430946" duration="665000" />
<workItem from="1698474363766" duration="3686000" />
<workItem from="1698499063683" duration="7685000" />
<workItem from="1698499063683" duration="8312000" />
<workItem from="1698557538577" duration="18000" />
<workItem from="1698557567325" duration="1724000" />
</task>
<task id="LOCAL-00001" summary="Structure Taskgroups in Hierarchies">
<option name="closed" value="true" />
@ -271,6 +269,16 @@
<line>52</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java</url>
<line>86</line>
<option name="timeStamp" value="5" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java</url>
<line>93</line>
<option name="timeStamp" value="6" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>

View File

@ -32,7 +32,7 @@ public class RecursiveTaskgroupInfo {
for(Task task : taskgroup.getActiveTasks()) {
this.activeTasks.add(new TaskOverviewInfo(task));
if(task.getDeadline().isBefore(LocalDate.now())) {
if(task.getDeadline() != null && task.getDeadline().isBefore(LocalDate.now())) {
this.hasOverdueTask = true;
}
}

View File

@ -28,7 +28,9 @@ public class TaskEntityInfo {
this.eta = task.getEta();
this.startDate = task.getStartDate();
this.deadline = task.getDeadline();
if(task.getDeadline() != null) {
this.overdue = LocalDate.now().isAfter(task.getDeadline());
}
this.finished = task.isFinished();
this.workTime = task.getWorkTime();
}

View File

@ -19,8 +19,10 @@ public class TaskOverviewInfo {
this.activeMinutes = task.getWorkTime();
this.eta = task.getEta();
this.limit = task.getDeadline();
if(task.getDeadline() != null) {
this.overdue = LocalDate.now().isAfter(task.getDeadline());
}
}
public long getTaskID() {
return taskID;

View File

@ -82,7 +82,8 @@ public class TaskScheduleService {
public ServiceResult<BasicTaskSchedule> scheduleTaskNow(Task task) {
//Check if task has already an active schedule
if(task.hasActiveSchedule()) {
ServiceResult<BasicTaskSchedule> activeSchedule = getActiveSchedule(task.getTaskgroup().getUser().getUsername());
if(task.hasActiveSchedule() || activeSchedule.getExitCode() != ServiceExitCode.MISSING_ENTITY) {
return new ServiceResult<>(ServiceExitCode.ENTITY_ALREADY_EXIST);
} else {
BasicTaskSchedule basicTaskSchedule = new BasicTaskSchedule(task, LocalDate.now());

View File

@ -72,11 +72,13 @@ export class TaskEditorComponent implements OnInit {
}
editTask() {
const startingDate = this.startDate.value.length == 0? null:this.startDate.value.length
const deadline = this.endDate.value.length == 0? null:this.endDate.value.length
this.taskService.tasksTaskIDPost(this.editorData.task!.taskID, {
taskName: this.nameCtrl.value,
eta: this.etaCtrl.value,
startDate: this.startDate.value,
deadline: this.endDate.value
startDate: startingDate,
deadline: deadline
}).subscribe({
next: resp => {
this.editorData.task!.taskName = this.nameCtrl.value;