diff --git a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html
index 23f5a958d2..3edb01d621 100644
--- a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html
+++ b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.html
@@ -1,4 +1,4 @@
-
diff --git a/src/app/community-page/community-page.component.html b/src/app/community-page/community-page.component.html
index 6d5262d933..671bf28fd1 100644
--- a/src/app/community-page/community-page.component.html
+++ b/src/app/community-page/community-page.component.html
@@ -21,9 +21,6 @@
-
-
-
diff --git a/src/app/init.service.ts b/src/app/init.service.ts
index cf10f3e1c3..ce4055ebde 100644
--- a/src/app/init.service.ts
+++ b/src/app/init.service.ts
@@ -191,11 +191,7 @@ export abstract class InitService {
this.breadcrumbsService.listenForRouteChanges();
this.themeService.listenForRouteChanges();
// this.menuService.listenForRouteChanges();
- this.menuProviderService.listenForRouteChanges().subscribe((done) => {
- Object.values(MenuID).forEach((menuID) => {
- this.menuService.buildRouteMenuSections(menuID);
- });
- })
+ this.menuProviderService.listenForRouteChanges();
}
protected initPersistentMenus(): void {
diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html
index b502326164..61ca511674 100644
--- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html
+++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html
@@ -1,22 +1,24 @@
-
-
-
-
-
-
+
diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts
index 6f05eb0e54..b56a29f115 100644
--- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts
+++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts
@@ -3,10 +3,12 @@ import { MenuSection } from '../../shared/menu/menu-section.model';
import { NavbarSectionComponent } from '../navbar-section/navbar-section.component';
import { MenuService } from '../../shared/menu/menu.service';
import { slide } from '../../shared/animations/slide';
-import { first } from 'rxjs/operators';
+import { first, map } from 'rxjs/operators';
import { HostWindowService } from '../../shared/host-window.service';
import { rendersSectionForMenu } from '../../shared/menu/menu-section.decorator';
import { MenuID } from '../../shared/menu/menu-id.model';
+import { Observable } from 'rxjs';
+import { isNotEmpty } from '../../shared/empty.util';
/**
* Represents an expandable section in the navbar
@@ -24,6 +26,11 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
*/
menuID = MenuID.PUBLIC;
+ /**
+ * Emits true when the top section has subsections, else emits false
+ */
+ hasSubSections$: Observable;
+
constructor(
@Inject('sectionDataProvider') protected section: MenuSection,
protected menuService: MenuService,
@@ -35,6 +42,9 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
ngOnInit() {
super.ngOnInit();
+ this.hasSubSections$ = this.subSections$.pipe(
+ map((subSections) => isNotEmpty(subSections))
+ );
}
/**
diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.html b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.html
index cb725e7d70..9c8c97ca6b 100644
--- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.html
+++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.html
@@ -1,4 +1,4 @@
-