Hide copy function for subtasks (daily)
All checks were successful
Java CI with Maven / build-and-push-frontend (push) Successful in 8s
Java CI with Maven / build-and-push-backend (push) Successful in 8s

This commit is contained in:
Sebastian Böckelmann 2024-03-16 14:04:57 +01:00
parent 7526b6c134
commit 8487a573a1
4 changed files with 39 additions and 1 deletions

View File

@ -29,6 +29,8 @@ public class TaskEntityInfo {
private boolean hasPlannedSchedules; private boolean hasPlannedSchedules;
private boolean hasTaskSerie; private boolean hasTaskSerie;
private boolean hasSubtasks;
private boolean hasParent;
public TaskEntityInfo(Task task) { public TaskEntityInfo(Task task) {
this.taskID = task.getTaskID(); this.taskID = task.getTaskID();
@ -49,6 +51,8 @@ public class TaskEntityInfo {
this.hasActiveSchedules = task.hasActiveSchedule(); this.hasActiveSchedules = task.hasActiveSchedule();
this.hasPlannedSchedules = task.hasPlannedSchedules(); this.hasPlannedSchedules = task.hasPlannedSchedules();
this.hasTaskSerie = task.getTaskSerieItem() != null; this.hasTaskSerie = task.getTaskSerieItem() != null;
this.hasSubtasks = !task.getSubtasks().isEmpty();
this.hasParent = task.getParent() != null;
} }
public long getTaskID() { public long getTaskID() {
@ -146,4 +150,20 @@ public class TaskEntityInfo {
public void setHasTaskSerie(boolean hasTaskSerie) { public void setHasTaskSerie(boolean hasTaskSerie) {
this.hasTaskSerie = 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 * determines whether the task is associated with a taskserie
*/ */
hasTaskSerie: boolean; 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="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="yellowBtn" (click)="startTaskNow()">Start now</button>
<button mat-flat-button class="grayBtn" (click)="openTaskEditor()">Edit</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> <button mat-flat-button class="greenBtn" *ngIf="task!.finishable" (click)="finishTask()">{{task!.finished ? 'Reopen':'Finish'}}</button>
</div> </div>

View File

@ -2498,6 +2498,8 @@ components:
- hasActiveSchedules - hasActiveSchedules
- hasPlannedSchedules - hasPlannedSchedules
- hasTaskSerie - hasTaskSerie
- hasSubtasks
- hasParent
additionalProperties: false additionalProperties: false
properties: properties:
taskID: taskID:
@ -2546,6 +2548,14 @@ components:
type: boolean type: boolean
description: determines whether the task is associated with a taskserie description: determines whether the task is associated with a taskserie
example: false 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: TaskTaskgroupInfo:
required: required:
- taskID - taskID