From b9b5b50999a3e3173a97709e403c4773839116a5 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 3 May 2022 08:56:37 +0200 Subject: [PATCH 1/2] 89741: Added ThemedExpandableNavbarSectionComponent --- ...med-expandable-navbar-section.component.ts | 29 +++++++++++++++++++ src/app/navbar/navbar.module.ts | 11 +++---- 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts diff --git a/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts b/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts new file mode 100644 index 0000000000..744eeb5a02 --- /dev/null +++ b/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts @@ -0,0 +1,29 @@ +import { Component } from '@angular/core'; +import { ThemedComponent } from '../../shared/theme-support/themed.component'; +import { ExpandableNavbarSectionComponent } from './expandable-navbar-section.component'; +import { rendersSectionForMenu } from '../../shared/menu/menu-section.decorator'; +import { MenuID } from '../../shared/menu/initial-menus-state'; + +/** + * Themed wrapper for ExpandableNavbarSectionComponent + */ +@Component({ + /* tslint:disable:component-selector */ + selector: 'li[ds-themed-expandable-navbar-section]', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', +}) +@rendersSectionForMenu(MenuID.PUBLIC, true) +export class ThemedExpandableNavbarSectionComponent extends ThemedComponent { + protected getComponentName(): string { + return 'ExpandableNavbarSectionComponent'; + } + + protected importThemedComponent(themeName: string): Promise { + return import(`../../../themes/${themeName}/app/navbar/expandable-navbar-section/expandable-navbar-section.component`); + } + + protected importUnthemedComponent(): Promise { + return import(`./expandable-navbar-section.component`); + } +} diff --git a/src/app/navbar/navbar.module.ts b/src/app/navbar/navbar.module.ts index c84e732fd5..95641de41b 100644 --- a/src/app/navbar/navbar.module.ts +++ b/src/app/navbar/navbar.module.ts @@ -7,6 +7,7 @@ import { CoreModule } from '../core/core.module'; import { NavbarEffects } from './navbar.effects'; import { NavbarSectionComponent } from './navbar-section/navbar-section.component'; import { ExpandableNavbarSectionComponent } from './expandable-navbar-section/expandable-navbar-section.component'; +import { ThemedExpandableNavbarSectionComponent } from './expandable-navbar-section/themed-expandable-navbar-section.component'; import { NavbarComponent } from './navbar.component'; import { MenuModule } from '../shared/menu/menu.module'; import { SharedModule } from '../shared/shared.module'; @@ -20,7 +21,7 @@ const effects = [ const ENTRY_COMPONENTS = [ // put only entry components that use custom decorator NavbarSectionComponent, - ExpandableNavbarSectionComponent, + ThemedExpandableNavbarSectionComponent, ]; @NgModule({ @@ -36,19 +37,19 @@ const ENTRY_COMPONENTS = [ NavbarComponent, ThemedNavbarComponent, NavbarSectionComponent, - ExpandableNavbarSectionComponent + ExpandableNavbarSectionComponent, + ThemedExpandableNavbarSectionComponent, ], providers: [ ], entryComponents: [ - NavbarSectionComponent, - ExpandableNavbarSectionComponent + ...ENTRY_COMPONENTS, ], exports: [ ThemedNavbarComponent, NavbarSectionComponent, - ExpandableNavbarSectionComponent + ThemedExpandableNavbarSectionComponent, ] }) From 5c9510993ca7e3db6c34b6b811d5296f527ef3da Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Tue, 10 May 2022 20:59:04 +0200 Subject: [PATCH 2/2] 91202: Themed ExpandableNavbarSectionComponent --- .../expandable-navbar-section.component.html | 0 .../expandable-navbar-section.component.scss | 0 .../expandable-navbar-section.component.ts | 23 +++++++++++++++++++ src/themes/custom/theme.module.ts | 6 ++++- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html create mode 100644 src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss create mode 100644 src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts diff --git a/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html b/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss b/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts b/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts new file mode 100644 index 0000000000..283b9ca6f6 --- /dev/null +++ b/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts @@ -0,0 +1,23 @@ +import { Component } from '@angular/core'; +import { + ExpandableNavbarSectionComponent as BaseComponent +} from '../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component'; +import { slide } from '../../../../../app/shared/animations/slide'; +import { rendersSectionForMenu } from '../../../../../app/shared/menu/menu-section.decorator'; +import { MenuID } from '../../../../../app/shared/menu/initial-menus-state'; + +/** + * Represents an expandable section in the navbar + */ +@Component({ + /* tslint:disable:component-selector */ + selector: 'li[ds-expandable-navbar-section]', + // templateUrl: './expandable-navbar-section.component.html', + templateUrl: '../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component.html', + // styleUrls: ['./expandable-navbar-section.component.scss'], + styleUrls: ['../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss'], + animations: [slide] +}) +@rendersSectionForMenu(MenuID.PUBLIC, true) +export class ExpandableNavbarSectionComponent extends BaseComponent { +} diff --git a/src/themes/custom/theme.module.ts b/src/themes/custom/theme.module.ts index e2e97b9087..7206e6e714 100644 --- a/src/themes/custom/theme.module.ts +++ b/src/themes/custom/theme.module.ts @@ -84,6 +84,9 @@ import { SearchModule } from '../../app/shared/search/search.module'; import { ResourcePoliciesModule } from '../../app/shared/resource-policies/resource-policies.module'; import { ComcolModule } from '../../app/shared/comcol/comcol.module'; import { FeedbackComponent } from './app/info/feedback/feedback.component'; +import { + ExpandableNavbarSectionComponent +} from './app/navbar/expandable-navbar-section/expandable-navbar-section.component'; const DECLARATIONS = [ FileSectionComponent, @@ -126,7 +129,8 @@ const DECLARATIONS = [ NavbarComponent, HeaderNavbarWrapperComponent, BreadcrumbsComponent, - FeedbackComponent + FeedbackComponent, + ExpandableNavbarSectionComponent, ]; @NgModule({