issue-68 #73
@ -11,6 +11,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -85,6 +86,10 @@ public class TaskController {
|
||||
return ResponseEntity.status(404).body(new SimpleStatusResponse("failed"));
|
||||
}
|
||||
|
||||
if(taskFieldInfo.getStartDate() == null) {
|
||||
taskFieldInfo.setStartDate(LocalDate.now());
|
||||
}
|
||||
|
||||
ServiceResult<Task> creationResult = taskService.createTask(taskgroupPermissionResult.getResult(), taskFieldInfo);
|
||||
if(creationResult.getExitCode() == ServiceExitCode.ENTITY_ALREADY_EXIST) {
|
||||
return ResponseEntity.status(409).body(new SimpleStatusResponse("failed"));
|
||||
|
@ -22,6 +22,8 @@ public class TaskEntityInfo {
|
||||
|
||||
private int workTime;
|
||||
|
||||
private boolean finishable;
|
||||
|
||||
public TaskEntityInfo(Task task) {
|
||||
this.taskID = task.getTaskID();
|
||||
this.taskName = task.getTaskName();
|
||||
@ -33,6 +35,7 @@ public class TaskEntityInfo {
|
||||
}
|
||||
this.finished = task.isFinished();
|
||||
this.workTime = task.getWorkTime();
|
||||
this.finishable = task.isFinishable();
|
||||
}
|
||||
|
||||
public long getTaskID() {
|
||||
@ -98,4 +101,12 @@ public class TaskEntityInfo {
|
||||
public void setWorkTime(int workTime) {
|
||||
this.workTime = workTime;
|
||||
}
|
||||
|
||||
public boolean isFinishable() {
|
||||
return finishable;
|
||||
}
|
||||
|
||||
public void setFinishable(boolean finishable) {
|
||||
this.finishable = finishable;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package core.api.models.timemanager.tasks;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDate;
|
||||
@ -19,6 +20,8 @@ public class TaskFieldInfo {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX")
|
||||
private LocalDate deadline;
|
||||
|
||||
private boolean finishable;
|
||||
|
||||
public TaskFieldInfo() {
|
||||
}
|
||||
|
||||
@ -60,4 +63,12 @@ public class TaskFieldInfo {
|
||||
public void setDeadline(LocalDate deadline) {
|
||||
this.deadline = deadline;
|
||||
}
|
||||
|
||||
public boolean isFinishable() {
|
||||
return finishable;
|
||||
}
|
||||
|
||||
public void setFinishable(boolean finishable) {
|
||||
this.finishable = finishable;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ public class TaskOverviewInfo {
|
||||
private LocalDate limit;
|
||||
private boolean overdue;
|
||||
|
||||
private boolean finishable;
|
||||
|
||||
public TaskOverviewInfo(Task task) {
|
||||
this.taskID = task.getTaskID();
|
||||
@ -26,6 +27,7 @@ public class TaskOverviewInfo {
|
||||
if(task.getDeadline() != null) {
|
||||
this.overdue = LocalDate.now().isAfter(task.getDeadline());
|
||||
}
|
||||
this.finishable = task.isFinishable();
|
||||
}
|
||||
|
||||
public long getTaskID() {
|
||||
@ -75,4 +77,12 @@ public class TaskOverviewInfo {
|
||||
public void setOverdue(boolean overdue) {
|
||||
this.overdue = overdue;
|
||||
}
|
||||
|
||||
public boolean isFinishable() {
|
||||
return finishable;
|
||||
}
|
||||
|
||||
public void setFinishable(boolean finishable) {
|
||||
this.finishable = finishable;
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,12 @@ public class TaskShortInfo {
|
||||
private long taskID;
|
||||
private String taskName;
|
||||
|
||||
private boolean finishable;
|
||||
|
||||
public TaskShortInfo(Task task) {
|
||||
this.taskID = task.getTaskID();
|
||||
this.taskName = task.getTaskName();
|
||||
this.finishable = task.isFinishable();
|
||||
}
|
||||
|
||||
public TaskShortInfo(long taskID, String taskName) {
|
||||
@ -32,4 +35,12 @@ public class TaskShortInfo {
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public boolean isFinishable() {
|
||||
return finishable;
|
||||
}
|
||||
|
||||
public void setFinishable(boolean finishable) {
|
||||
this.finishable = finishable;
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ public class TaskTaskgroupInfo {
|
||||
|
||||
private List<TaskgroupEntityInfo> taskgroups;
|
||||
|
||||
private boolean finishable;
|
||||
|
||||
public TaskTaskgroupInfo(Task task) {
|
||||
this.taskID = task.getTaskID();
|
||||
this.taskName = task.getTaskName();
|
||||
@ -42,6 +44,7 @@ public class TaskTaskgroupInfo {
|
||||
List<Taskgroup> taskgroupList = Taskgroup.getAncestorList(task.getTaskgroup());
|
||||
taskgroupList.add(task.getTaskgroup());
|
||||
this.taskgroups = taskgroupList.stream().map(TaskgroupEntityInfo::new).toList();
|
||||
this.finishable = task.isFinishable();
|
||||
}
|
||||
|
||||
public long getTaskID() {
|
||||
@ -115,4 +118,12 @@ public class TaskTaskgroupInfo {
|
||||
public void setTaskgroups(List<TaskgroupEntityInfo> taskgroups) {
|
||||
this.taskgroups = taskgroups;
|
||||
}
|
||||
|
||||
public boolean isFinishable() {
|
||||
return finishable;
|
||||
}
|
||||
|
||||
public void setFinishable(boolean finishable) {
|
||||
this.finishable = finishable;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package core.entities.timemanager;
|
||||
|
||||
import core.api.models.timemanager.tasks.TaskFieldInfo;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
@ -29,21 +31,25 @@ public class Task {
|
||||
|
||||
private boolean finished;
|
||||
|
||||
private boolean finishable;
|
||||
|
||||
@OneToMany(mappedBy = "task", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
private List<AbstractSchedule> basicTaskSchedules;
|
||||
|
||||
private int workTime;
|
||||
|
||||
public Task(Taskgroup taskgroup, String taskName, LocalDate startDate, LocalDate deadline, int eta) {
|
||||
this.taskgroup = taskgroup;
|
||||
this.taskName = taskName;
|
||||
this.startDate = startDate;
|
||||
this.deadline = deadline;
|
||||
this.eta = eta;
|
||||
this.finished = false;
|
||||
public Task() {
|
||||
}
|
||||
|
||||
public Task() {
|
||||
public Task(Taskgroup taskgroup, TaskFieldInfo taskFieldInfo) {
|
||||
this.taskgroup = taskgroup;
|
||||
this.taskName = taskFieldInfo.getTaskName();
|
||||
this.startDate = taskFieldInfo.getStartDate();
|
||||
this.deadline = taskFieldInfo.getDeadline();
|
||||
this.eta = taskFieldInfo.getEta();
|
||||
this.finished = false;
|
||||
this.finishable = taskFieldInfo.isFinishable();
|
||||
System.err.println(this.finishable);
|
||||
}
|
||||
|
||||
public long getTaskID() {
|
||||
@ -91,7 +97,7 @@ public class Task {
|
||||
}
|
||||
|
||||
public void finish() {
|
||||
this.finished = true;
|
||||
this.finished = !this.finished;
|
||||
}
|
||||
|
||||
public boolean isFinished() {
|
||||
@ -171,4 +177,12 @@ public class Task {
|
||||
}
|
||||
return abstractSchedules;
|
||||
}
|
||||
|
||||
public boolean isFinishable() {
|
||||
return finishable;
|
||||
}
|
||||
|
||||
public void setFinishable(boolean finishable) {
|
||||
this.finishable = finishable;
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class TaskService {
|
||||
return new ServiceResult<>(ServiceExitCode.INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
Task task = new Task(taskgroup, taskFieldInfo.getTaskName(), taskFieldInfo.getStartDate(), taskFieldInfo.getDeadline(), taskFieldInfo.getEta());
|
||||
Task task = new Task(taskgroup, taskFieldInfo);
|
||||
taskgroup.getTasks().add(task);
|
||||
taskRepository.save(task);
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (1, NULL, 0, NULL, 'Task 1', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (2, NULL, 0, NULL, 'Task 2', 2, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (3, '2022-03-20', 0, NULL, 'Task 3', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (1, NULL, 0, NULL, 'Task 1', 2, false, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (2, NULL, 0, NULL, 'Task 2', 2, true, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (3, '2022-03-20', 0, NULL, 'Task 3', 2, false, 0, true);
|
||||
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (4, '2022-03-20', 0, NULL, 'Task 4', 2, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (5, '2022-03-20', 0, '2021-03-20', 'Task 5', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (6, '2022-03-20', 0, '2021-03-20', 'Task 6', 2, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (4, '2022-03-20', 0, NULL, 'Task 4', 2, true, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (5, '2022-03-20', 0, '2021-03-20', 'Task 5', 2, false, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (6, '2022-03-20', 0, '2021-03-20', 'Task 6', 2, true, 0, true);
|
||||
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (7, NULL, 0, '2043-03-20', 'Task 6', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (8, NULL, 0, '2043-03-20', 'Task 6', 2, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (9, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (10, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (7, NULL, 0, '2043-03-20', 'Task 6', 2, false, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (8, NULL, 0, '2043-03-20', 'Task 6', 2, true, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (9, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, false, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (10, '2044-03-20', 0, '2043-03-20', 'Task 6', 2, true, 0, true);
|
||||
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (11, NULL, 0, '2022-03-20', 'Task 6', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (12, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (11, NULL, 0, '2022-03-20', 'Task 6', 2, false, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (12, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, false, 0, true);
|
||||
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (13, NULL, 0, '2022-03-20', 'Task 6', 2, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (14, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (15, NULL, 0, NULL, 'Task 15', 2, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (13, NULL, 0, '2022-03-20', 'Task 6', 2, true, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (14, '2044-03-20', 0, '2022-03-20', 'Task 6', 2, true, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (15, NULL, 0, NULL, 'Task 15', 2, false, 0, true);
|
||||
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (16, NULL, 0, NULL, 'Task 15', 9, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (17, NULL, 0, NULL, 'Task 17', 9, false, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time) VALUES (18, NULL, 0, NULL, 'Task 17', 10, true, 0);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (16, NULL, 0, NULL, 'Task 15', 9, false, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (17, NULL, 0, NULL, 'Task 17', 9, false, 0, true);
|
||||
INSERT INTO tasks (taskid, deadline, eta, start_date, task_name, taskgroup_id, finished, work_time, finishable) VALUES (18, NULL, 0, NULL, 'Task 17', 10, true, 0, true);
|
@ -44,5 +44,9 @@ export interface TaskEntityInfo {
|
||||
* number in minutes that was already worked on this task
|
||||
*/
|
||||
workTime: number;
|
||||
/**
|
||||
* determines whether the task can be finished
|
||||
*/
|
||||
finishable: boolean;
|
||||
}
|
||||
|
||||
|
@ -23,10 +23,14 @@ export interface TaskFieldInfo {
|
||||
/**
|
||||
* date from which the task can be started
|
||||
*/
|
||||
startDate: string;
|
||||
startDate?: string;
|
||||
/**
|
||||
* date until the task has to be finished
|
||||
*/
|
||||
deadline: string;
|
||||
deadline?: string;
|
||||
/**
|
||||
* determines whether the task can be finished
|
||||
*/
|
||||
finishable: boolean;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@ -12,7 +12,7 @@
|
||||
import { TaskgroupEntityInfo } from './taskgroupEntityInfo';
|
||||
|
||||
|
||||
export interface TaskOverviewInfo {
|
||||
export interface TaskOverviewInfo {
|
||||
/**
|
||||
* internal id of task
|
||||
*/
|
||||
@ -37,5 +37,10 @@ export interface TaskOverviewInfo {
|
||||
* number in minutes that was already worked on this task
|
||||
*/
|
||||
activeTime?: number;
|
||||
taskgroupPath: Array<TaskgroupEntityInfo>;
|
||||
/**
|
||||
* determines whether the task can be finished
|
||||
*/
|
||||
finishable: boolean;
|
||||
}
|
||||
|
||||
|
@ -20,5 +20,9 @@ export interface TaskShortInfo {
|
||||
* name of task
|
||||
*/
|
||||
taskName: string;
|
||||
/**
|
||||
* determines whether the task can be finished
|
||||
*/
|
||||
finishable: boolean;
|
||||
}
|
||||
|
||||
|
@ -46,5 +46,9 @@ export interface TaskTaskgroupInfo {
|
||||
*/
|
||||
workTime: number;
|
||||
taskgroups: Array<TaskgroupEntityInfo>;
|
||||
/**
|
||||
* determines whether the task can be finished
|
||||
*/
|
||||
finishable: boolean;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,6 @@
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button class="grayBtn" (click)="stopTask(false)">Stop</button>
|
||||
<button mat-raised-button class="greenBtn" (click)="stopTask(true)">Finish</button>
|
||||
<button mat-raised-button class="greenBtn" *ngIf="activeSchedule!.task.finishable" (click)="stopTask(true)">Finish</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button color="primary" class="btn-without-radius" (click)="startTaskNow(task)">Start now</button>
|
||||
<button *ngIf="taskgroupID != undefined" mat-raised-button class="yellowBtn btn-without-radius" [routerLink]="['/taskgroups', taskgroupID!, 'tasks', task.taskID, 'schedule']">Schedule</button>
|
||||
<button mat-raised-button class="greenBtn btn-without-radius" (click)="finishTask(task)">Finish</button>
|
||||
<button *ngIf="task.finishable" mat-raised-button class="greenBtn btn-without-radius" (click)="finishTask(task)">Finish</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
|
@ -80,13 +80,15 @@ export class TaskOverviewComponent {
|
||||
const dialogRef = this.dialog.open(TaskEditorComponent, {data: editorData, width: "600px"})
|
||||
dialogRef.afterClosed().subscribe(res => {
|
||||
if(res != undefined) {
|
||||
const taskOverviewInfo = {
|
||||
const taskOverviewInfo: TaskOverviewInfo = {
|
||||
taskID: res.taskID,
|
||||
eta: res.eta,
|
||||
limit: res.deadline,
|
||||
taskName: res.taskName,
|
||||
activeTime: 0,
|
||||
overdue: res.overdue
|
||||
overdue: res.overdue,
|
||||
taskgroupPath: [],
|
||||
finishable: res.finishable
|
||||
}
|
||||
this.creationEmitter.emit({
|
||||
task: taskOverviewInfo,
|
||||
|
@ -23,7 +23,7 @@
|
||||
<button mat-flat-button class="yellowBtn" (click)="startTaskNow()">Start now</button>
|
||||
<button mat-flat-button class="grayBtn" (click)="openTaskEditor()">Edit</button>
|
||||
<!--<button mat-raised-button>Copy</button>-->
|
||||
<button mat-flat-button class="greenBtn" >Finished</button>
|
||||
<button mat-flat-button class="greenBtn" *ngIf="task!.finishable" (click)="finishTask()">{{task!.finished ? 'Reopen':'Finish'}}</button>
|
||||
</div>
|
||||
|
||||
<div style="float:right;">
|
||||
|
@ -101,4 +101,12 @@ export class TaskDetailOverviewComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
finishTask() {
|
||||
this.taskService.tasksTaskIDFinishPost(this.task!.taskID).subscribe({
|
||||
next: resp => {
|
||||
this.task!.finished = !this.task!.finished;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,8 @@
|
||||
<mat-datepicker-toggle matIconSuffix [for]="deadlinepicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #deadlinepicker></mat-datepicker>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-slide-toggle [(ngModel)]="finishable">Finishable</mat-slide-toggle>
|
||||
</div>
|
||||
|
||||
<div mat-dialog-actions align="end">
|
||||
|
@ -20,6 +20,8 @@ export class TaskEditorComponent implements OnInit {
|
||||
nameCtrl: FormControl = new FormControl('', [Validators.required, Validators.maxLength(255)])
|
||||
etaCtrl: FormControl = new FormControl(0, [Validators.required, Validators.min(0)])
|
||||
startDate: FormControl = new FormControl(Date.now(), [Validators.required])
|
||||
|
||||
finishable: boolean = true;
|
||||
endDate: FormControl = new FormControl('');
|
||||
constructor(private dialog: MatDialogRef<TaskEditorComponent>,
|
||||
private taskService: TaskService,
|
||||
@ -49,13 +51,21 @@ export class TaskEditorComponent implements OnInit {
|
||||
}
|
||||
|
||||
createTask() {
|
||||
console.log(this.startDate.value)
|
||||
console.log(this.endDate.value)
|
||||
let endDate_formatted: string|undefined = undefined;
|
||||
let startDate_formatted: string|undefined = undefined;
|
||||
if(this.endDate.value.length > 0) {
|
||||
endDate_formatted = moment(this.endDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
|
||||
}
|
||||
|
||||
if(this.startDate.value.length > 0) {
|
||||
startDate_formatted = moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
|
||||
}
|
||||
this.taskService.tasksTaskgroupIDPut(this.editorData.taskgroupID, {
|
||||
taskName: this.nameCtrl.value,
|
||||
eta: this.etaCtrl.value,
|
||||
startDate: moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ'),
|
||||
deadline: moment(this.endDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ')
|
||||
startDate: startDate_formatted,
|
||||
deadline: endDate_formatted,
|
||||
finishable: this.finishable
|
||||
}).subscribe({
|
||||
next: resp => {
|
||||
this.dialog.close(resp);
|
||||
@ -81,7 +91,8 @@ export class TaskEditorComponent implements OnInit {
|
||||
taskName: this.nameCtrl.value,
|
||||
eta: this.etaCtrl.value,
|
||||
startDate: startingDate,
|
||||
deadline: deadline
|
||||
deadline: deadline,
|
||||
finishable: this.finishable
|
||||
}).subscribe({
|
||||
next: resp => {
|
||||
this.editorData.task!.taskName = this.nameCtrl.value;
|
||||
|
22
openapi.yaml
22
openapi.yaml
@ -2147,6 +2147,7 @@ components:
|
||||
- overdue
|
||||
- finished
|
||||
- workTime
|
||||
- finishable
|
||||
additionalProperties: false
|
||||
properties:
|
||||
taskID:
|
||||
@ -2182,6 +2183,9 @@ components:
|
||||
type: number
|
||||
description: number in minutes that was already worked on this task
|
||||
example: 10
|
||||
finishable:
|
||||
type: boolean
|
||||
description: determines whether the task can be finished
|
||||
TaskTaskgroupInfo:
|
||||
required:
|
||||
- taskID
|
||||
@ -2193,6 +2197,7 @@ components:
|
||||
- finished
|
||||
- workTime
|
||||
- taskgroups
|
||||
- finishable
|
||||
additionalProperties: false
|
||||
properties:
|
||||
taskID:
|
||||
@ -2232,12 +2237,14 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskgroupEntityInfo'
|
||||
finishable:
|
||||
type: boolean
|
||||
description: determines whether the task can be finished
|
||||
TaskFieldInfo:
|
||||
required:
|
||||
- taskName
|
||||
- eta
|
||||
- startDate
|
||||
- deadline
|
||||
- finishable
|
||||
additionalProperties: false
|
||||
properties:
|
||||
taskName:
|
||||
@ -2257,6 +2264,9 @@ components:
|
||||
type: string
|
||||
format: date
|
||||
description: date until the task has to be finished
|
||||
finishable:
|
||||
type: boolean
|
||||
description: determines whether the task can be finished
|
||||
BasicScheduleEntityInfo:
|
||||
required:
|
||||
- scheduleID
|
||||
@ -2349,6 +2359,7 @@ components:
|
||||
required:
|
||||
- taskID
|
||||
- taskName
|
||||
- finishable
|
||||
additionalProperties: false
|
||||
properties:
|
||||
taskID:
|
||||
@ -2359,6 +2370,9 @@ components:
|
||||
type: string
|
||||
description: name of task
|
||||
example: "Vorlesung zusammenfassen"
|
||||
finishable:
|
||||
type: boolean
|
||||
description: determines whether the task can be finished
|
||||
ScheduleActivateInfo:
|
||||
required:
|
||||
- startTime
|
||||
@ -2422,6 +2436,7 @@ components:
|
||||
- limit
|
||||
- overdue
|
||||
- taskgroupPath
|
||||
- finishable
|
||||
additionalProperties: false
|
||||
properties:
|
||||
taskID:
|
||||
@ -2453,6 +2468,9 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/TaskgroupEntityInfo'
|
||||
finishable:
|
||||
type: boolean
|
||||
description: determines whether the task can be finished
|
||||
ScheduleStatus:
|
||||
required:
|
||||
- activeMinutes
|
||||
|
Loading…
Reference in New Issue
Block a user