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 658b630af5d3..4523342af89c 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 @@ -2819,17 +2819,36 @@ 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), + this.store.select(selectCurrentProcessGroupId) + ]), + filter( + ([, parentProcessGroupId, currentProcessGroupId]) => + parentProcessGroupId != null && currentProcessGroupId != null ), - { dispatch: false } + switchMap(([, parentProcessGroupId, currentProcessGroupId]) => { + this.router.navigate(['/process-groups', parentProcessGroupId]); + + return this.actions$.pipe( + ofType(FlowActions.loadProcessGroupComplete), + take(1), + map(() => + FlowActions.navigateWithoutTransform({ + url: [ + '/process-groups', + parentProcessGroupId!, + ComponentType.ProcessGroup, + currentProcessGroupId! + ] + }) + ) + ); + }) + ) ); addSelectedComponents$ = createEffect(() => 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 7459bb905801..29919261dc5e 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 @@ -154,9 +154,13 @@ export class Canvas implements OnInit, OnDestroy { filter((status) => status === 'complete'), switchMap(() => this.store.select(selectCurrentProcessGroupId)), distinctUntilChanged(), - switchMap(() => this.store.select(selectProcessGroupRoute)), - filter((processGroupRoute) => processGroupRoute != null), - concatLatestFrom(() => this.store.select(selectSkipTransform)), + switchMap(() => + this.store.select(selectProcessGroupRoute).pipe( + filter((processGroupRoute) => processGroupRoute != null), + take(1) + ) + ), + concatLatestFrom(() => [this.store.select(selectSkipTransform)]), takeUntilDestroyed() ) .subscribe(([, skipTransform]) => {