Add information on workedTime, added Scheduler Component

This commit is contained in:
Sebastian 2023-10-23 15:44:46 +02:00
parent 6f5397d8f8
commit e6117d1f7e
9 changed files with 77 additions and 37 deletions

View File

@ -5,13 +5,8 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Define Entity BasicTaskSchedule and Taskcontroller"> <list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Define Entity BasicTaskSchedule and Taskcontroller">
<change afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/BasicTaskScheduleEntityInfo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/BasicTaskScheduleFieldInfo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/core/repositories/timemanager/BasicTaskScheduleRepository.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/core/services/TaskScheduleService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/tasks/TaskEntityInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/tasks/TaskEntityInfo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/api/controller/TaskController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/api/controller/TaskController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Task.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Task.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Task.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/Task.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -48,31 +43,31 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RequestMappingsPanelOrder0": "0", &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
"RequestMappingsPanelOrder1": "1", &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
"RequestMappingsPanelWidth0": "75", &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
"RequestMappingsPanelWidth1": "75", &quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
"RunOnceActivity.OpenProjectViewOnStart": "true", &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"WebServerToolWindowFactoryState": "false", &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
"git-widget-placeholder": "issue-11-angular-update", &quot;git-widget-placeholder&quot;: &quot;issue-11-angular-update&quot;,
"last_directory_selection": "D:/Programmierprojekte/TimeManager/backend/src/main/java/core/api/models/timemanager", &quot;last_directory_selection&quot;: &quot;D:/Programmierprojekte/TimeManager/backend/src/main/java/core/api/models/timemanager&quot;,
"last_opened_file_path": "D:/Programmierprojekte/Dicewars/client", &quot;last_opened_file_path&quot;: &quot;D:/Programmierprojekte/Dicewars/client&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"settings.editor.selected.configurable": "swagger", &quot;settings.editor.selected.configurable&quot;: &quot;swagger&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}, },
"keyToStringList": { &quot;keyToStringList&quot;: {
"DatabaseDriversLRU": [ &quot;DatabaseDriversLRU&quot;: [
"mariadb" &quot;mariadb&quot;
] ]
} }
}]]></component> }</component>
<component name="RunManager"> <component name="RunManager">
<configuration name="DemoApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true"> <configuration name="DemoApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<module name="demo" /> <module name="demo" />
@ -99,7 +94,8 @@
<workItem from="1697958018921" duration="91000" /> <workItem from="1697958018921" duration="91000" />
<workItem from="1697958118995" duration="5749000" /> <workItem from="1697958118995" duration="5749000" />
<workItem from="1697969480767" duration="6407000" /> <workItem from="1697969480767" duration="6407000" />
<workItem from="1697989716016" duration="3813000" /> <workItem from="1697989716016" duration="3814000" />
<workItem from="1698067098771" duration="307000" />
</task> </task>
<task id="LOCAL-00001" summary="Structure Taskgroups in Hierarchies"> <task id="LOCAL-00001" summary="Structure Taskgroups in Hierarchies">
<option name="closed" value="true" /> <option name="closed" value="true" />

View File

