Merge branch 'master' into pionnegru-empty-state

This commit is contained in:
Denys Vuika 2017-10-20 10:24:05 +01:00 committed by GitHub
commit 0c6d930188
4 changed files with 6 additions and 50 deletions

View File

@ -2,8 +2,7 @@
<adf-toolbar-title>
<a
class="app-menu__title"
title="{{ appTitle }}"
attr.data-build-number="{{ appBuildNumber }}"
title="{{ appName }}"
[routerLink]="[ '/' ]">{{ appTitle }}</a>
</adf-toolbar-title>

View File

@ -42,16 +42,5 @@
line-height: 1;
letter-spacing: .02em;
font-weight: 400;
&:after {
content: "Build #" attr(data-build-number);
color: rgba(white, .66);
font-size: 8px;
position: absolute;
bottom: 8px;
right: 2px;
line-height: 1;
text-indent: 0;
}
}
}

View File

@ -57,33 +57,16 @@ describe('HeaderComponent', () => {
if (val === 'application.name') {
return 'app-name';
}
if (val === 'application.build') {
return 'build-nr';
}
});
fixture.detectChanges();
});
it('get application name', () => {
it('should get application name from configuration file', () => {
expect(appConfigService.get).toHaveBeenCalledWith('application.name');
});
it('it should set application name', () => {
expect(component.appName).toBe('app-name');
});
it('get application build number', () => {
expect(component.appBuildNumber).toBe('build-nr');
});
it('get application title', () => {
expect(component.appTitle).toContain('app-name');
expect(component.appTitle).toContain('build-nr');
});
it('toggle contrast', () => {
component.enhancedContrast = false;
component.toggleContrast();
expect(component.enhancedContrast).toBe(true);
});
});

View File

@ -25,25 +25,10 @@ import { AppConfigService } from 'ng2-alfresco-core';
encapsulation: ViewEncapsulation.None
})
export class HeaderComponent {
private enhancedContrast: Boolean = false;
constructor(private appConfig: AppConfigService) {}
get appName(): string {
return <string>this.appConfig.get('application.name');
}
get appBuildNumber(): string {
return <string>this.appConfig.get('application.build');
}
get appTitle(): string {
const { appName, appBuildNumber } = this;
return `${appName} (Build #${appBuildNumber})`;
}
toggleContrast() {
this.enhancedContrast = !this.enhancedContrast;
}
}