Design TaskOverview

This commit is contained in:
Sebastian 2023-10-22 20:42:57 +02:00
parent 3fbafa0784
commit 389e6ddba5
18 changed files with 450 additions and 60 deletions

View File

@ -4,11 +4,14 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Delete and clear Tasks (Frontend)"> <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/controller/ScheduleController.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/BasicTaskScheduleEntityInfo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/core/entities/timemanager/BasicTaskSchedule.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/main/java/core/api/models/timemanager/taskSchedule/BasicTaskScheduleFieldInfo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" 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/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" />
@ -19,6 +22,7 @@
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
<list> <list>
<option value="Enum" />
<option value="Interface" /> <option value="Interface" />
<option value="Class" /> <option value="Class" />
</list> </list>
@ -44,31 +48,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">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;, "RequestMappingsPanelOrder0": "0",
&quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;, "RequestMappingsPanelOrder1": "1",
&quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;, "RequestMappingsPanelWidth0": "75",
&quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;, "RequestMappingsPanelWidth1": "75",
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, "RunOnceActivity.OpenProjectViewOnStart": "true",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;, "WebServerToolWindowFactoryState": "false",
&quot;git-widget-placeholder&quot;: &quot;issue-11-angular-update&quot;, "git-widget-placeholder": "issue-11-angular-update",
&quot;last_directory_selection&quot;: &quot;D:/Programmierprojekte/TimeManager/backend/src/main/java/core/api/models/timemanager&quot;, "last_directory_selection": "D:/Programmierprojekte/TimeManager/backend/src/main/java/core/api/models/timemanager",
&quot;last_opened_file_path&quot;: &quot;D:/Programmierprojekte/Dicewars/client&quot;, "last_opened_file_path": "D:/Programmierprojekte/Dicewars/client",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.lookFeel&quot;, "settings.editor.selected.configurable": "swagger",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "vue.rearranger.settings.migration": "true"
}, },
&quot;keyToStringList&quot;: { "keyToStringList": {
&quot;DatabaseDriversLRU&quot;: [ "DatabaseDriversLRU": [
&quot;mariadb&quot; "mariadb"
] ]
} }
}</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" />
@ -94,7 +98,8 @@
<workItem from="1697923629354" duration="3164000" /> <workItem from="1697923629354" duration="3164000" />
<workItem from="1697958018921" duration="91000" /> <workItem from="1697958018921" duration="91000" />
<workItem from="1697958118995" duration="5749000" /> <workItem from="1697958118995" duration="5749000" />
<workItem from="1697969480767" duration="6039000" /> <workItem from="1697969480767" duration="6407000" />
<workItem from="1697989716016" duration="3813000" />
</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" />
@ -136,7 +141,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1697962125518</updated> <updated>1697962125518</updated>
</task> </task>
<option name="localTasksCounter" value="6" /> <task id="LOCAL-00006" summary="Define Entity BasicTaskSchedule and Taskcontroller">
<option name="closed" value="true" />
<created>1697976314517</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1697976314517</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -149,7 +162,8 @@
<MESSAGE value="Implementing edit route for tasks" /> <MESSAGE value="Implementing edit route for tasks" />
<MESSAGE value="Delete and clear Tasks" /> <MESSAGE value="Delete and clear Tasks" />
<MESSAGE value="Delete and clear Tasks (Frontend)" /> <MESSAGE value="Delete and clear Tasks (Frontend)" />
<option name="LAST_COMMIT_MESSAGE" value="Delete and clear Tasks (Frontend)" /> <MESSAGE value="Define Entity BasicTaskSchedule and Taskcontroller" />
<option name="LAST_COMMIT_MESSAGE" value="Define Entity BasicTaskSchedule and Taskcontroller" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
@ -162,4 +176,8 @@
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
</component> </component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project> </project>

View File

