scottyaslan commented on code in PR #8401:
URL: https://github.com/apache/nifi/pull/8401#discussion_r1488041318


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts:
##########
@@ -348,14 +352,78 @@ export class FlowEffects {
                         this.flowService.goToRemoteProcessGroup(request);
                     } else {
                         this.store.dispatch(
-                            showOkDialog({ title: 'Remote Process Group', 
message: 'No target URI defined.' })
+                            FlowActions.showOkDialog({
+                                title: 'Remote Process Group',
+                                message: 'No target URI defined.'
+                            })
                         );
                     }
                 })
             ),
         { dispatch: false }
     );
 
+    startRemoteProcessGroupPolling$ = createEffect(() =>
+        this.actions$.pipe(
+            ofType(FlowActions.startRemoteProcessGroupPolling),
+            switchMap((request) => {
+                return interval(3000, asyncScheduler).pipe(
+                    
takeUntil(this.actions$.pipe(ofType(FlowActions.stopRemoteProcessGroupPolling)))
+                );
+            }),
+            switchMap(() => {
+                return of(FlowActions.refreshRemoteProcessGroup());
+            })
+        )
+    );
+
+    requestRemoteProcessGroupPolling$ = createEffect(() =>
+        this.actions$.pipe(
+            ofType(FlowActions.requestRemoteProcessGroupPolling),
+            switchMap(() => {
+                return of(FlowActions.startRemoteProcessGroupPolling());
+            })
+        )
+    );
+
+    refreshRemoteProcessGroup$ = createEffect(() =>
+        this.actions$.pipe(
+            ofType(FlowActions.refreshRemoteProcessGroup),
+            concatLatestFrom(() => this.store.select(selectRpgToPoll)),
+            map(([, rpgToPoll]) => {
+                return rpgToPoll;
+            }),
+            isDefinedAndNotNull(),
+            switchMap((rpgToPoll) =>
+                from(
+                    this.flowService.getRemoteProcessGroup(rpgToPoll.id).pipe(
+                        map((response: any) => {
+                            const entity = response;
+
+                            if (rpgToPoll.refreshTimestamp !== 
response.component.flowRefreshed) {
+                                
this.store.dispatch(FlowActions.stopRemoteProcessGroupPolling());
+                            } else {
+                                entity.component.flowRefreshed = 
'Refreshing...';
+                            }
+
+                            return FlowActions.loadRemoteProcessGroupSuccess({
+                                response: {
+                                    id: entity.id,
+                                    remoteProcessGroup: entity
+                                }
+                            });
+                        }),
+                        catchError((errorResponse: HttpErrorResponse) => {
+                            
this.store.dispatch(FlowActions.stopRemoteProcessGroupPolling());
+
+                            return 
of(this.errorHelper.handleLoadingError(status, errorResponse));

Review Comment:
   I think this is a copy past error...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to