mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
various code quality fixes (#5792)
* various code quality fixes * reduce duplicated code * add safety check
This commit is contained in:
@@ -365,11 +365,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
|
||||
}
|
||||
|
||||
this.executeOutcome.emit(args);
|
||||
if (args.defaultPrevented) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return !args.defaultPrevented;
|
||||
}
|
||||
|
||||
protected storeFormAsMetadata() {
|
||||
|
@@ -46,7 +46,7 @@ export class ContentCloudNodeSelectorService {
|
||||
actionName: 'Choose',
|
||||
currentFolderId: '-my-',
|
||||
select,
|
||||
isSelectionValid: this.isNodeFile.bind(this),
|
||||
isSelectionValid: (entry: Node) => entry.isFile,
|
||||
showFilesInResult: true
|
||||
};
|
||||
|
||||
@@ -61,8 +61,4 @@ export class ContentCloudNodeSelectorService {
|
||||
close() {
|
||||
this.dialog.closeAll();
|
||||
}
|
||||
|
||||
private isNodeFile(entry: Node): boolean {
|
||||
return entry && entry.isFile;
|
||||
}
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ export class CancelProcessDirective implements OnInit, OnDestroy {
|
||||
@HostListener('click')
|
||||
async onClick() {
|
||||
try {
|
||||
this.cancelProcess();
|
||||
await this.cancelProcess();
|
||||
} catch (error) {
|
||||
this.error.emit(error);
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ export class ClaimTaskCloudDirective implements OnInit {
|
||||
@HostListener('click')
|
||||
async onClick() {
|
||||
try {
|
||||
this.claimTask();
|
||||
await await this.claimTask();
|
||||
} catch (error) {
|
||||
this.error.emit(error);
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ export class UnClaimTaskCloudDirective implements OnInit {
|
||||
@HostListener('click')
|
||||
async onClick() {
|
||||
try {
|
||||
this.unclaimTask();
|
||||
await this.unclaimTask();
|
||||
} catch (error) {
|
||||
this.error.emit(error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user