@ -1,22 +1,70 @@
package core.api.controller; package core.api.controller;
import core.api.models.auth.SimpleStatusResponse;
import core.api.models.timemanager.taskSchedule.BasicTaskScheduleEntityInfo;
import core.api.models.timemanager.taskSchedule.BasicTaskScheduleFieldInfo;
import core.entities.timemanager.BasicTaskSchedule;
import core.entities.timemanager.ScheduleType; import core.entities.timemanager.ScheduleType;
import core.entities.timemanager.Task;
import core.services.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@CrossOrigin(origins = "*", maxAge = 3600) @CrossOrigin(origins = "*", maxAge = 3600)
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api")
public class ScheduleController { public class ScheduleController {
private final TaskService taskService;
private final TaskScheduleService taskScheduleService;
public ScheduleController(@Autowired TaskService taskService, @Autowired TaskScheduleService taskScheduleService) {
this.taskService = taskService;
this.taskScheduleService = taskScheduleService;
}
@GetMapping("/schedules/{taskID}/{scheduleType}") @GetMapping("/schedules/{taskID}/{scheduleType}")
public ResponseEntity<?> loadSchedulesOfTask(@PathVariable long taskID, @PathVariable ScheduleType scheduleType) { public ResponseEntity<?> loadSchedulesOfTask(@PathVariable long taskID, @PathVariable ScheduleType scheduleType) {
PermissionResult<Task> taskPermissionResult = taskService.getTaskPermissions(taskID, SecurityContextHolder.getContext().getAuthentication().getName());
if(!taskPermissionResult.isHasPermissions()) {
return ResponseEntity.status(403).body(new SimpleStatusResponse("failed"));
}
if(taskPermissionResult.getExitCode() == ServiceExitCode.MISSING_ENTITY) {
return ResponseEntity.status(404).body(new SimpleStatusResponse("failed"));
}
switch (scheduleType) {
case BASIC -> {
List<BasicTaskSchedule> basicTaskScheduleList = new ArrayList<>(taskPermissionResult.getResult().getBasicTaskSchedules());
basicTaskScheduleList.sort(Comparator.comparing(BasicTaskSchedule::getScheduleDate));
return ResponseEntity.ok(basicTaskScheduleList.stream().map(BasicTaskScheduleEntityInfo::new));
}
case ADVANCED, MODERATE -> ResponseEntity.ok(new ArrayList<>());
}
return null; return null;
} }
@PutMapping("/schedules/{taskID}") @PutMapping("/schedules/{taskID}/basic")
public ResponseEntity<?> scheduleTask(@PathVariable long taskID) { public ResponseEntity<?> basicScheduleTask(@PathVariable long taskID, @Valid @RequestBody BasicTaskScheduleFieldInfo basicTaskSchedule) {
return null; PermissionResult<Task> taskPermissionResult = taskService.getTaskPermissions(taskID, SecurityContextHolder.getContext().getAuthentication().getName());
if(!taskPermissionResult.isHasPermissions()) {
return ResponseEntity.status(403).body(new SimpleStatusResponse("failed"));
}
if(taskPermissionResult.getExitCode() == ServiceExitCode.MISSING_ENTITY) {
return ResponseEntity.status(404).body(new SimpleStatusResponse("failed"));
}
ServiceResult<BasicTaskSchedule> creationResult = taskScheduleService.createBasicTaskSchedule(taskPermissionResult.getResult(), basicTaskSchedule);
return ResponseEntity.ok(new BasicTaskScheduleEntityInfo(creationResult.getResult()));
} }
@PostMapping("/schedules/{scheduleID}/{scheduleType}") @PostMapping("/schedules/{scheduleID}/{scheduleType}")
@ -24,7 +72,7 @@ public class ScheduleController {
return null; return null;
} }
@PostMapping("/schedules/{scheduleID}/{scheduleType}") @DeleteMapping("/schedules/{scheduleID}/{scheduleType}")
public ResponseEntity<?> deleteScheduledTask(@PathVariable long scheduleID, @PathVariable ScheduleType scheduleType) { public ResponseEntity<?> deleteScheduledTask(@PathVariable long scheduleID, @PathVariable ScheduleType scheduleType) {
return null; return null;
} }

View File

@ -96,4 +96,18 @@ public class TaskController {
taskService.deleteTask(taskPermissionResult.getResult()); taskService.deleteTask(taskPermissionResult.getResult());
return ResponseEntity.ok(new SimpleStatusResponse("success")); return ResponseEntity.ok(new SimpleStatusResponse("success"));
} }
@GetMapping("/tasks/{taskID}")
public ResponseEntity<?> loadTaskDetails(@PathVariable long taskID) {
PermissionResult<Task> taskPermissionResult = taskService.getTaskPermissions(taskID, SecurityContextHolder.getContext().getAuthentication().getName());
if (!taskPermissionResult.isHasPermissions()) {
return ResponseEntity.status(403).body(new SimpleStatusResponse("failed"));
}
if (taskPermissionResult.getExitCode() == ServiceExitCode.MISSING_ENTITY) {
return ResponseEntity.status(404).body(new SimpleStatusResponse("failed"));
}
return ResponseEntity.ok(new TaskEntityInfo(taskPermissionResult.getResult()));
}
} }

