mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
Merge branch 'master' into pionnegru-empty-state
This commit is contained in:
commit
0c6d930188
@ -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>
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user