[ADF-3339] added test component for header (#3576)

* [ADF-3339] added test component for header

* [APM-3339] remove lint errors

* [ADF-3339] solved lint error

* [ADF-3339] removed numbers from tests
This commit is contained in:
Georgiana Roman
2018-07-17 22:21:37 +03:00
committed by Eugenio Romano
parent c63184334f
commit 9901295e25
13 changed files with 182 additions and 16 deletions

View File

@@ -2,7 +2,7 @@
<adf-sidenav-layout-header>
<ng-template let-toggleMenu="toggleMenu">
<adf-layout-header title="{{ 'APP_LAYOUT.APP_NAME' | translate}}" color="primary" (clicked)=toggleMenu($event)>
<adf-layout-header [title]="title | translate" [logo]="logo" [showSidenavToggle]="showMenu" [color]="color" (clicked)=toggleMenu($event) >
<div class="adf-app-layout-menu-spacer"></div>
@@ -43,7 +43,7 @@
</ng-template>
</adf-sidenav-layout-navigation>
<adf-sidenav-layout-content>
<adf-sidenav-layout-content >
<ng-template>
<router-outlet></router-outlet>
</ng-template>

View File

@@ -17,6 +17,8 @@
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
import { UserPreferencesService, AppConfigService, AlfrescoApiService } from '@alfresco/adf-core';
import { HeaderDataService } from '../header-data/header-data.service';
@Component({
templateUrl: 'app-layout.component.html',
@@ -35,6 +37,7 @@ export class AppLayoutComponent implements OnInit {
{ href: '/breadcrumb', icon: 'label', title: 'APP_LAYOUT.BREADCRUMB' },
{ href: '/notifications', icon: 'alarm', title: 'APP_LAYOUT.NOTIFICATIONS'},
{ href: '/card-view', icon: 'view_headline', title: 'APP_LAYOUT.CARD_VIEW'},
{ href: '/header-data', icon: 'edit', title: 'APP_LAYOUT.HEADER_DATA'},
{ href: '/node-selector', icon: 'attachment', title: 'APP_LAYOUT.NODE-SELECTOR' },
{ href: '/task-list', icon: 'assignment', title: 'APP_LAYOUT.TASK_LIST' },
{ href: '/activiti', icon: 'device_hub', title: 'APP_LAYOUT.PROCESS_SERVICES' },
@@ -58,8 +61,12 @@ export class AppLayoutComponent implements OnInit {
expandedSidenav = false;
hideSidenav = false;
showMenu = true;
enabelRedirect = true;
color = 'primary';
title = 'APP_LAYOUT.APP_NAME';
logo: string;
ngOnInit() {
const expand = this.config.get<boolean>('sideNav.expandedSidenav');
@@ -70,9 +77,18 @@ export class AppLayoutComponent implements OnInit {
} else if (expand) {
this.expandedSidenav = expand;
}
this.headerService.hideMenu.subscribe(show => this.showMenu = show);
this.headerService.color.subscribe(color => this.color = color);
this.headerService.title.subscribe(title => this.title = title);
this.headerService.logo.subscribe(path => this.logo = path);
}
constructor(private userpreference: UserPreferencesService, private config: AppConfigService, private alfrescoApiService: AlfrescoApiService) {
constructor(
private userpreference: UserPreferencesService,
private config: AppConfigService,
private alfrescoApiService: AlfrescoApiService,
private headerService: HeaderDataService) {
if (this.alfrescoApiService.getInstance().isOauthConfiguration()) {
this.enabelRedirect = false;
}
@@ -83,4 +99,4 @@ export class AppLayoutComponent implements OnInit {
this.userpreference.set('expandedSidenav', state);
}
}
}
}