@ -20,6 +20,8 @@ public class TaskEntityInfo {
private boolean finished; private boolean finished;
private int workTime;
public TaskEntityInfo(Task task) { public TaskEntityInfo(Task task) {
this.taskID = task.getTaskID(); this.taskID = task.getTaskID();
this.taskName = task.getTaskName(); this.taskName = task.getTaskName();
@ -28,6 +30,7 @@ public class TaskEntityInfo {
this.deadline = task.getDeadline(); this.deadline = task.getDeadline();
this.overdue = LocalDate.now().isAfter(task.getDeadline()); this.overdue = LocalDate.now().isAfter(task.getDeadline());
this.finished = task.isFinished(); this.finished = task.isFinished();
this.workTime = task.getWorkTime();
} }
public long getTaskID() { public long getTaskID() {
@ -85,4 +88,12 @@ public class TaskEntityInfo {
public void setFinished(boolean finished) { public void setFinished(boolean finished) {
this.finished = finished; this.finished = finished;
} }
public int getWorkTime() {
return workTime;
}
public void setWorkTime(int workTime) {
this.workTime = workTime;
}
} }

View File

@ -29,6 +29,8 @@ public class Task {
@OneToMany(mappedBy = "task", cascade = CascadeType.ALL, fetch = FetchType.EAGER) @OneToMany(mappedBy = "task", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<BasicTaskSchedule> basicTaskSchedules; private Set<BasicTaskSchedule> basicTaskSchedules;
private int workTime;
public Task(Taskgroup taskgroup, String taskName, LocalDate startDate, LocalDate deadline, int eta) { public Task(Taskgroup taskgroup, String taskName, LocalDate startDate, LocalDate deadline, int eta) {
this.taskgroup = taskgroup; this.taskgroup = taskgroup;
this.taskName = taskName; this.taskName = taskName;
@ -97,6 +99,18 @@ public class Task {
this.finished = finished; this.finished = finished;
} }
public int getWorkTime() {
return workTime;
}
public void setWorkTime(int workTime) {
this.workTime = workTime;
}
public void addWorkTime(int workTime) {
this.workTime += workTime;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;

View File

@ -23,10 +23,14 @@ export interface BasicScheduleEntityInfo {
/** /**
* date on which the task schedule was started * date on which the task schedule was started
*/ */
startTime: string; startTime?: string;
/** /**
* date on which the tasks schedule was finished * date on which the tasks schedule was finished
*/ */
finishedTime: string; finishedTime?: string;
/**
* number in minutes that the schedule was active
*/
activeTime?: number;
} }

View File

@ -40,5 +40,9 @@ export interface TaskEntityInfo {
* determines whether the task is finished * determines whether the task is finished
*/ */
finished: boolean; finished: boolean;
/**
* number in minutes that was already worked on this task
*/
workTime: number;
} }

View File

@ -6,6 +6,7 @@ import {MainComponent} from "./main/main.component";
import {UserSettingsComponent} from "./user-settings/user-settings.component"; import {UserSettingsComponent} from "./user-settings/user-settings.component";
import {TaskgroupDashboardComponent} from "./taskgroups/taskgroup-dashboard/taskgroup-dashboard.component"; import {TaskgroupDashboardComponent} from "./taskgroups/taskgroup-dashboard/taskgroup-dashboard.component";
import {TaskDetailOverviewComponent} from "./tasks/task-detail-overview/task-detail-overview.component"; import {TaskDetailOverviewComponent} from "./tasks/task-detail-overview/task-detail-overview.component";
import {SchedulerComponent} from "./schedules/scheduler/scheduler.component";
const routes: Routes = [ const routes: Routes = [
{path: '', component: MainComponent}, {path: '', component: MainComponent},
@ -13,7 +14,8 @@ const routes: Routes = [
{path: 'user/settings', component: UserSettingsComponent}, {path: 'user/settings', component: UserSettingsComponent},
{path: 'taskgroups', component: TaskgroupDashboardComponent}, {path: 'taskgroups', component: TaskgroupDashboardComponent},
{path: 'taskgroups/:taskgroupID', component: TaskgroupDashboardComponent}, {path: 'taskgroups/:taskgroupID', component: TaskgroupDashboardComponent},
{path: 'taskgroups/:taskgroupID/tasks/:taskID', component: TaskDetailOverviewComponent} {path: 'taskgroups/:taskgroupID/tasks/:taskID', component: TaskDetailOverviewComponent},
{path: 'taskgroups/:taskgroupID/tasks/:taskID/schedule', component: SchedulerComponent}
]; ];
@NgModule({ @NgModule({

View File

@ -56,6 +56,7 @@ import { NavigationLinkListComponent } from './navigation-link-list/navigation-l
import { TaskDetailOverviewComponent } from './tasks/task-detail-overview/task-detail-overview.component'; import { TaskDetailOverviewComponent } from './tasks/task-detail-overview/task-detail-overview.component';
import {MatProgressBarModule} from "@angular/material/progress-bar"; import {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatExpansionModule} from "@angular/material/expansion"; import {MatExpansionModule} from "@angular/material/expansion";
import { SchedulerComponent } from './schedules/scheduler/scheduler.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -80,7 +81,8 @@ import {MatExpansionModule} from "@angular/material/expansion";
TaskDashboardComponent, TaskDashboardComponent,
ClearTaskDialogComponent, ClearTaskDialogComponent,
NavigationLinkListComponent, NavigationLinkListComponent,
TaskDetailOverviewComponent TaskDetailOverviewComponent,
SchedulerComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,

View File

@ -14,7 +14,7 @@
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<p>ETA: {{task!.eta}} Minuten - Deadline: {{task!.deadline}}</p> <p>ETA: {{task!.eta}} Minuten - Deadline: {{task!.deadline}}</p>
<mat-progress-bar [mode]="'determinate'" value="40"></mat-progress-bar> <mat-progress-bar [mode]="'determinate'" [value]="task!.workTime"></mat-progress-bar>
</mat-card-content> </mat-card-content>
<mat-card-actions> <mat-card-actions>
<div style="width: 100%"> <div style="width: 100%">
@ -38,7 +38,7 @@
<mat-expansion-panel> <mat-expansion-panel>
<mat-expansion-panel-header>Schedules</mat-expansion-panel-header> <mat-expansion-panel-header>Schedules</mat-expansion-panel-header>
<div> <div>
<button style="float: right" mat-raised-button color="primary">Add</button> <button style="float: right" mat-raised-button color="primary" [routerLink]="['/taskgroups', taskgroup!.taskgroupID, 'tasks', task!.taskID, 'schedule']">Add</button>
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
</div> </div>

View File

@ -1462,6 +1462,7 @@ components:
- deadline - deadline
- overdue - overdue
- finished - finished
- workTime
additionalProperties: false additionalProperties: false
properties: properties:
taskID: taskID:
@ -1493,6 +1494,10 @@ components:
type: boolean type: boolean
description: determines whether the task is finished description: determines whether the task is finished
example: True example: True
workTime:
type: number
description: number in minutes that was already worked on this task
example: 10
TaskFieldInfo: TaskFieldInfo:
required: required:
- taskName - taskName
@ -1522,8 +1527,6 @@ components:
required: required:
- scheduleID - scheduleID
- scheduleDate - scheduleDate
- startTime
- finishedTime
additionalProperties: false additionalProperties: false
properties: properties:
scheduleID: scheduleID:
@ -1542,6 +1545,10 @@ components:
type: string type: string
format: date-time format: date-time
description: date on which the tasks schedule was finished description: date on which the tasks schedule was finished
activeTime:
type: number
description: number in minutes that the schedule was active
example: 10
BasicScheduleFieldInfo: BasicScheduleFieldInfo:
required: required:
- scheduleDate - scheduleDate