diff --git a/src/app/shared/menu/menu-section.decorator.ts b/src/app/shared/menu/menu-section.decorator.ts
index 2aa695aabd..515ee2ff5c 100644
--- a/src/app/shared/menu/menu-section.decorator.ts
+++ b/src/app/shared/menu/menu-section.decorator.ts
@@ -1,4 +1,6 @@
+import { DEFAULT_THEME } from '../object-collection/shared/listable-object/listable-object.decorator';
import { MenuID } from './menu-id.model';
+import { hasValue } from '../empty.util';
const menuComponentMap = new Map();
@@ -8,7 +10,7 @@ const menuComponentMap = new Map();
* @param {boolean} expandable True when the section should be expandable, false when if should not
* @returns {(menuSectionWrapperComponent: GenericConstructor) => void}
*/
-export function rendersSectionForMenu(menuID: MenuID, expandable: boolean) {
+export function rendersSectionForMenu(menuID: MenuID, expandable: boolean, theme = DEFAULT_THEME) {
return function decorator(menuSectionWrapperComponent: any) {
if (!menuSectionWrapperComponent) {
return;
@@ -16,7 +18,10 @@ export function rendersSectionForMenu(menuID: MenuID, expandable: boolean) {
if (!menuComponentMap.get(menuID)) {
menuComponentMap.set(menuID, new Map());
}
- menuComponentMap.get(menuID).set(expandable, menuSectionWrapperComponent);
+ if (!menuComponentMap.get(menuID).get(expandable)) {
+ menuComponentMap.get(menuID).set(expandable, new Map());
+ }
+ menuComponentMap.get(menuID).get(expandable).set(theme, menuSectionWrapperComponent);
};
}
@@ -26,6 +31,11 @@ export function rendersSectionForMenu(menuID: MenuID, expandable: boolean) {
* @param {boolean} expandable True when the section should be expandable, false when if should not
* @returns {GenericConstructor} The constructor of the matching Component
*/
-export function getComponentForMenu(menuID: MenuID, expandable: boolean) {
- return menuComponentMap.get(menuID).get(expandable);
+export function getComponentForMenu(menuID: MenuID, expandable: boolean, theme: string) {
+ const comp = menuComponentMap.get(menuID).get(expandable).get(theme);
+ if (hasValue(comp)) {
+ return comp;
+ } else {
+ return menuComponentMap.get(menuID).get(expandable).get(DEFAULT_THEME);
+ }
}
diff --git a/src/app/shared/menu/menu.component.spec.ts b/src/app/shared/menu/menu.component.spec.ts
index 1d1fd91e7d..f0660fab4a 100644
--- a/src/app/shared/menu/menu.component.spec.ts
+++ b/src/app/shared/menu/menu.component.spec.ts
@@ -13,6 +13,8 @@ import { MenuID } from './menu-id.model';
import { Item } from '../../core/shared/item.model';
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
+import { ThemeService } from '../theme-support/theme.service';
+import { getMockThemeService } from '../mocks/theme-service.mock';
describe('MenuComponent', () => {
let comp: MenuComponent;
@@ -57,6 +59,7 @@ describe('MenuComponent', () => {
declarations: [MenuComponent],
providers: [
Injector,
+ { provide: ThemeService, useValue: getMockThemeService() },
{ provide: MenuService, useClass: MenuServiceStub },
{ provide: AuthorizationDataService, useValue: authorizationService },
{ provide: ActivatedRoute, useValue: routeStub },
diff --git a/src/app/shared/menu/menu.component.ts b/src/app/shared/menu/menu.component.ts
index 2edbd1f0e4..35e180b476 100644
--- a/src/app/shared/menu/menu.component.ts
+++ b/src/app/shared/menu/menu.component.ts
@@ -12,6 +12,7 @@ import { MenuID } from './menu-id.model';
import { ActivatedRoute } from '@angular/router';
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
+import { ThemeService } from '../theme-support/theme.service';
/**
* A basic implementation of a MenuComponent
@@ -72,7 +73,9 @@ export class MenuComponent implements OnInit, OnDestroy {
private activatedRouteLastChild: ActivatedRoute;
- constructor(protected menuService: MenuService, protected injector: Injector, public authorizationService: AuthorizationDataService, public route: ActivatedRoute) {
+ constructor(protected menuService: MenuService, protected injector: Injector, public authorizationService: AuthorizationDataService,
+ public route: ActivatedRoute, protected themeService: ThemeService
+ ) {
}
/**
@@ -215,7 +218,7 @@ export class MenuComponent implements OnInit, OnDestroy {
private getSectionComponent(section: MenuSection): Observable> {
return this.menuService.hasSubSections(this.menuID, section.id).pipe(
map((expandable: boolean) => {
- return getComponentForMenu(this.menuID, expandable);
+ return getComponentForMenu(this.menuID, expandable, this.themeService.getThemeName());
}
),
);
diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts
index 8adbcbeec3..9c7ad5f659 100644
--- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts
+++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts
@@ -128,6 +128,8 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
'context',
'viewMode',
'value',
+ 'hideBadges',
+ 'contentChange',
];
constructor(
diff --git a/src/app/shared/object-detail/object-detail.component.html b/src/app/shared/object-detail/object-detail.component.html
index 32728d92e4..824e7f3dcc 100644
--- a/src/app/shared/object-detail/object-detail.component.html
+++ b/src/app/shared/object-detail/object-detail.component.html
@@ -23,5 +23,5 @@