diff --git a/backend/.idea/workspace.xml b/backend/.idea/workspace.xml
index 956826a..5c2bae0 100644
--- a/backend/.idea/workspace.xml
+++ b/backend/.idea/workspace.xml
@@ -6,6 +6,7 @@
+
@@ -24,7 +25,7 @@
@@ -176,11 +177,11 @@
-
-
-
-
+
+
+
+
@@ -220,6 +221,7 @@
+
@@ -646,6 +648,16 @@
83
+
+ file://$PROJECT_DIR$/src/main/java/core/entities/timemanager/Taskgroup.java
+ 99
+
+
+
+ file://$PROJECT_DIR$/src/main/java/core/entities/timemanager/Taskgroup.java
+ 100
+
+
diff --git a/backend/src/main/java/core/entities/timemanager/Taskgroup.java b/backend/src/main/java/core/entities/timemanager/Taskgroup.java
index 6fc92e1..bdf42ca 100644
--- a/backend/src/main/java/core/entities/timemanager/Taskgroup.java
+++ b/backend/src/main/java/core/entities/timemanager/Taskgroup.java
@@ -92,11 +92,13 @@ public class Taskgroup {
public static List getAncestorList(Taskgroup taskgroup) {
List ancestors = new ArrayList<>();
Taskgroup currentTaskgroup = taskgroup;
+ ancestors.add(taskgroup);
while(currentTaskgroup.parent != null) {
ancestors.add(currentTaskgroup.parent);
currentTaskgroup = currentTaskgroup.parent;
}
- //ancestors.add(taskgroup);
+
+ Collections.reverse(ancestors);
return ancestors;
}
diff --git a/frontend/src/app/navigation-link-list/navigation-link-list.component.ts b/frontend/src/app/navigation-link-list/navigation-link-list.component.ts
index 8387aee..21d6d78 100644
--- a/frontend/src/app/navigation-link-list/navigation-link-list.component.ts
+++ b/frontend/src/app/navigation-link-list/navigation-link-list.component.ts
@@ -11,6 +11,11 @@ export interface NavigationLink {
styleUrls: ['./navigation-link-list.component.css']
})
export class NavigationLinkListComponent implements OnInit{
+ resetComponent(defaultNavigationLinkPath: NavigationLink[]) {
+ this.navigationLinks = defaultNavigationLinkPath;
+ console.log("Navigation Links: ")
+ console.log(this.navigationLinks)
+ }
@@ -27,7 +32,10 @@ export class NavigationLinkListComponent implements OnInit{
}
if(this.navigationLinks.find(searchedLink => searchedLink.linkText === linkText) === undefined) {
+ console.log("Test")
this.navigationLinks.push(navigationLink);
+ } else {
+ console.log(linkText)
}
}
diff --git a/frontend/src/app/taskgroups/taskgroup-dashboard/taskgroup-dashboard.component.ts b/frontend/src/app/taskgroups/taskgroup-dashboard/taskgroup-dashboard.component.ts
index 5dafbf6..79835b5 100644
--- a/frontend/src/app/taskgroups/taskgroup-dashboard/taskgroup-dashboard.component.ts
+++ b/frontend/src/app/taskgroups/taskgroup-dashboard/taskgroup-dashboard.component.ts
@@ -40,13 +40,24 @@ export class TaskgroupDashboardComponent implements OnInit {
ngOnInit(): void {
this.activatedRoute.paramMap.subscribe(params => {
if(params.has('taskgroupID')) {
+ console.log("Update of taskgroup")
this.taskgroupID = Number(params.get('taskgroupID'));
this.taskgroupService.taskgroupsTaskgroupIDGet(this.taskgroupID).subscribe({
next: resp => {
this.taskgroups = resp.children
this.taskgroupPath = resp.ancestors
this.taskgroup = resp.taskgroupInfo;
- this.navLinkListComponent!.addNavigationLink(this.taskgroup.taskgroupName, ['/taskgroups', this.taskgroup.taskgroupID.toString()])
+ this.navLinkListComponent!.resetComponent([
+ {
+ linkText: "Dashboard",
+ routerLink: ['/']
+ },
+ {
+ linkText: "Taskgroups",
+ routerLink: ["/taskgroups"]
+ }
+ ]);
+ console.log(this.taskgroups)
this.taskgroupPath.forEach(taskgroupEntity => {
this.navLinkListComponent!.addNavigationLink(taskgroupEntity.taskgroupName, ['/taskgroups', taskgroupEntity.taskgroupID.toString()]);
})
diff --git a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts
index 70061af..bacadd5 100644
--- a/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts
+++ b/frontend/src/app/tasks/task-detail-overview/task-detail-overview.component.ts
@@ -49,7 +49,16 @@ export class TaskDetailOverviewComponent implements OnInit {
this.taskgroups = resp.children
this.taskgroupPath = resp.ancestors
this.taskgroup = resp.taskgroupInfo;
- this.navLinkListComponent!.addNavigationLink(this.taskgroup.taskgroupName, ['/taskgroups', this.taskgroup.taskgroupID.toString()])
+ this.navLinkListComponent!.resetComponent([
+ {
+ linkText: "Dashboard",
+ routerLink: ['/']
+ },
+ {
+ linkText: "Taskgroups",
+ routerLink: ["/taskgroups"]
+ }
+ ]);
this.taskgroupPath.forEach(taskgroupEntity => {
this.navLinkListComponent!.addNavigationLink(taskgroupEntity.taskgroupName, ['/taskgroups', taskgroupEntity.taskgroupID.toString()]);
})