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
@@ -62,7 +62,7 @@ describe('Breadcrumb', () => {
it('should emit navigation event', (done) => {
let node = <PathElementEntity> { id: '-id-', name: 'name' };
component.navigate.subscribe(val => {
component.navigate.subscribe((val) => {
expect(val).toBe(node);
done();
});
@@ -153,7 +153,7 @@ export class BreadcrumbComponent implements OnInit, OnChanges {
let result: number = -1;
if (route && route.length > 0 && nodeId) {
result = route.findIndex(el => el.id === nodeId);
result = route.findIndex((el) => el.id === nodeId);
}
return result;
@@ -140,7 +140,7 @@ describe('DropdownBreadcrumb', () => {
openSelect();
fixture.whenStable().then(() => {
component.navigate.subscribe(val => {
component.navigate.subscribe((val) => {
expect(val).toEqual({ id: '1', name: 'Stark Industries' });
done();
});
@@ -79,11 +79,11 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
switchMap(this.saveNode.bind(this))
)
.subscribe(
updatedNode => {
(updatedNode) => {
Object.assign(this.node, updatedNode);
this.alfrescoApiService.nodeUpdated.next(this.node);
},
error => this.logService.error(error)
(error) => this.logService.error(error)
);
this.loadProperties(this.node);
@@ -36,7 +36,7 @@ export class AspectOrientedConfigService implements ContentMetadataConfig {
const newGroup = this.getOrganisedPropertyGroup(propertyGroups, aspectName);
return groupAccumulator.concat(newGroup);
}, [])
.filter(organisedPropertyGroup => organisedPropertyGroup.properties.length > 0);
.filter((organisedPropertyGroup) => organisedPropertyGroup.properties.length > 0);
}
private getOrganisedPropertyGroup(propertyGroups, aspectName) {
@@ -52,7 +52,7 @@ export class AspectOrientedConfigService implements ContentMetadataConfig {
} else {
properties = (<string[]> aspectProperties)
.map((propertyName) => getProperty(propertyGroups, aspectName, propertyName))
.filter(props => props !== undefined);
.filter((props) => props !== undefined);
}
newGroup = [ { title: group.title, properties } ];
@@ -34,7 +34,7 @@ export class IndifferentConfigService implements ContentMetadataConfig {
properties = propertyGroup.properties;
return Object.assign({}, propertyGroup, {
properties: Object.keys(properties).map(propertyName => properties[propertyName])
properties: Object.keys(properties).map((propertyName) => properties[propertyName])
});
});
}
@@ -51,7 +51,7 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig {
private flattenItems(items) {
return items.reduce((accumulator, item) => {
const properties = Array.isArray(item.properties) ? item.properties : [item.properties];
const flattenedProperties = properties.map(propertyName => {
const flattenedProperties = properties.map((propertyName) => {
return {
groupName: item.aspect || item.type,
propertyName
@@ -64,7 +64,7 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig {
private getMatchingGroups(groupName: string): LayoutOrientedConfigItem[] {
return this.config
.map(layoutBlock => layoutBlock.items)
.map((layoutBlock) => layoutBlock.items)
.reduce((accumulator, items) => accumulator.concat(items), [])
.filter((item) => item.aspect === groupName || item.type === groupName);
}
@@ -22,7 +22,7 @@ const emptyGroup = {
};
function convertObjectToArray(object: any): Property[] {
return Object.keys(object).map(key => object[key]);
return Object.keys(object).map((key) => object[key]);
}
export function getGroup(propertyGroups: PropertyGroupContainer, groupName: string): PropertyGroup | undefined {
@@ -48,13 +48,13 @@ export class ContentMetadataService {
const config = this.contentMetadataConfigFactory.get(presetName),
groupNames = node.aspectNames
.concat(node.nodeType)
.filter(groupName => config.isGroupAllowed(groupName));
.filter((groupName) => config.isGroupAllowed(groupName));
if (groupNames.length > 0) {
groupedProperties = this.propertyDescriptorsService.load(groupNames).pipe(
map(groups => config.reorganiseByConfig(groups)),
map(groups => this.setTitleToNameIfNotSet(groups)),
map(groups => this.propertyGroupTranslatorService.translateToCardViewGroups(groups, node.properties))
map((groups) => config.reorganiseByConfig(groups)),
map((groups) => this.setTitleToNameIfNotSet(groups)),
map((groups) => this.propertyGroupTranslatorService.translateToCardViewGroups(groups, node.properties))
);
}
}
@@ -63,7 +63,7 @@ export class ContentMetadataService {
}
setTitleToNameIfNotSet(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] {
propertyGroups.map(propertyGroup => {
propertyGroups.map((propertyGroup) => {
propertyGroup.title = propertyGroup.title || propertyGroup.name;
});
return propertyGroups;
@@ -30,8 +30,8 @@ export class PropertyDescriptorsService {
load(groupNames: string[]): Observable<PropertyGroupContainer> {
const groupFetchStreams = groupNames
.map(groupName => groupName.replace(':', '_'))
.map(groupName => defer( () => this.alfrescoApiService.classesApi.getClass(groupName)) );
.map((groupName) => groupName.replace(':', '_'))
.map((groupName) => defer( () => this.alfrescoApiService.classesApi.getClass(groupName)) );
return forkJoin(groupFetchStreams).pipe(
map(this.convertToObject)
@@ -50,7 +50,7 @@ export class PropertyGroupTranslatorService {
}
public translateToCardViewGroups(propertyGroups: OrganisedPropertyGroup[], propertyValues): CardViewGroup[] {
return propertyGroups.map(propertyGroup => {
return propertyGroups.map((propertyGroup) => {
const translatedPropertyGroup: any = Object.assign({}, propertyGroup);
translatedPropertyGroup.properties = this.translateArray(propertyGroup.properties, propertyValues);
return translatedPropertyGroup;
@@ -58,7 +58,7 @@ export class PropertyGroupTranslatorService {
}
private translateArray(properties: Property[], propertyValues: any): CardViewItem[] {
return properties.map(property => {
return properties.map((property) => {
return this.translate(property, propertyValues);
});
}
@@ -298,7 +298,7 @@ describe('ContentNodeSelectorComponent', () => {
const customResourcesService = TestBed.get(CustomResourcesService);
getCorrespondingNodeIdsSpy = spyOn(customResourcesService, 'getCorrespondingNodeIds').and
.callFake(id => {
.callFake((id) => {
if (id === '-sites-') {
return of(['123456testId', '09876543testId']);
}
@@ -259,7 +259,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, PaginatedCompo
if (this.customResourcesService.hasCorrespondingNodeIds(this.siteId)) {
this.customResourcesService.getCorrespondingNodeIds(this.siteId)
.subscribe(nodeIds => {
.subscribe((nodeIds) => {
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.skipCount, this.pageSize, nodeIds)
.subscribe(this.showSearchResults.bind(this));
},
@@ -380,7 +380,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, PaginatedCompo
};
this.apiService.nodesApi.getNode(node.guid, options)
.then(documentLibrary => {
.then((documentLibrary) => {
this.documentList.performCustomSourceNavigation(documentLibrary);
});
}
@@ -48,8 +48,8 @@ export class ContentNodeSelectorService {
if (extraNodeIds && extraNodeIds.length) {
extraNodeIds
.filter(id => id !== rootNodeId)
.forEach(extraId => {
.filter((id) => id !== rootNodeId)
.forEach((extraId) => {
extraParentFiltering += ` OR ANCESTOR:'workspace://SpacesStore/${extraId}'`;
});
}
@@ -140,7 +140,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
minWidth: '250px',
closeOnNavigation: true
})
.beforeClose().subscribe(deleteSharedLink => {
.beforeClose().subscribe((deleteSharedLink) => {
if (deleteSharedLink) {
this.deleteSharedLink(this.sharedId);
} else {
@@ -58,9 +58,9 @@ export class DownloadZipDialogComponent implements OnInit {
const promise: any = this.apiService.getInstance().core.downloadsApi.createDownload({ nodeIds });
promise.on('progress', progress => this.logService.log('Progress', progress));
promise.on('error', error => this.logService.error('Error', error));
promise.on('abort', data => this.logService.log('Abort', data));
promise.on('progress', (progress) => this.logService.log('Progress', progress));
promise.on('error', (error) => this.logService.error('Error', error));
promise.on('abort', (data) => this.logService.log('Abort', data));
promise.on('success', (data: DownloadEntry) => {
if (data && data.entry && data.entry.id) {
@@ -145,7 +145,7 @@ describe('FolderDialogComponent', () => {
it('should not call dialog to close if submit fails', () => {
spyOn(nodesApi, 'updateNode').and.returnValue(throwError('error'));
spyOn(component, 'handleError').and.callFake(val => val);
spyOn(component, 'handleError').and.callFake((val) => val);
component.submit();
@@ -254,7 +254,7 @@ describe('FolderDialogComponent', () => {
it('should not call dialog to close if submit fails', () => {
spyOn(nodesApi, 'createFolder').and.returnValue(throwError('error'));
spyOn(component, 'handleError').and.callFake(val => val);
spyOn(component, 'handleError').and.callFake((val) => val);
component.form.controls['name'].setValue('name');
component.form.controls['description'].setValue('description');
@@ -85,10 +85,10 @@ export class NodeLockDialogComponent implements OnInit {
submit(): void {
this.toggleLock()
.then(node => {
.then((node) => {
this.data.node.isLocked = this.form.value.isLocked;
this.dialog.close(node.entry);
})
.catch(error => this.data.onError(error));
.catch((error) => this.data.onError(error));
}
}
@@ -200,7 +200,7 @@ describe('ContentAction', () => {
it('should use custom "execute" emitter', (done) => {
let emitter = new EventEmitter();
emitter.subscribe(e => {
emitter.subscribe((e) => {
expect(e.value).toBe('<obj>');
done();
});
@@ -129,7 +129,7 @@ export class ContentActionComponent implements OnInit, OnChanges, OnDestroy {
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
if (this.documentActionModel) {
@@ -188,13 +188,13 @@ export class ContentActionComponent implements OnInit, OnChanges, OnDestroy {
if (target === ContentActionTarget.Document) {
if (this.documentActions) {
this.subscriptions.push(
this.documentActions.permissionEvent.subscribe(permission => {
this.documentActions.permissionEvent.subscribe((permission) => {
this.permissionEvent.emit(permission);
}),
this.documentActions.error.subscribe(errors => {
this.documentActions.error.subscribe((errors) => {
this.error.emit(errors);
}),
this.documentActions.success.subscribe(message => {
this.documentActions.success.subscribe((message) => {
this.success.emit(message);
})
);
@@ -207,13 +207,13 @@ export class ContentActionComponent implements OnInit, OnChanges, OnDestroy {
if (target === ContentActionTarget.Folder) {
if (this.folderActions) {
this.subscriptions.push(
this.folderActions.permissionEvent.subscribe(permission => {
this.folderActions.permissionEvent.subscribe((permission) => {
this.permissionEvent.emit(permission);
}),
this.folderActions.error.subscribe(errors => {
this.folderActions.error.subscribe((errors) => {
this.error.emit(errors);
}),
this.folderActions.success.subscribe(message => {
this.folderActions.success.subscribe((message) => {
this.success.emit(message);
})
);
@@ -560,7 +560,7 @@ describe('DocumentList', () => {
it('should emit nodeClick event', (done) => {
let node = new FileNode();
let disposableClick = documentList.nodeClick.subscribe(e => {
let disposableClick = documentList.nodeClick.subscribe((e) => {
expect(e.value).toBe(node);
disposableClick.unsubscribe();
done();
@@ -650,7 +650,7 @@ describe('DocumentList', () => {
it('should emit file preview event on single click', (done) => {
let file = new FileNode();
let disposablePreview = documentList.preview.subscribe(e => {
let disposablePreview = documentList.preview.subscribe((e) => {
expect(e.value).toBe(file);
disposablePreview.unsubscribe();
done();
@@ -661,7 +661,7 @@ describe('DocumentList', () => {
it('should emit file preview event on double click', (done) => {
let file = new FileNode();
let disposablePreview = documentList.preview.subscribe(e => {
let disposablePreview = documentList.preview.subscribe((e) => {
expect(e.value).toBe(file);
disposablePreview.unsubscribe();
done();
@@ -738,7 +738,7 @@ describe('DocumentList', () => {
let called = false;
documentList.navigationMode = DocumentListComponent.SINGLE_CLICK_NAVIGATION;
documentList.preview.subscribe(val => called = true);
documentList.preview.subscribe((val) => called = true);
documentList.onNodeClick(file);
expect(called).toBeFalsy();
@@ -966,7 +966,7 @@ describe('DocumentList', () => {
const error = { message: '{ "error": { "statusCode": 501 } }' };
spyOn(documentListService, 'getFolderNode').and.returnValue(throwError(error));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe(error);
disposableError.unsubscribe();
done();
@@ -980,7 +980,7 @@ describe('DocumentList', () => {
spyOn(documentListService, 'getFolderNode').and.returnValue(of(fakeNodeWithCreatePermission));
spyOn(documentList, 'loadFolderNodesByFolderNodeId').and.returnValue(Promise.reject(error));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe(error);
disposableError.unsubscribe();
done();
@@ -1003,7 +1003,7 @@ describe('DocumentList', () => {
const error = { message: '{ "error": { "statusCode": 403 } }' };
spyOn(documentListService, 'getFolderNode').and.returnValue(throwError(error));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe(error);
expect(documentList.noPermission).toBe(true);
disposableError.unsubscribe();
@@ -1060,7 +1060,7 @@ describe('DocumentList', () => {
documentList.currentFolderId = 'node-id';
expect(documentList.canNavigateFolder(node)).toBeTruthy();
sources.forEach(source => {
sources.forEach((source) => {
documentList.currentFolderId = source;
expect(documentList.canNavigateFolder(node)).toBeFalsy();
});
@@ -1076,7 +1076,7 @@ describe('DocumentList', () => {
it('should emit error when fetch trashcan fails', (done) => {
spyOn(apiService.nodesApi, 'getDeletedNodes').and.returnValue(Promise.reject('error'));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe('error');
disposableError.unsubscribe();
done();
@@ -1097,7 +1097,7 @@ describe('DocumentList', () => {
spyOn(apiService.getInstance().core.sharedlinksApi, 'findSharedLinks')
.and.returnValue(Promise.reject('error'));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe('error');
disposableError.unsubscribe();
done();
@@ -1116,7 +1116,7 @@ describe('DocumentList', () => {
it('should emit error when fetch sites fails', (done) => {
spyGetSites.and.returnValue(Promise.reject('error'));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe('error');
disposableError.unsubscribe();
done();
@@ -1129,7 +1129,7 @@ describe('DocumentList', () => {
fixture.detectChanges();
let disposableReady = documentList.ready.subscribe((page) => {
const entriesWithoutName = page.list.entries.filter(item => !item.entry.name);
const entriesWithoutName = page.list.entries.filter((item) => !item.entry.name);
expect(entriesWithoutName.length).toBe(0);
disposableReady.unsubscribe();
done();
@@ -1142,7 +1142,7 @@ describe('DocumentList', () => {
fixture.detectChanges();
let disposableReady = documentList.ready.subscribe((page) => {
const wrongName = page.list.entries.filter(item => (item.entry.name !== item.entry.title));
const wrongName = page.list.entries.filter((item) => (item.entry.name !== item.entry.title));
expect(wrongName.length).toBe(0);
disposableReady.unsubscribe();
done();
@@ -1163,7 +1163,7 @@ describe('DocumentList', () => {
spyOn(apiService.getInstance().core.peopleApi, 'getSiteMembership')
.and.returnValue(Promise.reject('error'));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe('error');
disposableError.unsubscribe();
done();
@@ -1181,7 +1181,7 @@ describe('DocumentList', () => {
expect(peopleApi.getSiteMembership).toHaveBeenCalled();
let disposableReady = documentList.ready.subscribe((page) => {
const entriesWithoutName = page.list.entries.filter(item => !item.entry.name);
const entriesWithoutName = page.list.entries.filter((item) => !item.entry.name);
expect(entriesWithoutName.length).toBe(0);
disposableReady.unsubscribe();
done();
@@ -1197,7 +1197,7 @@ describe('DocumentList', () => {
expect(peopleApi.getSiteMembership).toHaveBeenCalled();
let disposableReady = documentList.ready.subscribe((page) => {
const wrongName = page.list.entries.filter(item => (item.entry.name !== item.entry.title));
const wrongName = page.list.entries.filter((item) => (item.entry.name !== item.entry.title));
expect(wrongName.length).toBe(0);
disposableReady.unsubscribe();
done();
@@ -1215,7 +1215,7 @@ describe('DocumentList', () => {
it('should emit error when fetch favorites fails', (done) => {
spyFavorite.and.returnValue(Promise.reject('error'));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe('error');
disposableError.unsubscribe();
done();
@@ -1237,7 +1237,7 @@ describe('DocumentList', () => {
it('should emit error when fetch recent fails on getPerson call', (done) => {
spyOn(apiService.peopleApi, 'getPerson').and.returnValue(Promise.reject('error'));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe('error');
disposableError.unsubscribe();
done();
@@ -1249,7 +1249,7 @@ describe('DocumentList', () => {
xit('should emit error when fetch recent fails on search call', (done) => {
spyOn(customResourcesService, 'loadFolderByNodeId').and.returnValue(throwError('error'));
let disposableError = documentList.error.subscribe(val => {
let disposableError = documentList.error.subscribe((val) => {
expect(val).toBe('error');
disposableError.unsubscribe();
done();
@@ -286,7 +286,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
private getLayoutPreset(name: string = 'default'): DataColumn[] {
return (this.layoutPresets[name] || this.layoutPresets['default']).map(col => new ObjectDataColumn(col));
return (this.layoutPresets[name] || this.layoutPresets['default']).map((col) => new ObjectDataColumn(col));
}
get pagination(): BehaviorSubject<PaginationModel> {
@@ -352,7 +352,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
this.subscriptions.push(
this.contextActionHandler.subscribe(val => this.contextActionCallback(val))
this.contextActionHandler.subscribe((val) => this.contextActionCallback(val))
);
this.enforceSingleClickNavigationForMobile();
@@ -373,7 +373,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
let schema: DataColumn[] = [];
if (this.hasCustomLayout) {
schema = this.columnList.columns.map(c => <DataColumn> c);
schema = this.columnList.columns.map((c) => <DataColumn> c);
}
if (!this.data) {
@@ -422,7 +422,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
} else if (changes.rowFilter && changes.rowFilter.currentValue !== changes.rowFilter.previousValue) {
this.data.setFilter(changes.rowFilter.currentValue);
if (this.currentFolderId) {
this.loadFolderNodesByFolderNodeId(this.currentFolderId, this.pagination.getValue()).catch(err => this.error.emit(err));
this.loadFolderNodesByFolderNodeId(this.currentFolderId, this.pagination.getValue()).catch((err) => this.error.emit(err));
}
} else if (changes.imageResolver) {
this.data.setImageResolver(changes.imageResolver.currentValue);
@@ -461,21 +461,21 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
if (target) {
const actions = this.rowMenuCache[node.entry.id];
if (actions) {
actions.forEach(action => {
actions.forEach((action) => {
this.refreshAction(action, node);
});
return actions;
}
let actionsByTarget = this.actions
.filter(entry => {
.filter((entry) => {
const isVisible = (typeof entry.visible === 'function')
? entry.visible(node)
: entry.visible;
return isVisible && entry.target.toLowerCase() === target;
})
.map(action => new ContentActionModel(action));
.map((action) => new ContentActionModel(action));
actionsByTarget.forEach((action) => {
this.refreshAction(action, node);
@@ -604,7 +604,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
if (this.folderNode) {
return this.loadFolderNodesByFolderNodeId(this.folderNode.id, this.pagination.getValue())
.catch(err => this.handleError(err));
.catch((err) => this.handleError(err));
} else {
this.loadFolderByNodeId(this.currentFolderId);
}
@@ -616,7 +616,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
this.customResourcesService.loadFolderByNodeId(nodeId, this.pagination.getValue(), this.includeFields)
.subscribe((page: NodePaging) => {
this.onPageLoaded(page);
}, err => {
}, (err) => {
this.error.emit(err);
});
} else {
@@ -625,8 +625,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
.subscribe((node: MinimalNodeEntryEntity) => {
this.folderNode = node;
return this.loadFolderNodesByFolderNodeId(node.id, this.pagination.getValue())
.catch(err => this.handleError(err));
}, err => {
.catch((err) => this.handleError(err));
}, (err) => {
this.handleError(err);
});
}
@@ -642,12 +642,12 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
rootFolderId: id
}, this.includeFields)
.subscribe(
nodePaging => {
(nodePaging) => {
this.data.loadPage(<NodePaging> nodePaging, this.pagination.getValue().merge);
this.setLoadingState(false);
this.onDataReady(nodePaging);
resolve(true);
}, err => {
}, (err) => {
this.handleError(err);
});
});
@@ -740,7 +740,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
onNodeSelect(event: { row: ShareDataRow, selection: Array<ShareDataRow> }) {
this.selection = event.selection.map(entry => entry.node);
this.selection = event.selection.map((entry) => entry.node);
const domEvent = new CustomEvent('node-select', {
detail: {
node: event.row.node,
@@ -752,7 +752,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
onNodeUnselect(event: { row: ShareDataRow, selection: Array<ShareDataRow> }) {
this.selection = event.selection.map(entry => entry.node);
this.selection = event.selection.map((entry) => entry.node);
const domEvent = new CustomEvent('node-unselect', {
detail: {
node: event.row.node,
@@ -844,7 +844,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
ngOnDestroy() {
this.subscriptions.forEach(s => s.unsubscribe());
this.subscriptions.forEach((s) => s.unsubscribe());
this.subscriptions = [];
}
@@ -241,7 +241,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
if (page && page.list) {
let data = page.list.entries;
if (data && data.length > 0) {
rows = data.map(item => new ShareDataRow(item, this.documentListService, this.permissionsStyle, this.thumbnailService));
rows = data.map((item) => new ShareDataRow(item, this.documentListService, this.permissionsStyle, this.thumbnailService));
if (this.filter) {
rows = rows.filter(this.filter);
@@ -254,7 +254,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
if (sorting) {
this.sortRows(rows, sorting);
} else {
let sortable = this.columns.filter(c => c.sortable);
let sortable = this.columns.filter((c) => c.sortable);
if (sortable.length > 0) {
this.sort(sortable[0].key, 'asc');
} else {
@@ -50,7 +50,7 @@ export class CustomResourcesService {
* @returns List of nodes for the recently used files
*/
getRecentFiles(personId: string, pagination: PaginationModel): Observable<NodePaging> {
return new Observable(observer => {
return new Observable((observer) => {
this.apiService.peopleApi.getPerson(personId)
.then((person: PersonEntry) => {
const username = person.entry.id;
@@ -89,7 +89,7 @@ export class CustomResourcesService {
observer.error(err);
observer.complete();
});
}).pipe(catchError(err => this.handleError(err)));
}).pipe(catchError((err) => this.handleError(err)));
}
/**
@@ -108,7 +108,7 @@ export class CustomResourcesService {
include: includeFieldsRequest
};
return new Observable(observer => {
return new Observable((observer) => {
this.apiService.favoritesApi.getFavorites('-me-', options)
.then((result: NodePaging) => {
let page: NodePaging = {
@@ -135,7 +135,7 @@ export class CustomResourcesService {
observer.error(err);
observer.complete();
});
}).pipe(catchError(err => this.handleError(err)));
}).pipe(catchError((err) => this.handleError(err)));
}
/**
@@ -150,7 +150,7 @@ export class CustomResourcesService {
skipCount: pagination.skipCount
};
return new Observable(observer => {
return new Observable((observer) => {
this.apiService.peopleApi.getSiteMembership('-me-', options)
.then((result: SitePaging) => {
let page: NodePaging = {
@@ -174,7 +174,7 @@ export class CustomResourcesService {
observer.error(err);
observer.complete();
});
}).pipe(catchError(err => this.handleError(err)));
}).pipe(catchError((err) => this.handleError(err)));
}
/**
@@ -189,7 +189,7 @@ export class CustomResourcesService {
skipCount: pagination.skipCount
};
return new Observable(observer => {
return new Observable((observer) => {
this.apiService.sitesApi.getSites(options)
.then((page: NodePaging) => {
page.list.entries.map(
@@ -205,7 +205,7 @@ export class CustomResourcesService {
observer.error(err);
observer.complete();
});
}).pipe(catchError(err => this.handleError(err)));
}).pipe(catchError((err) => this.handleError(err)));
}
/**
@@ -224,7 +224,7 @@ export class CustomResourcesService {
};
return from(this.apiService.nodesApi.getDeletedNodes(options))
.pipe(catchError(err => this.handleError(err)));
.pipe(catchError((err) => this.handleError(err)));
}
@@ -244,7 +244,7 @@ export class CustomResourcesService {
};
return from(this.apiService.sharedLinksApi.findSharedLinks(options))
.pipe(catchError(err => this.handleError(err)));
.pipe(catchError((err) => this.handleError(err)));
}
/**
@@ -314,7 +314,7 @@ export class CustomResourcesService {
if (this.isCustomSource(nodeId)) {
return this.loadFolderByNodeId(nodeId, pagination, [])
.pipe(map(result => result.list.entries.map((node: any) => {
.pipe(map((result) => result.list.entries.map((node: any) => {
if (nodeId === '-sharedlinks-') {
return node.entry.nodeId;
@@ -331,7 +331,7 @@ export class CustomResourcesService {
} else if (nodeId) {
// cases when nodeId is '-my-', '-root-' or '-shared-'
return from(this.apiService.nodesApi.getNode(nodeId)
.then(node => [node.entry.id]));
.then((node) => [node.entry.id]));
}
return of([]);
@@ -107,7 +107,7 @@ describe('DocumentListService', () => {
it('should create a folder in the path', () => {
service.createFolder('fake-name', 'fake-path').subscribe(
res => {
(res) => {
expect(res).toBeDefined();
expect(res.entry).toBeDefined();
expect(res.entry.isFolder).toBeTruthy();
@@ -125,10 +125,10 @@ describe('DocumentListService', () => {
it('should emit an error when the folder already exist', () => {
service.createFolder('fake-name', 'fake-path').subscribe(
res => {
(res) => {
},
err => {
(err) => {
expect(err).toBeDefined();
expect(err.status).toEqual(409);
expect(err.response).toBeDefined();
@@ -144,7 +144,7 @@ describe('DocumentListService', () => {
it('should return the folder info', () => {
service.getFolder('/fake-root/fake-name').subscribe(
res => {
(res) => {
expect(res).toBeDefined();
expect(res.list).toBeDefined();
expect(res.list.entries).toBeDefined();
@@ -210,7 +210,7 @@ describe('DocumentListService', () => {
it('should delete the folder', () => {
service.deleteNode('fake-id').subscribe(
res => {
(res) => {
expect(res).toBeNull();
}
);
@@ -88,7 +88,7 @@ export class DocumentListService {
*/
copyNode(nodeId: string, targetParentId: string) {
return from(this.apiService.getInstance().nodes.copyNode(nodeId, { targetParentId })).pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -101,7 +101,7 @@ export class DocumentListService {
*/
moveNode(nodeId: string, targetParentId: string) {
return from(this.apiService.getInstance().nodes.moveNode(nodeId, { targetParentId })).pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -114,7 +114,7 @@ export class DocumentListService {
createFolder(name: string, parentId: string): Observable<MinimalNodeEntity> {
return from(this.apiService.getInstance().nodes.createFolder(name, '/', parentId))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -128,7 +128,7 @@ export class DocumentListService {
getFolder(folder: string, opts?: any, includeFields: string[] = []): Observable<NodePaging> {
return from(this.getNodesPromise(folder, opts, includeFields))
.pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -107,7 +107,7 @@ describe('FolderActionsService', () => {
it('should delete the folder node if there is the delete permission', () => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -125,7 +125,7 @@ describe('FolderActionsService', () => {
it('should not delete the folder node if there is no delete permission', (done) => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -146,7 +146,7 @@ describe('FolderActionsService', () => {
it('should call the error on the returned Observable if there is no delete permission', (done) => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -168,7 +168,7 @@ describe('FolderActionsService', () => {
it('should delete the folder node if there is the delete and others permission ', () => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -185,7 +185,7 @@ describe('FolderActionsService', () => {
it('should support deletion only folder node', () => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -205,7 +205,7 @@ describe('FolderActionsService', () => {
it('should require node id to delete', () => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -220,7 +220,7 @@ describe('FolderActionsService', () => {
it('should reload target upon node deletion', (done) => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -244,7 +244,7 @@ describe('FolderActionsService', () => {
it('should emit success event upon node deletion', (done) => {
spyOn(documentListService, 'deleteNode').and.callFake(() => {
return new Observable<any>(observer => {
return new Observable<any>((observer) => {
observer.next();
observer.complete();
});
@@ -88,7 +88,7 @@ describe('FolderCreateDirective', () => {
node = { entry: { id: 'nodeId' } };
dialogRefMock = {
afterClosed: val => of(val),
afterClosed: (val) => of(val),
componentInstance: {
error: new Subject<any>(),
success: new Subject<MinimalNodeEntryEntity>()
@@ -71,7 +71,7 @@ describe('FolderEditDirective', () => {
node = { entry: { id: 'folderId' } };
dialogRefMock = {
afterClosed: val => of(val),
afterClosed: (val) => of(val),
componentInstance: {
error: new Subject<any>(),
success: new Subject<MinimalNodeEntryEntity>()
@@ -42,14 +42,14 @@ export class DocumentListServiceMock extends DocumentListService {
if (this.getFolderReject) {
return throwError(this.getFolderRejectError);
}
return new Observable(observer => {
return new Observable((observer) => {
observer.next(this.getFolderResult);
observer.complete();
});
}
deleteNode(nodeId: string) {
return new Observable(observer => {
return new Observable((observer) => {
observer.next();
observer.complete();
});
@@ -84,10 +84,10 @@ export class NodePermissionDialogService {
updateNodePermissionByDialog(nodeId?: string, title?: string): Observable<MinimalNodeEntryEntity> {
return this.contentService.getNode(nodeId, { include: ['allowableOperations'] })
.pipe(
switchMap(node => {
switchMap((node) => {
return this.openAddPermissionDialog(node.entry, title)
.pipe(
switchMap(selection => {
switchMap((selection) => {
return this.nodePermissionService.updateNodePermissions(nodeId, selection);
})
);
@@ -78,7 +78,7 @@ export class NodePermissionService {
*/
updateNodePermissions(nodeId: string, permissionList: MinimalNodeEntity[]): Observable<MinimalNodeEntryEntity> {
return this.nodeService.getNode(nodeId).pipe(
switchMap(node => {
switchMap((node) => {
return this.getNodeRoles(node).pipe(
switchMap((nodeRoles) => of({node, nodeRoles}) )
);
@@ -60,7 +60,7 @@ export class SearchCheckListComponent implements SearchWidget, OnInit {
}
reset() {
this.options.items.forEach(opt => {
this.options.items.forEach((opt) => {
opt.checked = false;
});
@@ -77,8 +77,8 @@ export class SearchCheckListComponent implements SearchWidget, OnInit {
flush() {
const checkedValues = this.options.items
.filter(option => option.checked)
.map(option => option.value);
.filter((option) => option.checked)
.map((option) => option.value);
const query = checkedValues.join(` ${this.operator} `);
@@ -120,7 +120,7 @@ describe('SearchControlComponent', () => {
of({ entry: { list: [] } })
);
let searchDisposable = component.searchChange.subscribe(value => {
let searchDisposable = component.searchChange.subscribe((value) => {
expect(value).toBe('customSearchTerm');
searchDisposable.unsubscribe();
done();
@@ -161,7 +161,7 @@ describe('SearchControlComponent', () => {
it('should still fire an event when user inputs a search term less than 3 characters', (done) => {
searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results))));
let searchDisposable = component.searchChange.subscribe(value => {
let searchDisposable = component.searchChange.subscribe((value) => {
expect(value).toBe('cu');
searchDisposable.unsubscribe();
});
@@ -22,7 +22,7 @@ export class ResponseFacetQueryList extends SearchFilterList<FacetQuery> {
constructor(items: FacetQuery[] = [], translationService, pageSize: number = 5) {
super(
items
.filter(item => {
.filter((item) => {
return item.count > 0;
}),
pageSize
@@ -119,8 +119,8 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
if (field.buckets) {
this.selectedBuckets.push(
...this.queryBuilder.getUserFacetBuckets(field.field)
.filter(bucket => bucket.checked)
.map(bucket => {
.filter((bucket) => bucket.checked)
.map((bucket) => {
return { field, bucket };
})
);
@@ -133,7 +133,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
private updateSelectedFields() {
if (this.responseFacetQueries) {
this.selectedFacetQueries = this.responseFacetQueries.items.filter(item => item.checked);
this.selectedFacetQueries = this.responseFacetQueries.items.filter((item) => item.checked);
this.canResetSelectedQueries = this.selectedFacetQueries.length > 0;
} else {
this.selectedFacetQueries = [];
@@ -183,7 +183,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
canResetSelectedBuckets(field: FacetField): boolean {
if (field && field.buckets) {
return field.buckets.items.some(bucket => bucket.checked);
return field.buckets.items.some((bucket) => bucket.checked);
}
return false;
}
@@ -215,10 +215,10 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
if (!this.responseFacetFields) {
const configFacetFields = this.queryBuilder.config.facetFields && this.queryBuilder.config.facetFields.fields || [];
this.responseFacetFields = configFacetFields.map(field => {
const responseField = (context.facetsFields || []).find(response => response.label === field.label);
const buckets: FacetFieldBucket[] = ((responseField && responseField.buckets) || []).map(bucket => {
const selectedBucket = this.selectedBuckets.find(facetBucket =>
this.responseFacetFields = configFacetFields.map((field) => {
const responseField = (context.facetsFields || []).find((response) => response.label === field.label);
const buckets: FacetFieldBucket[] = ((responseField && responseField.buckets) || []).map((bucket) => {
const selectedBucket = this.selectedBuckets.find((facetBucket) =>
facetBucket.bucket.label === bucket.label && facetBucket.field.field === field.field);
return <FacetFieldBucket> {
@@ -249,13 +249,13 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
} else {
this.responseFacetFields = this.responseFacetFields
.map(field => {
.map((field) => {
let responseField = (context.facetsFields || []).find(response => response.label === field.label);
let responseField = (context.facetsFields || []).find((response) => response.label === field.label);
(field && field.buckets && field.buckets.items || [])
.map(bucket => {
const responseBucket = ((responseField && responseField.buckets) || []).find(respBucket => respBucket.label === bucket.label);
.map((bucket) => {
const responseBucket = ((responseField && responseField.buckets) || []).find((respBucket) => respBucket.label === bucket.label);
bucket.count = responseBucket ? responseBucket.count : 0;
return bucket;
@@ -271,10 +271,10 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
if (this.queryBuilder.config.facetQueries) {
const bkpResponseFacetQueries = Object.assign({}, this.responseFacetQueries);
const facetQueries = (this.queryBuilder.config.facetQueries.queries || [])
.map(query => {
.map((query) => {
const queryResult = responseQueries[query.label];
const bkpQuery = (bkpResponseFacetQueries.items || []).find(item => item.label === query.label);
const bkpQuery = (bkpResponseFacetQueries.items || []).find((item) => item.label === query.label);
if (bkpQuery) {
bkpQuery.count = queryResult.count;
@@ -304,7 +304,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy {
private getFacetQueryMap(context: any): { [key: string]: any } {
const result = {};
(context.facetQueries || []).forEach(query => {
(context.facetQueries || []).forEach((query) => {
result[query.label] = query;
});
@@ -70,7 +70,7 @@ export class SearchRadioComponent implements SearchWidget, OnInit {
private getSelectedValue(): string {
const options: any[] = this.settings['options'] || [];
if (options && options.length > 0) {
let selected = options.find(opt => opt.default);
let selected = options.find((opt) => opt.default);
if (!selected) {
selected = options[0];
}
@@ -51,7 +51,7 @@ export class SearchSortingPickerComponent implements OnInit {
private findOptionByKey(key: string): SearchSortingDefinition {
if (key) {
return this.options.find(opt => opt.key === key);
return this.options.find((opt) => opt.key === key);
}
return null;
}
@@ -197,7 +197,7 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy {
}),
takeUntil(this.onDestroy$)
)
.subscribe(event => this.setValueAndClose(event));
.subscribe((event) => this.setValueAndClose(event));
}
private setTriggerValue(value: any): void {
@@ -78,7 +78,7 @@ export class SearchComponent implements AfterContentInit, OnChanges {
@Input('class')
set classList(classList: string) {
if (classList && classList.length) {
classList.split(' ').forEach(className => this._classList[className.trim()] = true);
classList.split(' ').forEach((className) => this._classList[className.trim()] = true);
this._elementRef.nativeElement.className = '';
}
}
@@ -119,8 +119,8 @@ export class SearchComponent implements AfterContentInit, OnChanges {
});
searchService.dataLoaded.subscribe(
data => this.onSearchDataLoaded(data),
error => this.onSearchDataError(error)
(data) => this.onSearchDataLoaded(data),
(error) => this.onSearchDataError(error)
);
}
@@ -162,13 +162,13 @@ export class SearchComponent implements AfterContentInit, OnChanges {
if (searchTerm) {
if (this.queryBody) {
this.searchService.searchByQueryBody(this.queryBody).subscribe(
result => this.onSearchDataLoaded(result),
err => this.onSearchDataError(err)
(result) => this.onSearchDataLoaded(result),
(err) => this.onSearchDataError(err)
);
} else {
this.searchService.search(searchTerm, this.maxResults, this.skipResults).subscribe(
result => this.onSearchDataLoaded(result),
err => this.onSearchDataError(err)
(result) => this.onSearchDataLoaded(result),
(err) => this.onSearchDataError(err)
);
}
} else {
@@ -222,7 +222,7 @@ describe('SearchQueryBuilder', () => {
spyOn(builder, 'buildQuery').and.returnValue(query);
let eventArgs;
builder.updated.subscribe(args => eventArgs = args);
builder.updated.subscribe((args) => eventArgs = args);
await builder.execute();
expect(eventArgs).toBe(query);
@@ -237,7 +237,7 @@ describe('SearchQueryBuilder', () => {
spyOn(builder, 'buildQuery').and.returnValue({});
let eventArgs;
builder.executed.subscribe(args => eventArgs = args);
builder.executed.subscribe((args) => eventArgs = args);
await builder.execute();
expect(eventArgs).toBe(data);
@@ -69,7 +69,7 @@ export class SearchQueryBuilderService {
const template = this.appConfig.get<SearchConfiguration>('search');
if (template) {
this.config = JSON.parse(JSON.stringify(template));
this.categories = (this.config.categories || []).filter(category => category.enabled);
this.categories = (this.config.categories || []).filter((category) => category.enabled);
this.filterQueries = this.config.filterQueries || [];
this.userFacetBuckets = {};
this.userFacetQueries = [];
@@ -81,7 +81,7 @@ export class SearchQueryBuilderService {
addUserFacetQuery(query: FacetQuery) {
if (query) {
const existing = this.userFacetQueries.find(facetQuery => facetQuery.label === query.label);
const existing = this.userFacetQueries.find((facetQuery) => facetQuery.label === query.label);
if (existing) {
existing.query = query.query;
} else {
@@ -93,14 +93,14 @@ export class SearchQueryBuilderService {
removeUserFacetQuery(query: FacetQuery) {
if (query) {
this.userFacetQueries = this.userFacetQueries
.filter(facetQuery => facetQuery.label !== query.label);
.filter((facetQuery) => facetQuery.label !== query.label);
}
}
addUserFacetBucket(field: FacetField, bucket: FacetFieldBucket) {
if (field && field.field && bucket) {
const buckets = this.userFacetBuckets[field.field] || [];
const existing = buckets.find(facetBucket => facetBucket.label === bucket.label);
const existing = buckets.find((facetBucket) => facetBucket.label === bucket.label);
if (!existing) {
buckets.push(bucket);
}
@@ -116,13 +116,13 @@ export class SearchQueryBuilderService {
if (field && field.field && bucket) {
const buckets = this.userFacetBuckets[field.field] || [];
this.userFacetBuckets[field.field] = buckets
.filter(facetBucket => facetBucket.label !== bucket.label);
.filter((facetBucket) => facetBucket.label !== bucket.label);
}
}
addFilterQuery(query: string): void {
if (query) {
const existing = this.filterQueries.find(filterQuery => filterQuery.query === query);
const existing = this.filterQueries.find((filterQuery) => filterQuery.query === query);
if (!existing) {
this.filterQueries.push({ query: query });
}
@@ -132,13 +132,13 @@ export class SearchQueryBuilderService {
removeFilterQuery(query: string): void {
if (query) {
this.filterQueries = this.filterQueries
.filter(filterQuery => filterQuery.query !== query);
.filter((filterQuery) => filterQuery.query !== query);
}
}
getFacetQuery(label: string): FacetQuery {
if (label && this.hasFacetQueries) {
const result = this.config.facetQueries.queries.find(query => query.label === label);
const result = this.config.facetQueries.queries.find((query) => query.label === label);
if (result) {
return { ...result };
}
@@ -149,7 +149,7 @@ export class SearchQueryBuilderService {
getFacetField(label: string): FacetField {
if (label) {
const fields = this.config.facetFields.fields || [];
const result = fields.find(field => field.label === label);
const result = fields.find((field) => field.label === label);
if (result) {
return { ...result };
}
@@ -233,7 +233,7 @@ export class SearchQueryBuilderService {
}
protected get sort(): RequestSortDefinitionInner[] {
return this.sorting.map(def => {
return this.sorting.map((def) => {
return {
type: def.type,
field: def.field,
@@ -244,7 +244,7 @@ export class SearchQueryBuilderService {
protected get facetQueries(): FacetQuery[] {
if (this.hasFacetQueries) {
return this.config.facetQueries.queries.map(query => {
return this.config.facetQueries.queries.map((query) => {
return <FacetQuery> { ...query };
});
}
@@ -255,7 +255,7 @@ export class SearchQueryBuilderService {
protected getFinalQuery(): string {
let query = '';
this.categories.forEach(facet => {
this.categories.forEach((facet) => {
const customQuery = this.queryFragments[facet.id];
if (customQuery) {
if (query.length > 0) {
@@ -266,20 +266,20 @@ export class SearchQueryBuilderService {
});
let result = [this.userQuery, query]
.filter(entry => entry)
.filter((entry) => entry)
.join(' AND ');
if (this.userFacetQueries && this.userFacetQueries.length > 0) {
const combined = this.userFacetQueries
.map(userQuery => userQuery.query)
.map((userQuery) => userQuery.query)
.join(' OR ');
result += ` AND (${combined})`;
}
if (this.userFacetBuckets) {
Object.keys(this.userFacetBuckets).forEach(key => {
Object.keys(this.userFacetBuckets).forEach((key) => {
const subQuery = (this.userFacetBuckets[key] || [])
.map(bucket => bucket.filterQuery)
.map((bucket) => bucket.filterQuery)
.join(' OR ');
if (subQuery) {
if (result.length > 0) {
@@ -298,7 +298,7 @@ export class SearchQueryBuilderService {
if (facetFields && facetFields.length > 0) {
return {
facets: facetFields.map(facet => <RequestFacetField> {
facets: facetFields.map((facet) => <RequestFacetField> {
field: facet.field,
mincount: facet.mincount,
label: facet.label,
@@ -105,7 +105,7 @@ export class DropdownSitesComponent implements OnInit {
}
}
this.selected = this.siteList.list.entries.find(site => site.entry.id === this.value);
this.selected = this.siteList.list.entries.find((site) => site.entry.id === this.value);
},
(error) => {
this.logService.error(error);
@@ -41,7 +41,7 @@ export class TagService {
*/
getTagsByNodeId(nodeId: string): any {
return from(this.apiService.getInstance().core.tagsApi.getNodeTags(nodeId)).pipe(
catchError(err => this.handleError(err))
catchError((err) => this.handleError(err))
);
}
@@ -52,7 +52,7 @@ export class TagService {
*/
getAllTheTags(opts?: any): Observable<TagPaging> {
return from(this.apiService.getInstance().core.tagsApi.getTags(opts))
.pipe(catchError(err => this.handleError(err)));
.pipe(catchError((err) => this.handleError(err)));
}
/**
@@ -71,7 +71,7 @@ export class TagActionsComponent implements OnChanges, OnInit, OnDestroy {
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}
@@ -46,7 +46,7 @@ export class TreeViewDataSource {
}
connect(collectionViewer: CollectionViewer): Observable<TreeBaseNode[]> {
this.changeSubscription = this.treeControl.expansionModel.onChange.subscribe(change => {
this.changeSubscription = this.treeControl.expansionModel.onChange.subscribe((change) => {
if ((change as SelectionChange<TreeBaseNode>).added &&
(change as SelectionChange<TreeBaseNode>).added.length > 0) {
this.expandTreeNodes(change as SelectionChange<TreeBaseNode>);
@@ -67,11 +67,11 @@ export class TreeViewDataSource {
}
private expandTreeNodes(change: SelectionChange<TreeBaseNode>) {
change.added.forEach(node => this.expandNode(node));
change.added.forEach((node) => this.expandNode(node));
}
private reduceTreeNodes(change: SelectionChange<TreeBaseNode>) {
change.removed.slice().reverse().forEach(node => this.toggleNode(node));
change.removed.slice().reverse().forEach((node) => this.toggleNode(node));
}
private expandNode(node: TreeBaseNode) {
@@ -82,7 +82,7 @@ export class TreeViewDataSource {
node.expandable = false;
return;
}
const nodes = children.map(actualNode => {
const nodes = children.map((actualNode) => {
actualNode.level = node.level + 1;
return actualNode;
});
@@ -36,7 +36,7 @@ export class TreeViewService {
map((nodePage: NodePaging) => {
return nodePage.list.entries.filter((node) => node.entry.isFolder ? node : null);
}),
map((nodes: NodeEntry[]) => nodes.map(node => new TreeBaseNode(node)))
map((nodes: NodeEntry[]) => nodes.map((node) => new TreeBaseNode(node)))
);
}
@@ -71,7 +71,7 @@ describe('UploadBase', () => {
describe('beginUpload', () => {
it('should raise event', done => {
it('should raise event', (done) => {
spyOn(uploadService, 'addToQueue').and.stub();
spyOn(uploadService, 'uploadFilesInTheQueue').and.stub();
@@ -86,7 +86,7 @@ describe('UploadBase', () => {
spyOn(uploadService, 'uploadFilesInTheQueue').and.stub();
let prevented = false;
component.beginUpload.subscribe(event => {
component.beginUpload.subscribe((event) => {
event.preventDefault();
prevented = true;
});
@@ -105,7 +105,7 @@ describe('UploadBase', () => {
let prevented = false;
let uploadEvent: UploadFilesEvent;
component.beginUpload.subscribe(event => {
component.beginUpload.subscribe((event) => {
uploadEvent = event;
event.preventDefault();
prevented = true;
@@ -132,7 +132,7 @@ describe('UploadBase', () => {
spyOn(uploadService, 'uploadFilesInTheQueue').and.stub();
let uploadEvent: UploadFilesEvent;
component.beginUpload.subscribe(event => {
component.beginUpload.subscribe((event) => {
uploadEvent = event;
event.preventDefault();
});
@@ -95,7 +95,7 @@ export abstract class UploadBase implements OnInit, OnDestroy {
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => subscription.unsubscribe());
this.subscriptions.forEach((subscription) => subscription.unsubscribe());
this.subscriptions = [];
}
@@ -156,7 +156,7 @@ export abstract class UploadBase implements OnInit, OnDestroy {
const allowedExtensions = this.acceptedFilesType
.split(',')
.map(ext => ext.replace(/^\./, ''));
.map((ext) => ext.replace(/^\./, ''));
if (allowedExtensions.indexOf(file.extension) !== -1) {
return true;
@@ -167,7 +167,7 @@ describe('UploadButtonComponent', () => {
component.ngOnChanges({ rootFolderId: new SimpleChange(null, component.rootFolderId, true) });
fixture.detectChanges();
component.success.subscribe(e => {
component.success.subscribe((e) => {
expect(e.value).toEqual('File uploaded');
done();
});
@@ -119,8 +119,8 @@ export class UploadButtonComponent extends UploadBase implements OnInit, OnChang
};
this.contentService.getNode(this.rootFolderId, opts).subscribe(
res => this.permissionValue.next(this.nodeHasPermission(res.entry, PermissionsEnum.CREATE)),
error => this.error.emit(error)
(res) => this.permissionValue.next(this.nodeHasPermission(res.entry, PermissionsEnum.CREATE)),
(error) => this.error.emit(error)
);
}
}
@@ -84,7 +84,7 @@ export class UploadDragAreaComponent extends UploadBase implements NodePermissio
*/
onFolderEntityDropped(folder: any): void {
if (!this.disabled && folder.isDirectory) {
FileUtils.flatten(folder).then(filesInfo => {
FileUtils.flatten(folder).then((filesInfo) => {
this.uploadFilesInfo(filesInfo);
});
}
@@ -117,7 +117,7 @@ export class VersionListComponent implements OnChanges {
minWidth: '250px'
});
dialogRef.afterClosed().subscribe(result => {
dialogRef.afterClosed().subscribe((result) => {
if (result === true) {
this.alfrescoApi.versionsApi
.deleteVersion(this.node.id, versionId)
@@ -101,7 +101,7 @@ describe('VersionManagerComponent', () => {
fixture.detectChanges();
const emittedData = { value: { entry: node }};
component.uploadSuccess.subscribe(event => {
component.uploadSuccess.subscribe((event) => {
expect(event).toBe(node);
});
component.onUploadSuccess(emittedData);