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:
Denys Vuika
2020-07-14 10:03:23 +01:00
committed by GitHub
parent 32793ea7b0
commit ddc6f36ab4
339 changed files with 5170 additions and 8763 deletions

View File

@@ -23,12 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Input
} from '@angular/core';
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
@Component({
selector: 'aca-generic-error',

View File

@@ -26,10 +26,7 @@ import { ContentActionRef } from '@alfresco/adf-extensions';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Store } from '@ngrx/store';
import {
SetInfoDrawerStateAction,
ToggleInfoDrawerAction
} from '@alfresco/aca-shared/store';
import { SetInfoDrawerStateAction, ToggleInfoDrawerAction } from '@alfresco/aca-shared/store';
import { of, Subject } from 'rxjs';
import { InfoDrawerComponent } from './info-drawer.component';
import { LibTestingModule } from '../../testing/lib-testing-module';
@@ -64,11 +61,7 @@ describe('InfoDrawerComponent', () => {
TestBed.configureTestingModule({
imports: [LibTestingModule, SharedToolbarModule],
declarations: [InfoDrawerComponent],
providers: [
ContentApiService,
{ provide: AppExtensionService, useValue: extensionServiceMock },
{ provide: Store, useValue: storeMock }
],
providers: [ContentApiService, { provide: AppExtensionService, useValue: extensionServiceMock }, { provide: Store, useValue: storeMock }],
schemas: [NO_ERRORS_SCHEMA]
});
@@ -95,9 +88,7 @@ describe('InfoDrawerComponent', () => {
fixture.detectChanges();
component.ngOnDestroy();
expect(storeMock.dispatch).toHaveBeenCalledWith(
new SetInfoDrawerStateAction(false)
);
expect(storeMock.dispatch).toHaveBeenCalledWith(new SetInfoDrawerStateAction(false));
});
it('should set displayNode when node is library', async(() => {
@@ -174,9 +165,7 @@ describe('InfoDrawerComponent', () => {
fixture.debugElement.nativeElement.dispatchEvent(event);
expect(storeMock.dispatch).toHaveBeenCalledWith(
new ToggleInfoDrawerAction()
);
expect(storeMock.dispatch).toHaveBeenCalledWith(new ToggleInfoDrawerAction());
});
it('should show the icons from extension', () => {

View File

@@ -23,26 +23,11 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
HostListener,
Input,
OnChanges,
OnDestroy,
OnInit
} from '@angular/core';
import {
MinimalNodeEntity,
MinimalNodeEntryEntity,
SiteEntry
} from '@alfresco/js-api';
import { Component, HostListener, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
import { MinimalNodeEntity, MinimalNodeEntryEntity, SiteEntry } from '@alfresco/js-api';
import { ContentActionRef, SidebarTabRef } from '@alfresco/adf-extensions';
import { Store } from '@ngrx/store';
import {
getAppSelection,
SetInfoDrawerStateAction,
ToggleInfoDrawerAction
} from '@alfresco/aca-shared/store';
import { getAppSelection, SetInfoDrawerStateAction, ToggleInfoDrawerAction } from '@alfresco/aca-shared/store';
import { AppExtensionService } from '../../services/app.extension.service';
import { ContentApiService } from '../../services/content-api.service';
import { takeUntil } from 'rxjs/operators';
@@ -69,11 +54,7 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
this.close();
}
constructor(
private store: Store<any>,
private contentApi: ContentApiService,
private extensions: AppExtensionService
) {}
constructor(private store: Store<any>, private contentApi: ContentApiService, private extensions: AppExtensionService) {}
ngOnInit() {
this.tabs = this.extensions.getSidebarTabs();
@@ -117,7 +98,7 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
this.isLoading = true;
this.contentApi.getNodeInfo(nodeId).subscribe(
entity => {
(entity) => {
this.setDisplayNode(entity);
this.isLoading = false;
},

View File

@@ -32,14 +32,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar';
import { SharedToolbarModule } from '../tool-bar/shared-toolbar.module';
@NgModule({
imports: [
CommonModule,
InfoDrawerModule,
MatProgressBarModule,
ExtensionsModule,
ToolbarModule,
SharedToolbarModule
],
imports: [CommonModule, InfoDrawerModule, MatProgressBarModule, ExtensionsModule, ToolbarModule, SharedToolbarModule],
declarations: [InfoDrawerComponent],
exports: [InfoDrawerComponent]
})

View File

@@ -23,13 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
Input,
OnInit,
ChangeDetectionStrategy,
ViewEncapsulation
} from '@angular/core';
import { Component, Input, OnInit, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
import { NodeEntry } from '@alfresco/js-api';
@@ -60,10 +54,7 @@ export class LockedByComponent implements OnInit {
writeLockedBy() {
return (
this.node &&
this.node.entry.properties &&
this.node.entry.properties['cm:lockOwner'] &&
this.node.entry.properties['cm:lockOwner'].displayName
this.node && this.node.entry.properties && this.node.entry.properties['cm:lockOwner'] && this.node.entry.properties['cm:lockOwner'].displayName
);
}
}

View File

@@ -23,19 +23,11 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Input,
HostBinding
} from '@angular/core';
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, HostBinding } from '@angular/core';
@Component({
selector: 'aca-page-layout-content',
template: `
<ng-content></ng-content>
`,
template: `<ng-content></ng-content>`,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'aca-page-layout-content' }

View File

@@ -23,17 +23,11 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy
} from '@angular/core';
import { Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'aca-page-layout-error',
template: `
<ng-content></ng-content>
`,
template: `<ng-content></ng-content>`,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'aca-page-layout-error' }

View File

@@ -23,11 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy
} from '@angular/core';
import { Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'aca-page-layout-header',

View File

@@ -23,12 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Input
} from '@angular/core';
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
@Component({
selector: 'aca-page-layout',

View File

@@ -32,17 +32,7 @@ import { CommonModule } from '@angular/common';
@NgModule({
imports: [CommonModule],
declarations: [
PageLayoutContentComponent,
PageLayoutErrorComponent,
PageLayoutHeaderComponent,
PageLayoutComponent
],
exports: [
PageLayoutContentComponent,
PageLayoutErrorComponent,
PageLayoutHeaderComponent,
PageLayoutComponent
]
declarations: [PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutComponent],
exports: [PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutComponent]
})
export class PageLayoutModule {}

View File

@@ -34,17 +34,7 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
@NgModule({
imports: [CommonModule, CoreModule, ExtensionsModule],
declarations: [
ToolbarButtonComponent,
ToolbarActionComponent,
ToolbarMenuItemComponent,
ToolbarMenuComponent
],
exports: [
ToolbarButtonComponent,
ToolbarActionComponent,
ToolbarMenuItemComponent,
ToolbarMenuComponent
]
declarations: [ToolbarButtonComponent, ToolbarActionComponent, ToolbarMenuItemComponent, ToolbarMenuComponent],
exports: [ToolbarButtonComponent, ToolbarActionComponent, ToolbarMenuItemComponent, ToolbarMenuComponent]
})
export class SharedToolbarModule {}

View File

@@ -23,14 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Input,
DoCheck,
ChangeDetectorRef
} from '@angular/core';
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input, DoCheck, ChangeDetectorRef } from '@angular/core';
import { ContentActionRef } from '@alfresco/adf-extensions';
@Component({

View File

@@ -40,11 +40,7 @@ export class ToolbarMenuComponent {
color = '';
get hasChildren(): boolean {
return (
this.actionRef &&
this.actionRef.children &&
this.actionRef.children.length > 0
);
return this.actionRef && this.actionRef.children && this.actionRef.children.length > 0;
}
trackById(_: number, obj: { id: string }) {