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

@@ -227,7 +227,7 @@ describe('ContentAction', () => {
});
it('should find document action handler via service', () => {
const handler = <ContentActionHandler> function (obj: any, target?: any) {
const handler = <ContentActionHandler> function () {
};
const action = new ContentActionComponent(actionList, documentActions, null);
spyOn(documentActions, 'getHandler').and.returnValue(handler);
@@ -235,7 +235,7 @@ describe('ContentAction', () => {
});
it('should find folder action handler via service', () => {
const handler = <ContentActionHandler> function (obj: any, target?: any) {
const handler = <ContentActionHandler> function () {
};
const action = new ContentActionComponent(actionList, null, folderActions);
spyOn(folderActions, 'getHandler').and.returnValue(handler);

View File

@@ -852,7 +852,7 @@ describe('DocumentList', () => {
let called = false;
documentList.navigationMode = DocumentListComponent.SINGLE_CLICK_NAVIGATION;
documentList.preview.subscribe((val) => called = true);
documentList.preview.subscribe(() => called = true);
documentList.onNodeClick(file);
expect(called).toBeFalsy();
@@ -1025,7 +1025,7 @@ describe('DocumentList', () => {
it('should emit node-click DOM event', (done) => {
const node = new NodeMinimalEntry();
document.addEventListener('node-click', (customEvent: CustomEvent) => {
document.addEventListener('node-click', () => {
done();
});
@@ -1043,7 +1043,7 @@ describe('DocumentList', () => {
it('should emit node-dblclick DOM event', (done) => {
const node = new NodeMinimalEntry();
document.addEventListener('node-dblclick', (customEvent: CustomEvent) => {
document.addEventListener('node-dblclick', () => {
done();
});

View File

@@ -97,7 +97,7 @@ export class ShareDataRow implements DataRow {
return ObjectUtils.getValue(this.obj.entry, key);
}
imageErrorResolver(event: Event): any {
imageErrorResolver(): any {
if (this.obj.entry.content) {
return this.thumbnailService.getMimeTypeIcon(this.obj.entry.content.mimeType);
}

View File

@@ -38,19 +38,19 @@ class FakeSanitizer extends DomSanitizer {
return value;
}
bypassSecurityTrustStyle(value: string): any {
bypassSecurityTrustStyle(): any {
return null;
}
bypassSecurityTrustScript(value: string): any {
bypassSecurityTrustScript(): any {
return null;
}
bypassSecurityTrustUrl(value: string): any {
bypassSecurityTrustUrl(): any {
return null;
}
bypassSecurityTrustResourceUrl(value: string): any {
bypassSecurityTrustResourceUrl(): any {
return null;
}
}

View File

@@ -57,7 +57,7 @@ describe('DocumentActionsService', () => {
});
it('should register custom action handler', () => {
const handler: ContentActionHandler = function (obj: any) {
const handler: ContentActionHandler = function () {
};
service.setHandler('<key>', handler);
expect(service.getHandler('<key>')).toBe(handler);
@@ -68,7 +68,7 @@ describe('DocumentActionsService', () => {
});
it('should be case insensitive for keys', () => {
const handler: ContentActionHandler = function (obj: any) {
const handler: ContentActionHandler = function () {
};
service.setHandler('<key>', handler);
expect(service.getHandler('<KEY>')).toBe(handler);
@@ -94,7 +94,7 @@ describe('DocumentActionsService', () => {
});
it('should set new handler only by key', () => {
const handler: ContentActionHandler = function (obj: any) {
const handler: ContentActionHandler = function () {
};
expect(service.setHandler(null, handler)).toBeFalsy();
expect(service.setHandler('', handler)).toBeFalsy();

View File

@@ -89,27 +89,27 @@ export class DocumentActionsService {
this.handlers['lock'] = this.lockNode.bind(this);
}
private lockNode(node: NodeEntry, target?: any, permission?: string) {
private lockNode(node: NodeEntry) {
return this.contentNodeDialogService.openLockNodeDialog(node.entry);
}
private downloadNode(obj: NodeEntry, target?: any, permission?: string) {
private downloadNode(obj: NodeEntry) {
this.nodeActionsService.downloadNode(obj);
}
private copyNode(node: NodeEntry, target?: any, permission?: string) {
private copyNode(node: NodeEntry, _target?: any, permission?: string) {
const actionObservable = this.nodeActionsService.copyContent(node.entry, permission);
this.prepareHandlers(actionObservable, 'content', 'copy', target, permission);
this.prepareHandlers(actionObservable);
return actionObservable;
}
private moveNode(node: NodeEntry, target?: any, permission?: string) {
private moveNode(node: NodeEntry, _target?: any, permission?: string) {
const actionObservable = this.nodeActionsService.moveContent(node.entry, permission);
this.prepareHandlers(actionObservable, 'content', 'move', target, permission);
this.prepareHandlers(actionObservable);
return actionObservable;
}
private prepareHandlers(actionObservable, type: string, action: string, target?: any, permission?: string): void {
private prepareHandlers(actionObservable): void {
actionObservable.subscribe(
(fileOperationMessage) => {
this.success.next(fileOperationMessage);
@@ -118,7 +118,7 @@ export class DocumentActionsService {
);
}
private deleteNode(node: NodeEntry, target?: any, permission?: string): Observable<any> {
private deleteNode(node: NodeEntry, _target?: any, permission?: string): Observable<any> {
let handlerObservable;
if (this.canExecuteAction(node)) {

View File

@@ -92,17 +92,17 @@ export class FolderActionsService {
private copyNode(nodeEntry: NodeEntry, target?: any, permission?: string) {
const actionObservable = this.nodeActionsService.copyFolder(nodeEntry.entry, permission);
this.prepareHandlers(actionObservable, 'folder', 'copy', target, permission);
this.prepareHandlers(actionObservable, target);
return actionObservable;
}
private moveNode(nodeEntry: NodeEntry, target?: any, permission?: string) {
const actionObservable = this.nodeActionsService.moveFolder(nodeEntry.entry, permission);
this.prepareHandlers(actionObservable, 'folder', 'move', target, permission);
this.prepareHandlers(actionObservable, target);
return actionObservable;
}
private prepareHandlers(actionObservable, type: string, action: string, target?: any, permission?: string): void {
private prepareHandlers(actionObservable, target?: any): void {
actionObservable.subscribe(
(fileOperationMessage) => {
if (target && typeof target.reload === 'function') {

View File

@@ -104,7 +104,7 @@ describe('NodeActionsService', () => {
spyOn(documentListService, 'copyNode').and.returnValue(throwError('FAKE-KO'));
spyOn(contentDialogService, 'openCopyMoveDialog').and.returnValue(of([fakeNode]));
service.copyFolder(fakeNode, '!allowed').subscribe((value) => {
service.copyFolder(fakeNode, '!allowed').subscribe(() => {
}, (error) => {
expect(error).toBe('FAKE-KO');
});