View File

@ -0,0 +1,53 @@
package core.api.models.timemanager.taskSchedule;
import core.entities.timemanager.BasicTaskSchedule;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class BasicTaskScheduleEntityInfo {
private long scheduleID;
private LocalDate scheduleDate;
private LocalDateTime startTime;
private LocalDateTime finishedTime;
public BasicTaskScheduleEntityInfo(BasicTaskSchedule basicTaskSchedule) {
this.scheduleID = basicTaskSchedule.getScheduleID();
this.scheduleDate = basicTaskSchedule.getScheduleDate();
this.startTime = basicTaskSchedule.getStartTime();
this.finishedTime = basicTaskSchedule.getFinishedTime();
}
public long getScheduleID() {
return scheduleID;
}
public void setScheduleID(long scheduleID) {
this.scheduleID = scheduleID;
}
public LocalDate getScheduleDate() {
return scheduleDate;
}
public void setScheduleDate(LocalDate scheduleDate) {
this.scheduleDate = scheduleDate;
}
public LocalDateTime getStartTime() {
return startTime;
}
public void setStartTime(LocalDateTime startTime) {
this.startTime = startTime;
}
public LocalDateTime getFinishedTime() {
return finishedTime;
}
public void setFinishedTime(LocalDateTime finishedTime) {
this.finishedTime = finishedTime;
}
}

View File

@ -0,0 +1,17 @@
package core.api.models.timemanager.taskSchedule;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
public class BasicTaskScheduleFieldInfo {
@NotNull
private LocalDate scheduleDate;
public LocalDate getScheduleDate() {
return scheduleDate;
}
public void setScheduleDate(LocalDate scheduleDate) {
this.scheduleDate = scheduleDate;
}
}

View File

@ -109,4 +109,16 @@ public class Task {
public int hashCode() { public int hashCode() {
return Objects.hash(taskID); return Objects.hash(taskID);
} }
public void setTaskID(long taskID) {
this.taskID = taskID;
}
public Set<BasicTaskSchedule> getBasicTaskSchedules() {
return basicTaskSchedules;
}
public void setBasicTaskSchedules(Set<BasicTaskSchedule> basicTaskSchedules) {
this.basicTaskSchedules = basicTaskSchedules;
}
} }

View File

@ -0,0 +1,9 @@
package core.repositories.timemanager;
import core.entities.timemanager.BasicTaskSchedule;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface BasicTaskScheduleRepository extends CrudRepository<BasicTaskSchedule, Long> {
}

View File

