issue-106 #107

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

View File

@ -18,6 +18,7 @@ public class TaskOverviewInfo {
private boolean overdue;
private boolean finishable;
private boolean hasSubtasks;
public TaskOverviewInfo(Task task) {
this.taskID = task.getTaskID();
@ -33,6 +34,7 @@ public class TaskOverviewInfo {
this.overdue = LocalDate.now().isAfter(task.getDeadline());
}
this.finishable = task.isFinishable();
this.hasSubtasks = !task.getSubtasks().isEmpty();
}
public long getTaskID() {
@ -90,4 +92,12 @@ public class TaskOverviewInfo {
public void setFinishable(boolean finishable) {
this.finishable = finishable;
}
public boolean isHasSubtasks() {
return hasSubtasks;
}
public void setHasSubtasks(boolean hasSubtasks) {
this.hasSubtasks = hasSubtasks;
}
}

View File

@ -42,5 +42,9 @@ export interface TaskOverviewInfo {
* determines whether the task can be finished
*/
finishable: boolean;
/**
* determines whether the task has subtasks
*/
hasSubtasks: boolean;
}

View File

@ -31,3 +31,13 @@
text-decoration: none;
color: black;
}
.task-title {
display: flex;
justify-content: space-between;
}
.subtask-link {
color: #00bc8c;
text-decoration: none;
}

View File

@ -2,7 +2,10 @@
<button mat-raised-button class="greenBtn long-btn"(click)="openTaskCreation()">Add</button>
<mat-card *ngFor="let task of tasks">
<mat-card-content>
<h3><a class="task-link" [routerLink]="['/taskgroups', taskgroupID!, 'tasks', task.taskID]">{{task.taskName}}</a></h3>
<h3 class="task-title">
<a class="task-link" [routerLink]="['/taskgroups', taskgroupID!, 'tasks', task.taskID]">{{task.taskName}}</a>
<button mat-button class="subtask-link" *ngIf="task.hasSubtasks" [routerLink]="['/taskgroups', taskgroupID!, 'tasks', task.taskID]">has Subtasks</button>
</h3>
<mat-progress-bar mode="determinate" value="{{task.activeTime}}" class="progress"></mat-progress-bar>
<p class="task-info"><i>ETA: </i>{{task.activeTime}} / {{task.eta}}</p>
<p class="task-info"><i>Limit: </i>{{task.limit}}</p>

View File

@ -89,6 +89,7 @@ export class TaskOverviewComponent {
activeTime: 0,
overdue: res.overdue,
taskgroupPath: [],
hasSubtasks: false,
finishable: res.finishable
}
this.creationEmitter.emit({

View File

@ -2807,6 +2807,7 @@ components:
- overdue
- taskgroupPath
- finishable
- hasSubtasks
additionalProperties: false
properties:
taskID:
@ -2841,6 +2842,9 @@ components:
finishable:
type: boolean
description: determines whether the task can be finished
hasSubtasks:
type: boolean
description: determines whether the task has subtasks
ScheduleStatus:
required:
- activeMinutes