issue-18 #28

Merged
sebastian merged 55 commits from issue-18 into master 2023-10-28 19:36:14 +02:00
9 changed files with 77 additions and 37 deletions
Showing only changes of commit e6117d1f7e - Show all commits

View File

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

View File

@ -20,6 +20,8 @@ public class TaskEntityInfo {
private boolean finished;
private int workTime;
public TaskEntityInfo(Task task) {
this.taskID = task.getTaskID();
this.taskName = task.getTaskName();
@ -28,6 +30,7 @@ public class TaskEntityInfo {
this.deadline = task.getDeadline();
this.overdue = LocalDate.now().isAfter(task.getDeadline());
this.finished = task.isFinished();
this.workTime = task.getWorkTime();
}
public long getTaskID() {
@ -85,4 +88,12 @@ public class TaskEntityInfo {
public void setFinished(boolean 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)
private Set<BasicTaskSchedule> basicTaskSchedules;
private int workTime;
public Task(Taskgroup taskgroup, String taskName, LocalDate startDate, LocalDate deadline, int eta) {
this.taskgroup = taskgroup;
this.taskName = taskName;
@ -97,6 +99,18 @@ public class Task {
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
public boolean equals(Object o) {
if (this == o) return true;

View File

@ -23,10 +23,14 @@ export interface BasicScheduleEntityInfo {
/**
* date on which the task schedule was started
*/
startTime: string;
startTime?: string;
/**
* 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
*/
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 {TaskgroupDashboardComponent} from "./taskgroups/taskgroup-dashboard/taskgroup-dashboard.component";
import {TaskDetailOverviewComponent} from "./tasks/task-detail-overview/task-detail-overview.component";
import {SchedulerComponent} from "./schedules/scheduler/scheduler.component";
const routes: Routes = [
{path: '', component: MainComponent},
@ -13,7 +14,8 @@ const routes: Routes = [
{path: 'user/settings', component: UserSettingsComponent},
{path: 'taskgroups', 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({

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 {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatExpansionModule} from "@angular/material/expansion";
import { SchedulerComponent } from './schedules/scheduler/scheduler.component';
@NgModule({
declarations: [
@ -80,7 +81,8 @@ import {MatExpansionModule} from "@angular/material/expansion";
TaskDashboardComponent,
ClearTaskDialogComponent,
NavigationLinkListComponent,
TaskDetailOverviewComponent
TaskDetailOverviewComponent,
SchedulerComponent
],
imports: [
BrowserModule,

View File

@ -14,7 +14,7 @@
</mat-card-header>
<mat-card-content>
<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-actions>
<div style="width: 100%">
@ -38,7 +38,7 @@
<mat-expansion-panel>
<mat-expansion-panel-header>Schedules</mat-expansion-panel-header>
<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>
</mat-expansion-panel>
</div>

View File

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