File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 < div id ="collapsingNav ">
77 < ul class ="navbar-nav navbar-navigation mr-auto shadow-none ">
88 < li *ngIf ="(isXsOrSm$ | async) && (isAuthenticated$ | async) ">
9- < ds-user-menu [inExpandableNavbar] ="true "> </ ds-user-menu >
9+ < ds-themed- user-menu [inExpandableNavbar] ="true "> </ ds-themed -user-menu >
1010 </ li >
1111 < li *ngFor ="let section of (sections | async) ">
1212 < ng-container *ngComponentOutlet ="(sectionMap$ | async).get(section.id)?.component; injector: (sectionMap$ | async).get(section.id)?.injector; "> </ ng-container >
Original file line number Diff line number Diff line change 2222 < a href ="javascript:void(0); " role ="button " [attr.aria-label] ="'nav.user-profile-menu-and-logout' |translate " (click) ="$event.preventDefault() " [title] ="'nav.user-profile-menu-and-logout' | translate " class ="dropdownLogout px-1 " [attr.data-test] ="'user-menu' | dsBrowserOnly " ngbDropdownToggle >
2323 < i class ="fas fa-user-circle fa-lg fa-fw "> </ i > </ a >
2424 < div class ="logoutDropdownMenu " ngbDropdownMenu [attr.aria-label] ="'nav.user-profile-menu-and-logout' |translate ">
25- < ds-user-menu > </ ds-user-menu >
25+ < ds-themed- user-menu > </ ds-themed -user-menu >
2626 </ div >
2727 </ div >
2828 </ li >
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ describe('AuthNavMenuComponent', () => {
248248 component = null ;
249249 } ) ;
250250 it ( 'should render UserMenuComponent component' , ( ) => {
251- const logoutDropdownMenu = deNavMenuItem . query ( By . css ( 'ds-user-menu' ) ) ;
251+ const logoutDropdownMenu = deNavMenuItem . query ( By . css ( 'ds-themed- user-menu' ) ) ;
252252 expect ( logoutDropdownMenu . nativeElement ) . toBeDefined ( ) ;
253253 } ) ;
254254 } ) ;
Original file line number Diff line number Diff line change 1+ import { Component , Input } from '@angular/core' ;
2+ import { ThemedComponent } from '../../theme-support/themed.component' ;
3+ import { UserMenuComponent } from './user-menu.component' ;
4+
5+ /**
6+ * This component represents the user nav menu.
7+ */
8+ @Component ( {
9+ selector : 'ds-themed-user-menu' ,
10+ templateUrl : './../../theme-support/themed.component.html' ,
11+ styleUrls : [ ]
12+ } )
13+ export class ThemedUserMenuComponent extends ThemedComponent < UserMenuComponent > {
14+
15+ /**
16+ * The input flag to show user details in navbar expandable menu
17+ */
18+ @Input ( ) inExpandableNavbar : boolean ;
19+
20+ protected inAndOutputNames : ( keyof UserMenuComponent & keyof this) [ ] = [ 'inExpandableNavbar' ] ;
21+
22+ protected getComponentName ( ) : string {
23+ return 'UserMenuComponent' ;
24+ }
25+
26+ protected importThemedComponent ( themeName : string ) : Promise < any > {
27+ return import ( ( `../../../../themes/${ themeName } /app/shared/auth-nav-menu/user-menu/user-menu.component` ) ) ;
28+ }
29+
30+ protected importUnthemedComponent ( ) : Promise < any > {
31+ return import ( './user-menu.component' ) ;
32+ }
33+ }
Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ import {
281281} from '../item-page/simple/field-components/specific-field/title/themed-item-page-field.component' ;
282282import { BitstreamListItemComponent } from './object-list/bitstream-list-item/bitstream-list-item.component' ;
283283import { NgxPaginationModule } from 'ngx-pagination' ;
284+ import { ThemedUserMenuComponent } from './auth-nav-menu/user-menu/themed-user-menu.component' ;
284285import { ThemedLangSwitchComponent } from './lang-switch/themed-lang-switch.component' ;
285286
286287const MODULES = [
@@ -330,6 +331,7 @@ const COMPONENTS = [
330331 AuthNavMenuComponent ,
331332 ThemedAuthNavMenuComponent ,
332333 UserMenuComponent ,
334+ ThemedUserMenuComponent ,
333335 DsSelectComponent ,
334336 ErrorComponent ,
335337 LangSwitchComponent ,
Original file line number Diff line number Diff line change 1+ import { Component } from '@angular/core' ;
2+ import { UserMenuComponent as BaseComponent } from '../../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component' ;
3+
4+ /**
5+ * Component representing the {@link UserMenuComponent} of a page
6+ */
7+ @Component ( {
8+ selector : 'ds-user-menu' ,
9+ // templateUrl: 'user-menu.component.html',
10+ templateUrl : '../../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component.html' ,
11+ // styleUrls: ['user-menu.component.scss'],
12+ styleUrls : [ '../../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component.scss' ] ,
13+ } )
14+ export class UserMenuComponent extends BaseComponent {
15+ }
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/
156156import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component' ;
157157import { FormModule } from '../../app/shared/form/form.module' ;
158158import { RequestCopyModule } from 'src/app/request-copy/request-copy.module' ;
159+ import { UserMenuComponent } from './app/shared/auth-nav-menu/user-menu/user-menu.component' ;
159160
160161const DECLARATIONS = [
161162 FileSectionComponent ,
@@ -239,6 +240,7 @@ const DECLARATIONS = [
239240 SubmissionSectionUploadFileComponent ,
240241 ItemStatusComponent ,
241242 EditBitstreamPageComponent ,
243+ UserMenuComponent ,
242244] ;
243245
244246@NgModule ( {
You can’t perform that action at this time.
0 commit comments