[lint-refactor] simplify tslint and unify main tslint extension in sub folders (#4032)

* simplify tslint and unify main tslint extension  in sub folders

* remove autofix

* fix lint extension and process cloud
This commit is contained in:
Eugenio Romano
2018-11-29 15:04:12 +00:00
committed by GitHub
parent 49738ad555
commit 27b0ba897a
60 changed files with 141 additions and 497 deletions

View File

@@ -87,14 +87,14 @@ export class AppLayoutComponent implements OnInit {
this.expandedSidenav = expand;
}
this.headerService.hideMenu.subscribe(show => this.showMenu = show);
this.headerService.color.subscribe(color => this.color = color);
this.headerService.title.subscribe(title => this.title = title);
this.headerService.logo.subscribe(path => this.logo = path);
this.headerService.redirectUrl.subscribe(redirectUrl => this.redirectUrl = redirectUrl);
this.headerService.tooltip.subscribe(tooltip => this.tooltip = tooltip);
this.headerService.position.subscribe(position => this.position = position);
this.headerService.hideSidenav.subscribe(hideSidenav => this.hideSidenav = hideSidenav);
this.headerService.hideMenu.subscribe((show) => this.showMenu = show);
this.headerService.color.subscribe((color) => this.color = color);
this.headerService.title.subscribe((title) => this.title = title);
this.headerService.logo.subscribe((path) => this.logo = path);
this.headerService.redirectUrl.subscribe((redirectUrl) => this.redirectUrl = redirectUrl);
this.headerService.tooltip.subscribe((tooltip) => this.tooltip = tooltip);
this.headerService.position.subscribe((position) => this.position = position);
this.headerService.hideSidenav.subscribe((hideSidenav) => this.hideSidenav = hideSidenav);
}
constructor(

View File

@@ -29,7 +29,7 @@ export class FilteredDataAdapter extends ObjectDataTableAdapter {
const filter = (this.filterValue || '').trim().toLowerCase();
if (this.filterKey && filter) {
rows = rows.filter(row => {
rows = rows.filter((row) => {
const value = row.getValue(this.filterKey);
if (value !== undefined && value !== null) {
const stringValue: string = value.toString().trim().toLowerCase();
@@ -162,7 +162,7 @@ export class DataTableComponent {
icon: this._imageUrl
}
];
const rows = objects.map(obj => new ObjectDataRow(obj));
const rows = objects.map((obj) => new ObjectDataRow(obj));
this.data.setRows(rows);
}
@@ -171,7 +171,7 @@ export class DataTableComponent {
{ type: 'text', key: 'id', title: 'Id', sortable: true },
{ type: 'text', key: 'name', title: 'Name', sortable: true, cssClass: 'full-width name-column' }
];
const columns = schema.map(col => new ObjectDataColumn(col));
const columns = schema.map((col) => new ObjectDataColumn(col));
this.data.setColumns(columns);
}

View File

@@ -62,7 +62,7 @@ export class FileViewComponent implements OnInit {
}
ngOnInit() {
this.route.params.subscribe(params => {
this.route.params.subscribe((params) => {
const id = params.nodeId;
if (id) {
this.nodeApiService.getNode(id).subscribe(

View File

@@ -256,11 +256,11 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
// this.disableDragArea = false;
this.uploadService.fileUploadComplete.asObservable()
.pipe(debounceTime(300))
.subscribe(value => this.onFileUploadEvent(value));
.subscribe((value) => this.onFileUploadEvent(value));
this.uploadService.fileUploadDeleted.subscribe((value) => this.onFileUploadEvent(value));
this.contentService.folderCreated.subscribe(value => this.onFolderCreated(value));
this.onCreateFolder = this.contentService.folderCreate.subscribe(value => this.onFolderAction(value));
this.onEditFolder = this.contentService.folderEdit.subscribe(value => this.onFolderAction(value));
this.contentService.folderCreated.subscribe((value) => this.onFolderCreated(value));
this.onCreateFolder = this.contentService.folderCreate.subscribe((value) => this.onFolderAction(value));
this.onEditFolder = this.contentService.folderEdit.subscribe((value) => this.onFolderAction(value));
// this.permissionsStyle.push(new PermissionStyleModel('document-list__create', PermissionsEnum.CREATE));
// this.permissionsStyle.push(new PermissionStyleModel('document-list__disable', PermissionsEnum.NOT_CREATE, false, true));
@@ -483,7 +483,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
panelClass: 'adf-version-manager-dialog'
});
dialogRef.afterClosed().subscribe(selectedProcess => {
dialogRef.afterClosed().subscribe((selectedProcess) => {
this.processId = selectedProcess.id;
});
@@ -549,7 +549,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
minWidth: '250px'
});
dialogRef.afterClosed().subscribe(result => {
dialogRef.afterClosed().subscribe((result) => {
if (result === true) {
event.resumeUpload();
}

View File

@@ -17,6 +17,7 @@
import { Component, ViewChild } from '@angular/core';
import { FormComponent, FormModel, FormService, LogService } from '@alfresco/adf-core';
import { FormOutcomeEvent } from '../../../../../lib/core/form/components/widgets/core';
@Component({
selector: 'app-form-list',
@@ -40,9 +41,9 @@ export class FormListComponent {
constructor(private formService: FormService, private logService: LogService) {
// Prevent default outcome actions
formService.executeOutcome.subscribe(e => {
e.preventDefault();
this.logService.log(e.outcome);
formService.executeOutcome.subscribe((formOutcomeEvent: FormOutcomeEvent) => {
formOutcomeEvent.preventDefault();
this.logService.log(formOutcomeEvent.outcome);
});
}

View File

@@ -68,7 +68,7 @@ export class FormComponent implements OnInit, OnDestroy {
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}

View File

@@ -69,7 +69,7 @@ export class NotificationsComponent implements OnInit {
});
this.configForm.valueChanges
.subscribe(configFormValues =>
.subscribe((configFormValues) =>
this.setSnackBarConfig(configFormValues)
);

View File

@@ -87,7 +87,7 @@ export class ProcessListDemoComponent implements OnInit {
.pipe(
debounceTime(500)
)
.subscribe(processFilter => {
.subscribe((processFilter) => {
if (this.isFormValid()) {
this.filterProcesses(processFilter);
}

View File

@@ -34,7 +34,7 @@ export class FormNodeViewerComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.sub = this.route.params.subscribe(params => {
this.sub = this.route.params.subscribe((params) => {
this.nodeId = params['id'];
});
}

View File

@@ -18,6 +18,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { Params } from '@angular/router/src/shared';
@Component({
selector: 'app-form-viewer',
@@ -34,7 +35,7 @@ export class FormViewerComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.sub = this.route.params.subscribe(params => {
this.sub = this.route.params.subscribe((params: Params) => {
this.taskId = params['id'];
});
}

View File

@@ -62,7 +62,7 @@ export class ProcessAttachmentsComponent implements OnInit, OnChanges, OnDestroy
ngOnInit() {
this.subscriptions.push(
this.uploadService.fileUploadComplete.subscribe(
value => this.onFileUploadComplete(value.data)
(value) => this.onFileUploadComplete(value.data)
)
);
}
@@ -77,7 +77,7 @@ export class ProcessAttachmentsComponent implements OnInit, OnChanges, OnDestroy
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}

View File

@@ -185,11 +185,11 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true);
this.subscriptions.push(
formService.formLoaded.subscribe((e: FormEvent) => {
this.logService.log(`Form loaded: ${e.form.id}`);
formService.formLoaded.subscribe((formEvent: FormEvent) => {
this.logService.log(`Form loaded: ${formEvent.form.id}`);
}),
formService.formFieldValueChanged.subscribe((e: FormFieldEvent) => {
this.logService.log(`Field value changed. Form: ${e.form.id}, Field: ${e.field.id}, Value: ${e.field.value}`);
formService.formFieldValueChanged.subscribe((formFieldEvent: FormFieldEvent) => {
this.logService.log(`Field value changed. Form: ${formFieldEvent.form.id}, Field: ${formFieldEvent.field.id}, Value: ${formFieldEvent.field.value}`);
}),
this.preferenceService.select(UserPreferenceValues.PaginationSize).subscribe((pageSize) => {
this.paginationPageSize = pageSize;
@@ -205,7 +205,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
}
),
formService.formContentClicked.subscribe(content => {
formService.formContentClicked.subscribe((content) => {
this.showContentPreview(content);
}),
@@ -229,7 +229,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
}
this.showProcessTab = this.activeTab === this.tabs.processes;
this.showTaskTab = this.activeTab === this.tabs.tasks;
this.route.params.subscribe(params => {
this.route.params.subscribe((params) => {
const applicationId = params['appId'];
this.filterSelected = params['filterId'] ? { id: +params['filterId'] } : { index: 0 };
@@ -247,7 +247,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}
@@ -460,7 +460,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
}
loadStencilScriptsInPageFromProcessService() {
this.apiService.getInstance().activiti.scriptFileApi.getControllers().then(response => {
this.apiService.getInstance().activiti.scriptFileApi.getControllers().then((response) => {
if (response) {
const stencilScript = document.createElement('script');
stencilScript.type = 'text/javascript';

View File

@@ -17,6 +17,7 @@
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Params } from '@angular/router/src/shared';
@Component({
selector: 'app-show-diagram',
@@ -30,7 +31,7 @@ export class ShowDiagramComponent {
constructor(private route: ActivatedRoute,
private router: Router) {
this.route.params.subscribe(params => {
this.route.params.subscribe((params: Params) => {
this.processDefinitionId = params['processDefinitionId'];
this.appId = params['appId'];
});

View File

@@ -16,10 +16,16 @@
*/
import { Component, Input, OnChanges, OnInit, ViewChild, OnDestroy } from '@angular/core';
import { TaskListService, TaskAttachmentListComponent, TaskDetailsModel, TaskUploadService } from '@alfresco/adf-process-services';
import {
TaskListService,
TaskAttachmentListComponent,
TaskDetailsModel,
TaskUploadService
} from '@alfresco/adf-process-services';
import { UploadService, AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
import { PreviewService } from '../../services/preview.service';
import { Subscription } from 'rxjs';
import { FileUploadCompleteEvent } from '../../../../../lib/core/events/file.event';
export function taskUploadServiceFactory(api: AlfrescoApiService, config: AppConfigService) {
return new TaskUploadService(api, config);
@@ -53,12 +59,13 @@ export class TaskAttachmentsComponent implements OnInit, OnChanges, OnDestroy {
constructor(
private uploadService: UploadService,
private activitiTaskList: TaskListService,
private preview: PreviewService) {}
private preview: PreviewService) {
}
ngOnInit() {
this.subscriptions.push(
this.uploadService.fileUploadComplete.subscribe(
value => this.onFileUploadComplete(value.data)
(fileUploadCompleteEvent: FileUploadCompleteEvent) => this.onFileUploadComplete(fileUploadCompleteEvent.data)
)
);
}
@@ -73,7 +80,7 @@ export class TaskAttachmentsComponent implements OnInit, OnChanges, OnDestroy {
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}

View File

@@ -61,7 +61,7 @@ export class SearchResultComponent implements OnInit, OnDestroy {
this.isLoading = true;
}),
this.queryBuilder.executed.subscribe(data => {
this.queryBuilder.executed.subscribe((data) => {
this.queryBuilder.paging.skipCount = 0;
this.onSearchResultLoaded(data);
@@ -91,13 +91,13 @@ export class SearchResultComponent implements OnInit, OnDestroy {
}
const fields = this.config.get<string[]>('search.app:fields', ['cm:name']);
const query = fields.map(field => `${field}:"${userInput}*"`).join(' OR ');
const query = fields.map((field) => `${field}:"${userInput}*"`).join(' OR ');
return query;
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}

View File

@@ -33,7 +33,7 @@ export class SharedLinkViewComponent implements OnInit {
constructor(private route: ActivatedRoute, private router: Router) {}
ngOnInit() {
this.route.params.subscribe(params => {
this.route.params.subscribe((params) => {
this.sharedLinkId = params.id;
});
}

View File

@@ -65,7 +65,7 @@ export class TaskListCloudDemoComponent implements OnInit {
}
ngOnInit() {
this.route.params.subscribe(params => {
this.route.params.subscribe((params) => {
this.applicationName = params.applicationName;
});
@@ -95,7 +95,7 @@ export class TaskListCloudDemoComponent implements OnInit {
);
this.route.queryParams
.subscribe(params => {
.subscribe((params) => {
if (params.status) {
this.status = params.status;
this.sort = params.sort;

View File

@@ -115,7 +115,7 @@ export class TaskListDemoComponent implements OnInit {
.pipe(
debounceTime(500)
)
.subscribe(taskFilter => {
.subscribe((taskFilter) => {
if (this.isFormValid()) {
this.filterTasks(taskFilter);
}

View File

@@ -129,7 +129,7 @@ export class ThemePickerComponent {
}
private _getCurrentThemeFromHref(href: string): DocsSiteTheme {
return this.themes.find(theme => theme.href === href);
return this.themes.find((theme) => theme.href === href);
}
}

View File

@@ -38,7 +38,7 @@ export class TrashcanComponent {
) {
this.preference
.select(UserPreferenceValues.Locale)
.subscribe(locale => {
.subscribe((locale) => {
this.currentLocale = locale;
});
}