issue-106 #107

Merged
sebastian merged 18 commits from issue-106 into master 2024-03-17 09:17:11 +01:00
4 changed files with 39 additions and 1 deletions
Showing only changes of commit 8487a573a1 - Show all commits

View File

@ -29,6 +29,8 @@ public class TaskEntityInfo {
private boolean hasPlannedSchedules;
private boolean hasTaskSerie;
private boolean hasSubtasks;
private boolean hasParent;
public TaskEntityInfo(Task task) {
this.taskID = task.getTaskID();
@ -49,6 +51,8 @@ public class TaskEntityInfo {
this.hasActiveSchedules = task.hasActiveSchedule();
this.hasPlannedSchedules = task.hasPlannedSchedules();
this.hasTaskSerie = task.getTaskSerieItem() != null;
this.hasSubtasks = !task.getSubtasks().isEmpty();
this.hasParent = task.getParent() != null;
}
public long getTaskID() {
@ -146,4 +150,20 @@ public class TaskEntityInfo {
public void setHasTaskSerie(boolean hasTaskSerie) {
this.hasTaskSerie = hasTaskSerie;
}
public boolean isHasSubtasks() {
return hasSubtasks;
}
public void setHasSubtasks(boolean hasSubtasks) {
this.hasSubtasks = hasSubtasks;
}
public boolean isHasParent() {
return hasParent;
}
public void setHasParent(boolean hasParent) {
this.hasParent = hasParent;
}
}

View File

@ -60,5 +60,13 @@ export interface TaskEntityInfo {
* determines whether the task is associated with a taskserie
*/
hasTaskSerie: boolean;
/**
* determines whether a task has subtasks
*/
hasSubtasks: boolean;
/**
* determines whether a task is a top task or Not
*/
hasParent: boolean;
}

View File

@ -29,7 +29,7 @@
<button mat-flat-button class="borderless-btn" color="primary" [routerLink]="['/taskgroups', taskgroup!.taskgroupID, 'tasks', task!.taskID, 'schedule']">Schedule</button>
<button mat-flat-button class="yellowBtn" (click)="startTaskNow()">Start now</button>
<button mat-flat-button class="grayBtn" (click)="openTaskEditor()">Edit</button>
<button mat-flat-button class="lightBlueBtn" *ngIf="!task.hasTaskSerie" (click)="openRepeatingTaskEditor()">Copy</button>
<button mat-flat-button class="lightBlueBtn" *ngIf="!task.hasTaskSerie && !task.hasParent" (click)="openRepeatingTaskEditor()">Copy</button>
<button mat-flat-button class="greenBtn" *ngIf="task!.finishable" (click)="finishTask()">{{task!.finished ? 'Reopen':'Finish'}}</button>
</div>

View File

@ -2498,6 +2498,8 @@ components:
- hasActiveSchedules
- hasPlannedSchedules
- hasTaskSerie
- hasSubtasks
- hasParent
additionalProperties: false
properties:
taskID:
@ -2546,6 +2548,14 @@ components:
type: boolean
description: determines whether the task is associated with a taskserie
example: false
hasSubtasks:
type: boolean
description: determines whether a task has subtasks
example: true
hasParent:
type: boolean
description: determines whether a task is a top task or Not
example: false
TaskTaskgroupInfo:
required:
- taskID