fix "ng lint" command (#5012)

* update to latest js-api

* fix the "ng lint" command

* fix linting issues

* fix lint issues

* lint fixes

* code fixes

* fix html

* fix html

* update tests

* test fixes

* update tests

* fix tests and api

* fix code
This commit is contained in:
Denys Vuika
2019-08-29 16:35:30 +01:00
committed by Eugenio Romano
parent 140c64b79f
commit edc0945f39
162 changed files with 537 additions and 530 deletions

View File

@@ -41,12 +41,8 @@ class BasicButtonComponent {
download: boolean = false;
fileName: string;
format: string;
constructor() {
}
onAuditClick(event: any) {
}
onAuditClick() {}
}
describe('ProcessAuditDirective', () => {

View File

@@ -18,7 +18,7 @@
/* tslint:disable:no-input-rename */
import { ContentService } from '@alfresco/adf-core';
import { Directive, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { Directive, EventEmitter, Input, OnChanges, Output } from '@angular/core';
import { ProcessService } from './../services/process.service';
const JSON_FORMAT: string = 'json';
@@ -68,7 +68,7 @@ export class ProcessAuditDirective implements OnChanges {
private processListService: ProcessService) {
}
ngOnChanges(changes: SimpleChanges): void {
ngOnChanges(): void {
if (!this.isValidType()) {
this.setDefaultFormatType();
}

View File

@@ -109,7 +109,7 @@ describe('ProcessFiltersComponent', () => {
expect(filterList.currentFilter).toBeUndefined();
filterList.success.subscribe((res) => {
filterList.success.subscribe(() => {
filterList.selectRunningFilter();
expect(filterList.currentFilter.name).toEqual('Running');
done();

View File

@@ -7,10 +7,16 @@
<adf-process-instance-header
#processInstanceHeader
[processInstance]="processInstanceDetails"
(showProcessDiagram)="onShowProcessDiagram($event)">
(showProcessDiagram)="onShowProcessDiagram()">
</adf-process-instance-header>
<button class="adf-in-medias-res-button" mat-button id="show-diagram-button" type="button" mat-button mat-raised-button [disabled]="!isRunning()" (click)="onShowProcessDiagram(processInstanceId)">{{ 'ADF_PROCESS_LIST.DETAILS.BUTTON.SHOW_DIAGRAM' | translate }}</button>
<button
class="adf-in-medias-res-button"
mat-button id="show-diagram-button"
type="button"
mat-button mat-raised-button
[disabled]="!isRunning()"
(click)="onShowProcessDiagram()">{{ 'ADF_PROCESS_LIST.DETAILS.BUTTON.SHOW_DIAGRAM' | translate }}</button>
<mat-card>
<mat-card-content>

View File

@@ -142,7 +142,7 @@ export class ProcessInstanceDetailsComponent implements OnChanges {
}
}
onShowProcessDiagram(processInstanceId: any) {
onShowProcessDiagram() {
this.showProcessDiagram.emit({value: this.processInstanceId});
}

View File

@@ -52,7 +52,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display status as running when process is not complete', () => {
component.processInstance.ended = null;
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-status"]');
expect(valueEl.innerText).toBe('Running');
@@ -60,7 +60,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display status as completed when process is complete', () => {
component.processInstance.ended = new Date('2016-11-03');
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-status"]');
expect(valueEl.innerText).toBe('Completed');
@@ -68,7 +68,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display due date', () => {
component.processInstance.ended = new Date('2016-11-03');
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]');
expect(valueEl.innerText).toBe('Nov 3, 2016');
@@ -76,7 +76,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display placeholder if no due date', () => {
component.processInstance.ended = null;
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]');
expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.END_DATE_DEFAULT');
@@ -84,7 +84,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display process category', () => {
component.processInstance.processDefinitionCategory = 'Accounts';
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-category"]');
expect(valueEl.innerText).toBe('Accounts');
@@ -92,7 +92,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display placeholder if no process category', () => {
component.processInstance.processDefinitionCategory = null;
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-category"]');
expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.CATEGORY_DEFAULT');
@@ -100,7 +100,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display created date', () => {
component.processInstance.started = new Date('2016-11-03');
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-created"]');
expect(valueEl.innerText).toBe('Nov 3, 2016');
@@ -108,7 +108,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display started by', () => {
component.processInstance.startedBy = {firstName: 'Admin', lastName: 'User'};
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-assignee"]');
expect(valueEl.innerText).toBe('Admin User');
@@ -116,7 +116,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display process instance id', () => {
component.processInstance.id = '123';
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-id"]');
expect(valueEl.innerText).toBe('123');
@@ -124,7 +124,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display description', () => {
component.processInstance.processDefinitionDescription = 'Test process';
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]');
expect(valueEl.innerText).toBe('Test process');
@@ -132,7 +132,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display placeholder if no description', () => {
component.processInstance.processDefinitionDescription = null;
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]');
expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.DESCRIPTION_DEFAULT');
@@ -140,7 +140,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display businessKey value', () => {
component.processInstance.businessKey = 'fakeBusinessKey';
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]');
expect(valueEl.innerText).toBe('fakeBusinessKey');
@@ -148,7 +148,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should display default key if no businessKey', () => {
component.processInstance.businessKey = null;
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]');
expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.BUSINESS_KEY_DEFAULT');
@@ -162,7 +162,7 @@ describe('ProcessInstanceHeaderComponent', () => {
'properties': ['status', 'ended']
}
};
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
const propertyList = fixture.nativeElement.querySelectorAll('.adf-property-list .adf-property');
expect(propertyList).toBeDefined();
@@ -174,7 +174,7 @@ describe('ProcessInstanceHeaderComponent', () => {
it('should show all the default properties if there is no configuration', async(() => {
appConfigService.config['adf-process-instance-header'] = {};
component.ngOnChanges({});
component.ngOnChanges();
fixture.detectChanges();
fixture.whenStable().then(() => {
const propertyList = fixture.nativeElement.querySelectorAll('.adf-property-list .adf-property');

View File

@@ -16,7 +16,7 @@
*/
import { AppConfigService, CardViewDateItemModel, CardViewItem, CardViewBaseItemModel, CardViewTextItemModel, TranslationService } from '@alfresco/adf-core';
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { Component, Input, OnChanges } from '@angular/core';
import { ProcessInstance } from '../models/process-instance.model';
@Component({
@@ -40,7 +40,7 @@ export class ProcessInstanceHeaderComponent implements OnChanges {
this.dateLocale = this.appConfig.get('dateValues.defaultDateLocale');
}
ngOnChanges(changes: SimpleChanges) {
ngOnChanges() {
this.refreshData();
}

View File

@@ -13,7 +13,7 @@
<div class="menu-container" *ngIf="activeTasks?.length > 0" data-automation-id="active-tasks">
<mat-list>
<mat-list-item class="process-tasks__task-item" *ngFor="let task of activeTasks" (click)="clickTask($event, task)">
<mat-list-item class="process-tasks__task-item" *ngFor="let task of activeTasks" (click)="clickTask(task)">
<mat-icon mat-list-icon>assignment</mat-icon>
<h3 matLine>{{task.name || 'Nameless task'}}</h3>
<span matLine>
@@ -55,7 +55,7 @@
<div class="menu-container" *ngIf="completedTasks?.length > 0" data-automation-id="completed-tasks">
<mat-list>
<mat-list-item class="process-tasks__task-item" *ngFor="let task of completedTasks" (click)="clickTask($event, task)">
<mat-list-item class="process-tasks__task-item" *ngFor="let task of completedTasks" (click)="clickTask(task)">
<mat-icon mat-list-icon>assignment</mat-icon>
<h3 matLine>{{task.name || 'Nameless task'}}</h3>
<span matLine>

View File

@@ -162,7 +162,7 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges, OnDestr
}
}
clickTask($event: any, task: TaskDetailsModel) {
clickTask(task: TaskDetailsModel) {
const args = new TaskDetailsEvent(task);
this.taskClick.emit(args);
}

View File

@@ -145,7 +145,7 @@ describe('ProcessInstanceListComponent', () => {
getProcessInstancesSpy = getProcessInstancesSpy.and.returnValue(of(fakeProcessInstancesWithNoName));
component.appId = 1;
component.state = 'open';
component.success.subscribe( (res) => {
component.success.subscribe(() => {
expect(component.rows[0]['name']).toEqual('Fake Process Name - Nov 9, 2017, 12:36:14 PM');
expect(component.rows[1]['name']).toEqual('Fake Process Name - Nov 9, 2017, 12:37:25 PM');
});