various code quality fixes (#5792)

* various code quality fixes

* reduce duplicated code

* add safety check
This commit is contained in:
Denys Vuika
2020-06-18 17:57:46 +01:00
committed by GitHub
parent dc2060fe49
commit e9350bd297
54 changed files with 96 additions and 154 deletions

View File

@@ -210,7 +210,7 @@ export class ContentNodeDialogService {
actionName: action,
currentFolderId: contentEntry.id,
imageResolver: this.imageResolver.bind(this),
isSelectionValid: this.isNodeFile.bind(this),
isSelectionValid: (entry: Node) => entry.isFile,
select: select,
showFilesInResult
};
@@ -234,10 +234,6 @@ export class ContentNodeDialogService {
return null;
}
private isNodeFile(entry: Node): boolean {
return entry.isFile;
}
private hasAllowableOperationsOnNodeFolder(entry: Node): boolean {
return this.isNodeFolder(entry) && this.contentService.hasAllowableOperations(entry, 'create');
}