@ -0,0 +1,30 @@
package core.services;
import core.api.models.timemanager.taskSchedule.BasicTaskScheduleFieldInfo;
import core.entities.timemanager.BasicTaskSchedule;
import core.entities.timemanager.Task;
import core.repositories.timemanager.BasicTaskScheduleRepository;
import core.repositories.timemanager.TaskRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class TaskScheduleService {
private final BasicTaskScheduleRepository basicTaskScheduleRepository;
private final TaskRepository taskRepository;
public TaskScheduleService(@Autowired BasicTaskScheduleRepository basicTaskScheduleRepository,
@Autowired TaskRepository taskRepository) {
this.basicTaskScheduleRepository = basicTaskScheduleRepository;
this.taskRepository = taskRepository;
}
public ServiceResult<BasicTaskSchedule> createBasicTaskSchedule(Task task, BasicTaskScheduleFieldInfo basicTaskScheduleFieldInfo) {
BasicTaskSchedule basicTaskSchedule = new BasicTaskSchedule(task, basicTaskScheduleFieldInfo.getScheduleDate());
task.getBasicTaskSchedules().add(basicTaskSchedule);
basicTaskScheduleRepository.save(basicTaskSchedule);
taskRepository.save(task);
return new ServiceResult<>(basicTaskSchedule);
}
}

View File

@ -5,6 +5,7 @@ api/account.service.ts
api/api.ts api/api.ts
api/login.service.ts api/login.service.ts
api/properties.service.ts api/properties.service.ts
api/schedule.service.ts
api/task.service.ts api/task.service.ts
api/taskgroup.service.ts api/taskgroup.service.ts
api/users.service.ts api/users.service.ts
@ -13,6 +14,8 @@ encoder.ts
git_push.sh git_push.sh
index.ts index.ts
model/accountDeleteRequest.ts model/accountDeleteRequest.ts
model/basicScheduleEntityInfo.ts
model/basicScheduleFieldInfo.ts
model/eMailChangeRequest.ts model/eMailChangeRequest.ts
model/inlineResponse200.ts model/inlineResponse200.ts
model/inlineResponse401.ts model/inlineResponse401.ts

View File

@ -5,6 +5,7 @@ import { HttpClient } from '@angular/common/http';
import { AccountService } from './api/account.service'; import { AccountService } from './api/account.service';
import { LoginService } from './api/login.service'; import { LoginService } from './api/login.service';
import { PropertiesService } from './api/properties.service'; import { PropertiesService } from './api/properties.service';
import { ScheduleService } from './api/schedule.service';
import { TaskService } from './api/task.service'; import { TaskService } from './api/task.service';
import { TaskgroupService } from './api/taskgroup.service'; import { TaskgroupService } from './api/taskgroup.service';
import { UsersService } from './api/users.service'; import { UsersService } from './api/users.service';

View File

@ -4,10 +4,12 @@ export * from './login.service';
import { LoginService } from './login.service'; import { LoginService } from './login.service';
export * from './properties.service'; export * from './properties.service';
import { PropertiesService } from './properties.service'; import { PropertiesService } from './properties.service';
export * from './schedule.service';
import { ScheduleService } from './schedule.service';
export * from './task.service'; export * from './task.service';
import { TaskService } from './task.service'; import { TaskService } from './task.service';
export * from './taskgroup.service'; export * from './taskgroup.service';
import { TaskgroupService } from './taskgroup.service'; import { TaskgroupService } from './taskgroup.service';
export * from './users.service'; export * from './users.service';
import { UsersService } from './users.service'; import { UsersService } from './users.service';
export const APIS = [AccountService, LoginService, PropertiesService, TaskService, TaskgroupService, UsersService]; export const APIS = [AccountService, LoginService, PropertiesService, ScheduleService, TaskService, TaskgroupService, UsersService];

View File

