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>
|
<adf-toolbar-title>
|
||||||
<a
|
<a
|
||||||
class="app-menu__title"
|
class="app-menu__title"
|
||||||
title="{{ appTitle }}"
|
title="{{ appName }}"
|
||||||
attr.data-build-number="{{ appBuildNumber }}"
|
|
||||||
[routerLink]="[ '/' ]">{{ appTitle }}</a>
|
[routerLink]="[ '/' ]">{{ appTitle }}</a>
|
||||||
</adf-toolbar-title>
|
</adf-toolbar-title>
|
||||||
|
|
||||||
|
@ -42,16 +42,5 @@
|
|||||||
line-height: 1;
|
line-height: 1;
|
||||||
letter-spacing: .02em;
|
letter-spacing: .02em;
|
||||||
font-weight: 400;
|
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') {
|
if (val === 'application.name') {
|
||||||
return 'app-name';
|
return 'app-name';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val === 'application.build') {
|
|
||||||
return 'build-nr';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fixture.detectChanges();
|
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');
|
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
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class HeaderComponent {
|
export class HeaderComponent {
|
||||||
private enhancedContrast: Boolean = false;
|
|
||||||
|
|
||||||
constructor(private appConfig: AppConfigService) {}
|
constructor(private appConfig: AppConfigService) {}
|
||||||
|
|
||||||
get appName(): string {
|
get appName(): string {
|
||||||
return <string>this.appConfig.get('application.name');
|
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