mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
Prettier upgrade and e2e type checks (#1522)
* upgrade prettier * noImplicitAny rule * fix type * update tsconfig * upgrade to 150 print width
This commit is contained in:
@@ -52,7 +52,7 @@ describe('AppHeaderComponent', () => {
|
||||
} as AppState;
|
||||
|
||||
beforeEach(() => {
|
||||
store.select.and.callFake(memoizeFn => {
|
||||
store.select.and.callFake((memoizeFn) => {
|
||||
return of(memoizeFn({ app }));
|
||||
});
|
||||
|
||||
@@ -60,9 +60,9 @@ describe('AppHeaderComponent', () => {
|
||||
});
|
||||
|
||||
it('should set header color, name and logo', async(() => {
|
||||
component.appName$.subscribe(val => expect(val).toBe(app.appName));
|
||||
component.logo$.subscribe(val => expect(val).toBe(app.logoPath));
|
||||
component.headerColor$.subscribe(val => expect(val).toBe(app.headerColor));
|
||||
component.appName$.subscribe((val) => expect(val).toBe(app.appName));
|
||||
component.logo$.subscribe((val) => expect(val).toBe(app.logoPath));
|
||||
component.headerColor$.subscribe((val) => expect(val).toBe(app.headerColor));
|
||||
}));
|
||||
|
||||
it('should get header actions', () => {
|
||||
|
@@ -23,24 +23,11 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
Component,
|
||||
ViewEncapsulation,
|
||||
Output,
|
||||
EventEmitter,
|
||||
OnInit,
|
||||
Input
|
||||
} from '@angular/core';
|
||||
import { Component, ViewEncapsulation, Output, EventEmitter, OnInit, Input } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import {
|
||||
AppStore,
|
||||
getHeaderColor,
|
||||
getAppName,
|
||||
getLogoPath,
|
||||
getHeaderImagePath
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { AppStore, getHeaderColor, getAppName, getLogoPath, getHeaderImagePath } from '@alfresco/aca-shared/store';
|
||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||
|
||||
@Component({
|
||||
@@ -62,19 +49,13 @@ export class AppHeaderComponent implements OnInit {
|
||||
|
||||
actions: Array<ContentActionRef> = [];
|
||||
|
||||
constructor(
|
||||
store: Store<AppStore>,
|
||||
private appExtensions: AppExtensionService
|
||||
) {
|
||||
constructor(store: Store<AppStore>, private appExtensions: AppExtensionService) {
|
||||
this.headerColor$ = store.select(getHeaderColor);
|
||||
this.appName$ = store.select(getAppName);
|
||||
this.logo$ = store.select(getLogoPath);
|
||||
|
||||
store.select(getHeaderImagePath).subscribe(path => {
|
||||
document.body.style.setProperty(
|
||||
'--header-background-image',
|
||||
`url('${path}')`
|
||||
);
|
||||
store.select(getHeaderImagePath).subscribe((path) => {
|
||||
document.body.style.setProperty('--header-background-image', `url('${path}')`);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -32,13 +32,7 @@ import { AppSearchInputModule } from '../search/search-input.module';
|
||||
import { AppToolbarModule } from '../toolbar/toolbar.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
CoreModule.forChild(),
|
||||
AppCurrentUserModule,
|
||||
AppSearchInputModule,
|
||||
AppToolbarModule
|
||||
],
|
||||
imports: [CommonModule, CoreModule.forChild(), AppCurrentUserModule, AppSearchInputModule, AppToolbarModule],
|
||||
declarations: [AppHeaderComponent],
|
||||
exports: [AppHeaderComponent]
|
||||
})
|
||||
|
Reference in New Issue
Block a user