@ -92,14 +92,13 @@ export class TaskService {
* edits an existing task * edits an existing task
* edits an existing task * edits an existing task
* @param taskID internal id of task * @param taskID internal id of task
* @param taskFieldInfo
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress. * @param reportProgress flag to report request and response progress.
*/ */
public tasksTaskIDDelete(taskID: number, taskFieldInfo?: TaskFieldInfo, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<SimpleStatusResponse>; public tasksTaskIDDelete(taskID: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<SimpleStatusResponse>;
public tasksTaskIDDelete(taskID: number, taskFieldInfo?: TaskFieldInfo, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpResponse<SimpleStatusResponse>>; public tasksTaskIDDelete(taskID: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpResponse<SimpleStatusResponse>>;
public tasksTaskIDDelete(taskID: number, taskFieldInfo?: TaskFieldInfo, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpEvent<SimpleStatusResponse>>; public tasksTaskIDDelete(taskID: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpEvent<SimpleStatusResponse>>;
public tasksTaskIDDelete(taskID: number, taskFieldInfo?: TaskFieldInfo, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<any> { public tasksTaskIDDelete(taskID: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<any> {
if (taskID === null || taskID === undefined) { if (taskID === null || taskID === undefined) {
throw new Error('Required parameter taskID was null or undefined when calling tasksTaskIDDelete.'); throw new Error('Required parameter taskID was null or undefined when calling tasksTaskIDDelete.');
} }
@ -131,15 +130,6 @@ export class TaskService {
} }
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' = 'json'; let responseType_: 'text' | 'json' = 'json';
if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text'; responseType_ = 'text';
@ -157,6 +147,65 @@ export class TaskService {
); );
} }
/**
* gets taskdetails
* loads information about a given task
* @param taskID internal id of task
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public tasksTaskIDGet(taskID: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<TaskEntityInfo>;
public tasksTaskIDGet(taskID: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpResponse<TaskEntityInfo>>;
public tasksTaskIDGet(taskID: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpEvent<TaskEntityInfo>>;
public tasksTaskIDGet(taskID: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<any> {
if (taskID === null || taskID === undefined) {
throw new Error('Required parameter taskID was null or undefined when calling tasksTaskIDGet.');
}
let localVarHeaders = this.defaultHeaders;
let localVarCredential: string | undefined;
// authentication (API_TOKEN) required
localVarCredential = this.configuration.lookupCredential('API_TOKEN');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}
let responseType_: 'text' | 'json' = 'json';
if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
}
return this.httpClient.get<TaskEntityInfo>(`${this.configuration.basePath}/tasks/${encodeURIComponent(String(taskID))}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
}
);
}
/** /**
* edits an existing task * edits an existing task
* edits an existing task * edits an existing task

View File

@ -1,4 +1,6 @@
export * from './accountDeleteRequest'; export * from './accountDeleteRequest';
export * from './basicScheduleEntityInfo';
export * from './basicScheduleFieldInfo';
export * from './eMailChangeRequest'; export * from './eMailChangeRequest';
export * from './inlineResponse200'; export * from './inlineResponse200';
export * from './inlineResponse401'; export * from './inlineResponse401';

View File

@ -5,13 +5,15 @@ import {AdminDashboardComponent} from "./admin-dashboard/admin-dashboard.compone
import {MainComponent} from "./main/main.component"; 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";
const routes: Routes = [ const routes: Routes = [
{path: '', component: MainComponent}, {path: '', component: MainComponent},
{path: 'admin', component: AdminDashboardComponent}, {path: 'admin', component: AdminDashboardComponent},
{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}
]; ];
@NgModule({ @NgModule({

View File

@ -53,6 +53,9 @@ import {MatSortModule} from "@angular/material/sort";
import {MatPaginatorModule} from "@angular/material/paginator"; import {MatPaginatorModule} from "@angular/material/paginator";
import { ClearTaskDialogComponent } from './tasks/clear-task-dialog/clear-task-dialog.component'; import { ClearTaskDialogComponent } from './tasks/clear-task-dialog/clear-task-dialog.component';
import { NavigationLinkListComponent } from './navigation-link-list/navigation-link-list.component'; import { NavigationLinkListComponent } from './navigation-link-list/navigation-link-list.component';
import { TaskDetailOverviewComponent } from './tasks/task-detail-overview/task-detail-overview.component';
import {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatExpansionModule} from "@angular/material/expansion";
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -76,7 +79,8 @@ import { NavigationLinkListComponent } from './navigation-link-list/navigation-l
TaskEditorComponent, TaskEditorComponent,
TaskDashboardComponent, TaskDashboardComponent,
ClearTaskDialogComponent, ClearTaskDialogComponent,
NavigationLinkListComponent NavigationLinkListComponent,
TaskDetailOverviewComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
@ -107,7 +111,9 @@ import { NavigationLinkListComponent } from './navigation-link-list/navigation-l
FormsModule, FormsModule,
MatSlideToggleModule, MatSlideToggleModule,
MatSortModule, MatSortModule,
MatPaginatorModule MatPaginatorModule,
MatProgressBarModule,
MatExpansionModule
], ],
providers: [ providers: [
HttpClientModule, HttpClientModule,

View File

@ -35,3 +35,11 @@ td, th {
float: right; float: right;
margin-top: 10px; margin-top: 10px;
} }
.navLink {
text-decoration: underline;
color: black;
margin-right: 5px;
margin-left: 3px;
}

View File

@ -10,7 +10,9 @@
<table mat-table [dataSource]="datasource" matSort> <table mat-table [dataSource]="datasource" matSort>
<ng-container matColumnDef="name"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
<td mat-cell *matCellDef="let task"> {{task.taskName}} </td> <td mat-cell *matCellDef="let task">
<a class="navLink" [routerLink]="['/taskgroups', taskgroupID!, 'tasks', task.taskID]">{{task.taskName}}</a>
</td>
</ng-container> </ng-container>
<ng-container matColumnDef="eta"> <ng-container matColumnDef="eta">
<th mat-header-cell *matHeaderCellDef mat-sort-header> ETA </th> <th mat-header-cell *matHeaderCellDef mat-sort-header> ETA </th>

View File

@ -1095,11 +1095,6 @@ paths:
schema: schema:
type: number type: number
example: 1 example: 1
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TaskFieldInfo'
responses: responses:
200: 200:
description: Anfrage erfolgreich description: Anfrage erfolgreich
@ -1122,9 +1117,94 @@ paths:
schema: schema:
type: object type: object
$ref: "#/components/schemas/SimpleStatusResponse" $ref: "#/components/schemas/SimpleStatusResponse"
get:
security:
- API_TOKEN: []
tags:
- task
summary: gets taskdetails
description: loads information about a given task
parameters:
- name: taskID
in: path
description: internal id of task
required: true
schema:
type: number
example: 1
responses:
200:
description: Anfrage erfolgreich
content:
'application/json':
schema:
type: object
$ref: "#/components/schemas/TaskEntityInfo"
403:
description: No permission
content:
'application/json':
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
404:
description: Taskgroup does not exist
content:
'application/json':
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
/schedules/{taskID}/{scheduleType}:
get:
security:
- API_TOKEN: []
tags:
- schedule
description: gets schedules of task
summary: gets schedules of task
parameters:
- name: taskID
in: path
description: internal id of task
required: true
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
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/BasicScheduleEntityInfo'
403:
description: No permission
content:
'application/json':
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
404:
description: Taskgroup does not exist
content:
'application/json':
schema:
type: object
$ref: "#/components/schemas/SimpleStatusResponse"
components: components:
securitySchemes: securitySchemes:
API_TOKEN: API_TOKEN:
@ -1437,4 +1517,38 @@ components:
deadline: deadline:
type: string type: string
format: date format: date
description: date until the task has to be finished description: date until the task has to be finished
BasicScheduleEntityInfo:
required:
- scheduleID
- scheduleDate
- startTime
- finishedTime
additionalProperties: false
properties:
scheduleID:
type: number
description: internal id of schedule
example: 1
scheduleDate:
type: string
format: date
description: date on which the task is scheduled
startTime:
type: string
format: date-time
description: date on which the task schedule was started
finishedTime:
type: string
format: date-time
description: date on which the tasks schedule was finished
BasicScheduleFieldInfo:
required:
- scheduleDate
additionalProperties: false
properties:
scheduleDate:
type: string
format: date
description: date on which the task is scheduled