mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +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:
@@ -83,10 +83,10 @@ export class LocationLinkComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
if (this.context) {
|
||||
const node: NodeEntry = this.context.row.node;
|
||||
if (node && node.entry && node.entry.path) {
|
||||
if (node?.entry && node?.entry?.path) {
|
||||
const path = node.entry.path;
|
||||
|
||||
if (path && path.name && path.elements) {
|
||||
if (path?.name && path?.elements) {
|
||||
if (this.showLocation) {
|
||||
this.displayText = of(path.name.substring(1).replace(/\//g, ' › '));
|
||||
} else {
|
||||
@@ -144,7 +144,9 @@ export class LocationLinkComponent implements OnInit {
|
||||
|
||||
let result: string = null;
|
||||
|
||||
const elements = path.elements.map((e) => Object.assign({}, e));
|
||||
const elements = path.elements.map((e) => {
|
||||
return { ...e };
|
||||
});
|
||||
const personalFiles = this.translationService.instant('APP.BROWSE.PERSONAL.TITLE');
|
||||
const fileLibraries = this.translationService.instant('APP.BROWSE.LIBRARIES.TITLE');
|
||||
|
||||
|
@@ -62,7 +62,7 @@ export class ToggleSharedComponent implements OnInit, OnDestroy {
|
||||
this.selectionState = selectionState;
|
||||
|
||||
this.isShared =
|
||||
(this.selectionState.first && this.selectionState.first.entry && (this.selectionState.first.entry as any).sharedByUser) ||
|
||||
(this.selectionState?.first?.entry && (this.selectionState.first.entry as any).sharedByUser) ||
|
||||
!!this.selectionState?.first?.entry?.properties?.['qshare:sharedId'];
|
||||
|
||||
this.selectionLabel = this.isShared ? 'APP.ACTIONS.SHARE_EDIT' : 'APP.ACTIONS.SHARE';
|
||||
|
Reference in New Issue
Block a user