mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
Sonarcloud issues fixes (#3499)
* Sonarcloud issues fixes * Code smell fixes * Refactoring to remove new code duplications * Sonarcloud code smell fixes part I * Sonarcloud code smell fixes part II * Missing code smell fix * Add new ESLint rules to cover fixed SonarCloud issues * Add missing command * Add missing is existing check
This commit is contained in:
@@ -130,7 +130,7 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes.nodeResult && changes.nodeResult.currentValue) {
|
||||
if (changes.nodeResult?.currentValue) {
|
||||
this.nodeResult = changes.nodeResult.currentValue;
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
|
||||
}
|
||||
|
||||
showPreview(node: NodeEntry, extras?: ViewNodeExtras) {
|
||||
if (node && node.entry) {
|
||||
if (node?.entry) {
|
||||
if (this.fileAutoDownloadService?.shouldFileAutoDownload(node.entry?.content?.sizeInBytes)) {
|
||||
this.fileAutoDownloadService.autoDownloadFile(node);
|
||||
} else {
|
||||
|
@@ -91,10 +91,6 @@ class DocumentBasePageServiceMock extends DocumentBasePageService {
|
||||
class TestComponent extends PageComponent {
|
||||
node: any;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
addSubscription(entry: Subscription) {
|
||||
this.subscriptions.push(entry);
|
||||
}
|
||||
|
@@ -74,6 +74,6 @@ export class ToolbarButtonComponent {
|
||||
}
|
||||
|
||||
private hasClickAction(actionRef: ContentActionRef): boolean {
|
||||
return !!(actionRef && actionRef.actions && actionRef.actions.click);
|
||||
return !!actionRef?.actions?.click;
|
||||
}
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ export class ToolbarMenuItemComponent {
|
||||
}
|
||||
|
||||
private hasClickAction(actionRef: ContentActionRef): boolean {
|
||||
return !!(actionRef && actionRef.actions && actionRef.actions.click);
|
||||
return !!actionRef?.actions?.click;
|
||||
}
|
||||
|
||||
trackByActionId(_: number, obj: ContentActionRef): string {
|
||||
|
Reference in New Issue
Block a user