From 22f48f7dd9763a6f465873c4700ea6b43c0c3415 Mon Sep 17 00:00:00 2001 From: dominikiwanekhyland <141320833+dominikiwanekhyland@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:38:43 +0200 Subject: [PATCH] Refactor injections in effects (#4137) --- .../src/lib/store/effects/node.effects.ts | 56 +++++++++---------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/projects/aca-content/src/lib/store/effects/node.effects.ts b/projects/aca-content/src/lib/store/effects/node.effects.ts index 816b2f75e0..a2378beae9 100644 --- a/projects/aca-content/src/lib/store/effects/node.effects.ts +++ b/projects/aca-content/src/lib/store/effects/node.effects.ts @@ -22,36 +22,36 @@ * from Hyland Software. If not, see . */ -import { Actions, ofType, createEffect } from '@ngrx/effects'; -import { Injectable, SecurityContext } from '@angular/core'; +import { Actions, createEffect, ofType } from '@ngrx/effects'; +import { inject, Injectable, SecurityContext } from '@angular/core'; import { first, map, take } from 'rxjs/operators'; import { Store } from '@ngrx/store'; import { AppStore, - NodeActionTypes, - PurgeDeletedNodesAction, - DeleteNodesAction, - UndoDeleteNodesAction, + CopyNodesAction, CreateFolderAction, + DeleteNodesAction, EditFolderAction, - RestoreDeletedNodesAction, - ShareNodeAction, - ManageVersionsAction, - UnlockWriteAction, - UnshareNodesAction, - CopyNodesAction, - MoveNodesAction, - ManagePermissionsAction, - PrintFileAction, - getCurrentFolder, + ExpandInfoDrawerAction, getAppSelection, + getCurrentFolder, ManageAspectsAction, - NavigateRouteAction, - ExpandInfoDrawerAction, + ManagePermissionsAction, ManageRulesAction, - ShowLoaderAction, + ManageVersionsAction, + MoveNodesAction, + NavigateRouteAction, + NavigateUrlAction, + NodeActionTypes, + PrintFileAction, + PurgeDeletedNodesAction, + RestoreDeletedNodesAction, SetInfoDrawerStateAction, - NavigateUrlAction + ShareNodeAction, + ShowLoaderAction, + UndoDeleteNodesAction, + UnlockWriteAction, + UnshareNodesAction } from '@alfresco/aca-shared/store'; import { ContentManagementService } from '../../services/content-management.service'; import { RenditionService } from '@alfresco/adf-content-services'; @@ -60,15 +60,13 @@ import { DomSanitizer } from '@angular/platform-browser'; @Injectable() export class NodeEffects { - constructor( - private store: Store, - private actions$: Actions, - private router: Router, - private contentService: ContentManagementService, - private renditionViewer: RenditionService, - private activatedRoute: ActivatedRoute, - private sanitizer: DomSanitizer - ) {} + private readonly store = inject(Store); + private readonly actions$ = inject(Actions); + private readonly router = inject(Router); + private readonly contentService = inject(ContentManagementService); + private readonly renditionViewer = inject(RenditionService); + private readonly activatedRoute = inject(ActivatedRoute); + private readonly sanitizer = inject(DomSanitizer); shareNode$ = createEffect( () =>