tslint arrow-parens rule (#4003)

This commit is contained in:
Eugenio Romano
2018-11-23 01:06:56 +00:00
committed by GitHub
parent 51bb6a420f
commit 34a30c0f14
194 changed files with 725 additions and 723 deletions
+5 -5
View File
@@ -39,7 +39,7 @@ export class AppsProcessService {
return from(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
.pipe(
map((response: any) => <AppDefinitionRepresentation[]> response.data),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -51,8 +51,8 @@ export class AppsProcessService {
getDeployedApplicationsByName(name: string): Observable<AppDefinitionRepresentation> {
return from(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
.pipe(
map((response: any) => <AppDefinitionRepresentation> response.data.find(app => app.name === name)),
catchError(err => this.handleError(err))
map((response: any) => <AppDefinitionRepresentation> response.data.find((app) => app.name === name)),
catchError((err) => this.handleError(err))
);
}
@@ -64,8 +64,8 @@ export class AppsProcessService {
getApplicationDetailsById(appId: number): Observable<AppDefinitionRepresentation> {
return from(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
.pipe(
map((response: any) => response.data.find(app => app.id === appId)),
catchError(err => this.handleError(err))
map((response: any) => response.data.find((app) => app.id === appId)),
catchError((err) => this.handleError(err))
);
}
+3 -3
View File
@@ -108,7 +108,7 @@ export class AuthenticationService {
ticket: response
};
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -150,11 +150,11 @@ export class AuthenticationService {
logout() {
return from(this.callApiLogout())
.pipe(
tap(response => {
tap((response) => {
this.onLogout.next(response);
return response;
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
+2 -2
View File
@@ -48,7 +48,7 @@ export class CommentContentService {
createdBy: response.entry.createdBy
});
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -72,7 +72,7 @@ export class CommentContentService {
});
return comments;
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
+4 -4
View File
@@ -49,7 +49,7 @@ export class CommentProcessService {
createdBy: response.createdBy
});
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -69,7 +69,7 @@ export class CommentProcessService {
});
return comments;
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -89,7 +89,7 @@ export class CommentProcessService {
});
return comments;
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -111,7 +111,7 @@ export class CommentProcessService {
createdBy: response.createdBy
});
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
+5 -5
View File
@@ -157,7 +157,7 @@ export class ContentService {
getNodeContent(nodeId: string): Observable<any> {
return from(this.apiService.getInstance().core.nodesApi.getFileContent(nodeId))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -171,7 +171,7 @@ export class ContentService {
createFolder(relativePath: string, name: string, parentId?: string): Observable<NodeEntry> {
return from(this.apiService.getInstance().nodes.createFolder(name, relativePath, parentId))
.pipe(
tap(data => {
tap((data) => {
this.folderCreated.next(<FolderCreatedEvent> {
relativePath: relativePath,
name: name,
@@ -179,7 +179,7 @@ export class ContentService {
node: data
});
}),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -204,9 +204,9 @@ export class ContentService {
if (this.hasAllowableOperations(node)) {
if (permission && permission.startsWith('!')) {
hasPermission = node.allowableOperations.find(currentPermission => currentPermission === permission.replace('!', '')) ? false : true;
hasPermission = node.allowableOperations.find((currentPermission) => currentPermission === permission.replace('!', '')) ? false : true;
} else {
hasPermission = node.allowableOperations.find(currentPermission => currentPermission === permission) ? true : false;
hasPermission = node.allowableOperations.find((currentPermission) => currentPermission === permission) ? true : false;
}
} else {
@@ -51,7 +51,7 @@ export class DeletedNodesApiService {
const promise = this.nodesApi.getDeletedNodes(queryOptions);
return from(promise).pipe(
catchError(err => of(err))
catchError((err) => of(err))
);
}
}
+4 -4
View File
@@ -36,8 +36,8 @@ export class DiscoveryApiService {
public getEcmProductInfo(): Observable<EcmProductVersionModel> {
return from(this.apiService.getInstance().discovery.discoveryApi.getRepositoryInformation())
.pipe(
map(res => new EcmProductVersionModel(res)),
catchError(err => throwError(err))
map((res) => new EcmProductVersionModel(res)),
catchError((err) => throwError(err))
);
}
@@ -48,8 +48,8 @@ export class DiscoveryApiService {
public getBpmProductInfo(): Observable<BpmProductVersionModel> {
return from(this.apiService.getInstance().activiti.aboutApi.getAppVersion())
.pipe(
map(res => new BpmProductVersionModel(res)),
catchError(err => throwError(err))
map((res) => new BpmProductVersionModel(res)),
catchError((err) => throwError(err))
);
}
}
+1 -1
View File
@@ -84,7 +84,7 @@ export class FavoritesApiService {
.then(this.remapFavoritesData);
return from(promise).pipe(
catchError(err => of(err))
catchError((err) => of(err))
);
}
}
+6 -6
View File
@@ -55,7 +55,7 @@ export class NodesApiService {
.then(this.getEntryFromEntity);
return from(promise).pipe(
catchError(err => throwError(err))
catchError((err) => throwError(err))
);
}
@@ -76,7 +76,7 @@ export class NodesApiService {
.getNodeChildren(nodeId, queryOptions);
return from(promise).pipe(
catchError(err => throwError(err))
catchError((err) => throwError(err))
);
}
@@ -93,7 +93,7 @@ export class NodesApiService {
.then(this.getEntryFromEntity);
return from(promise).pipe(
catchError(err => throwError(err))
catchError((err) => throwError(err))
);
}
@@ -127,7 +127,7 @@ export class NodesApiService {
.then(this.getEntryFromEntity);
return from(promise).pipe(
catchError(err => throwError(err))
catchError((err) => throwError(err))
);
}
@@ -141,7 +141,7 @@ export class NodesApiService {
const promise = this.nodesApi.deleteNode(nodeId, options);
return from(promise).pipe(
catchError(err => throwError(err))
catchError((err) => throwError(err))
);
}
@@ -156,7 +156,7 @@ export class NodesApiService {
.then(this.getEntryFromEntity);
return from(promise).pipe(
catchError(err => throwError(err))
catchError((err) => throwError(err))
);
}
}
+1 -1
View File
@@ -40,7 +40,7 @@ export class PeopleContentService {
const promise = this.peopleApi.getPerson(personId);
return from(promise).pipe(
catchError(err => of(err))
catchError((err) => of(err))
);
}
+3 -3
View File
@@ -43,7 +43,7 @@ export class PeopleProcessService {
return from(this.getWorkflowUserApi(option))
.pipe(
map((response: any) => <UserProcessModel[]> response.data || []),
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -66,7 +66,7 @@ export class PeopleProcessService {
let node = {userId: idToInvolve};
return from<UserProcessModel[]>(this.involveUserToTaskApi(taskId, node))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -80,7 +80,7 @@ export class PeopleProcessService {
let node = {userId: idToRemove};
return from<UserProcessModel[]>(this.removeInvolvedUserFromTaskApi(taskId, node))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
+3 -3
View File
@@ -41,7 +41,7 @@ export class SearchService {
});
return from(promise).pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -54,7 +54,7 @@ export class SearchService {
});
return from(promise).pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -66,7 +66,7 @@ export class SearchService {
});
return from(promise).pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -50,7 +50,7 @@ export class SharedLinksApiService {
const promise = this.sharedLinksApi.findSharedLinks(queryOptions);
return from(promise).pipe(
catchError(err => of(err))
catchError((err) => of(err))
);
}
@@ -64,7 +64,7 @@ export class SharedLinksApiService {
const promise = this.sharedLinksApi.addSharedLink({ nodeId: nodeId });
return from(promise).pipe(
catchError(err => of(err))
catchError((err) => of(err))
);
}
@@ -77,7 +77,7 @@ export class SharedLinksApiService {
const promise = this.sharedLinksApi.deleteSharedLink(sharedId);
return from(promise).pipe(
catchError(err => of(err))
catchError((err) => of(err))
);
}
}
+3 -3
View File
@@ -43,7 +43,7 @@ export class SitesService {
const queryOptions = Object.assign({}, defaultOptions, opts);
return from(this.apiService.getInstance().core.sitesApi.getSites(queryOptions))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -56,7 +56,7 @@ export class SitesService {
getSite(siteId: string, opts?: any): Observable<SiteEntry> {
return from(this.apiService.getInstance().core.sitesApi.getSite(siteId, opts))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -71,7 +71,7 @@ export class SitesService {
options.permanent = permanentFlag;
return from(this.apiService.getInstance().core.sitesApi.deleteSite(siteId, options))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
+1 -1
View File
@@ -156,7 +156,7 @@ export class ThumbnailService {
};
constructor(public contentService: ContentService, matIconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
Object.keys(this.mimeTypeIcons).forEach(key => {
Object.keys(this.mimeTypeIcons).forEach((key) => {
matIconRegistry.addSvgIcon(key, sanitizer.bypassSecurityTrustResourceUrl(this.mimeTypeIcons[key]));
});
}
@@ -38,7 +38,7 @@ export class TranslateLoaderService implements TranslateLoader {
}
registerProvider(name: string, path: string) {
let registered = this.providers.find(provider => provider.name === name);
let registered = this.providers.find((provider) => provider.name === name);
if (registered) {
registered.path = path;
} else {
@@ -47,7 +47,7 @@ export class TranslateLoaderService implements TranslateLoader {
}
providerRegistered(name: string): boolean {
return this.providers.find(x => x.name === name) ? true : false;
return this.providers.find((x) => x.name === name) ? true : false;
}
getComponentToFetch(lang: string): Array<Observable<any>> {
@@ -83,7 +83,7 @@ export class TranslateLoaderService implements TranslateLoader {
}
isComponentInQueue(lang: string, name: string) {
return (this.queue[lang] || []).find(x => x === name) ? true : false;
return (this.queue[lang] || []).find((x) => x === name) ? true : false;
}
getFullTranslationJSON(lang: string): any {
@@ -100,7 +100,7 @@ export class TranslateLoaderService implements TranslateLoader {
}
return a.name.localeCompare(b.name);
})
.forEach(model => {
.forEach((model) => {
if (model.json && model.json[lang]) {
result = ObjectUtils.merge(result, model.json[lang]);
}
@@ -112,9 +112,9 @@ export class TranslateLoaderService implements TranslateLoader {
getTranslation(lang: string): Observable<any> {
let hasFailures = false;
const batch = [
...this.getComponentToFetch(lang).map(observable => {
...this.getComponentToFetch(lang).map((observable) => {
return observable.pipe(
catchError(error => {
catchError((error) => {
console.warn(error);
hasFailures = true;
return of(error);
@@ -123,7 +123,7 @@ export class TranslateLoaderService implements TranslateLoader {
})
];
return new Observable(observer => {
return new Observable((observer) => {
if (batch.length > 0) {
forkJoin(batch).subscribe(
+6 -6
View File
@@ -98,7 +98,7 @@ describe('UploadService', () => {
it('should make XHR done request after the file is added in the queue', (done) => {
let emitter = new EventEmitter();
let emitterDisposable = emitter.subscribe(e => {
let emitterDisposable = emitter.subscribe((e) => {
expect(e.value).toBe('File uploaded');
emitterDisposable.unsubscribe();
done();
@@ -124,7 +124,7 @@ describe('UploadService', () => {
it('should make XHR error request after an error occur', (done) => {
let emitter = new EventEmitter();
let emitterDisposable = emitter.subscribe(e => {
let emitterDisposable = emitter.subscribe((e) => {
expect(e.value).toBe('Error file uploaded');
emitterDisposable.unsubscribe();
done();
@@ -148,7 +148,7 @@ describe('UploadService', () => {
it('should make XHR abort request after the xhr abort is called', (done) => {
let emitter = new EventEmitter();
let emitterDisposable = emitter.subscribe(e => {
let emitterDisposable = emitter.subscribe((e) => {
expect(e.value).toEqual('File aborted');
emitterDisposable.unsubscribe();
done();
@@ -200,7 +200,7 @@ describe('UploadService', () => {
it('should use custom root folder ID given to the service', (done) => {
let emitter = new EventEmitter();
let emitterDisposable = emitter.subscribe(e => {
let emitterDisposable = emitter.subscribe((e) => {
expect(e.value).toBe('File uploaded');
emitterDisposable.unsubscribe();
done();
@@ -259,11 +259,11 @@ describe('UploadService', () => {
it('should start downloading the next one if a file of the list is aborted', (done) => {
let emitter = new EventEmitter();
service.fileUploadAborted.subscribe(e => {
service.fileUploadAborted.subscribe((e) => {
expect(e).not.toBeNull();
});
service.fileUploadCancelled.subscribe(e => {
service.fileUploadCancelled.subscribe((e) => {
expect(e).not.toBeNull();
done();
});
+6 -6
View File
@@ -79,7 +79,7 @@ export class UploadService {
* @returns Array of files that were not blocked from upload by the ignore list
*/
addToQueue(...files: FileModel[]): FileModel[] {
const allowedFiles = files.filter(currentFile => this.filterElement(currentFile));
const allowedFiles = files.filter((currentFile) => this.filterElement(currentFile));
this.queue = this.queue.concat(allowedFiles);
this.queueChanged.next(this.queue);
return allowedFiles;
@@ -107,7 +107,7 @@ export class UploadService {
*/
uploadFilesInTheQueue(emitter?: EventEmitter<any>): void {
if (!this.activeTask) {
let file = this.queue.find(currentFile => currentFile.status === FileUploadStatus.Pending);
let file = this.queue.find((currentFile) => currentFile.status === FileUploadStatus.Pending);
if (file) {
this.onUploadStarting(file);
@@ -135,7 +135,7 @@ export class UploadService {
* @param files One or more separate parameters or an array of files specifying uploads to cancel
*/
cancelUpload(...files: FileModel[]) {
files.forEach(file => {
files.forEach((file) => {
const promise = this.cache[file.id];
if (promise) {
@@ -212,19 +212,19 @@ export class UploadService {
emitter.emit({ value: 'File aborted' });
}
})
.on('error', err => {
.on('error', (err) => {
this.onUploadError(file, err);
if (emitter) {
emitter.emit({ value: 'Error file uploaded' });
}
})
.on('success', data => {
.on('success', (data) => {
this.onUploadComplete(file, data);
if (emitter) {
emitter.emit({ value: data });
}
})
.catch(err => {
.catch((err) => {
throw err;
});