From 13b0ec3c721b360e4da465fdff92fc40c7d97bd2 Mon Sep 17 00:00:00 2001 From: Homer Rich Date: Fri, 4 Apr 2025 13:57:06 +0000 Subject: [PATCH] NIFI-14191 Added the previous process group to the end of the leave process group for easier navigation --- .../flow-designer/state/flow/flow.effects.ts | 29 ++++++++++++------- .../ui/canvas/canvas.component.ts | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts index 454206f5fb17..c310fe98c712 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts @@ -2808,16 +2808,25 @@ export class FlowEffects { { dispatch: false } ); - leaveProcessGroup$ = createEffect( - () => - this.actions$.pipe( - ofType(FlowActions.leaveProcessGroup), - concatLatestFrom(() => this.store.select(selectParentProcessGroupId)), - filter(([, parentProcessGroupId]) => parentProcessGroupId != null), - tap(([, parentProcessGroupId]) => { - this.router.navigate(['/process-groups', parentProcessGroupId]); - }) - ), + leaveProcessGroup$ = createEffect(() => + this.actions$.pipe( + ofType(FlowActions.leaveProcessGroup), + concatLatestFrom(() => [ + this.store.select(selectParentProcessGroupId).pipe(isDefinedAndNotNull()), + this.store.select(selectCurrentProcessGroupId).pipe(isDefinedAndNotNull()), + ]), + tap(([,parentProcessGroupId, currentProcessGroupId]) => { + this.store.dispatch( + FlowActions.navigateWithoutTransform({ url: [ + 'process-groups', + parentProcessGroupId, + ComponentType.ProcessGroup, + currentProcessGroupId + ] + }) + ) + }), + ), { dispatch: false } ); diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/canvas.component.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/canvas.component.ts index 0272a925e932..65a1d699dacc 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/canvas.component.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/canvas.component.ts @@ -172,7 +172,7 @@ export class Canvas implements OnInit, OnDestroy { if (skipTransform) { this.store.dispatch(setSkipTransform({ skipTransform: false })); } else { - this.store.dispatch(centerSelectedComponents({ request: { allowTransition } })); + this.store.dispatch(restoreViewport()); } });