markobean commented on code in PR #11582:
URL: https://github.com/apache/nifi/pull/11582#discussion_r4050623868


##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/state/flow/flow.effects.ts:
##########
@@ -3180,6 +3183,96 @@ export class FlowEffects {
         { dispatch: false }
     );
 
+    /**
+     * Loads the flow of the group that defines the requested component's 
connections and retains only
+     * the connections attached to that component in the requested direction. 
The group is the one on
+     * the canvas for most components, and the parent group for the two port 
cases whose connections
+     * cross the enclosing group's boundary.
+     *
+     * Matching goes through the canvas' own endpoint resolvers rather than 
comparing the raw ids. A
+     * connection drawn to a Process Group or Remote Process Group actually 
terminates at a port inside
+     * it, and 
getConnectionSourceComponentId/getConnectionDestinationComponentId are what 
collapse that
+     * port back to the group the user sees and selects. They compare against 
the group currently on the
+     * canvas, which is the right frame of reference for the parent-group 
searches too: a connection
+     * into an Input Port carries that port's own group as its destination 
group, so it resolves to the
+     * port rather than to the group.
+     *
+     *
+     * Both resolvers read the ids on the connection entity rather than on its 
component, so a
+     * connection the current user cannot read — the kind most worth reporting 
— is still matched.
+     */
+    viewComponentConnections$ = createEffect(() =>
+        this.actions$.pipe(
+            ofType(FlowActions.viewComponentConnections),
+            map((action) => action.request),
+            switchMap((request) => {
+                const attachedTo = (connection: ConnectionEntity): boolean =>
+                    request.direction === 'upstream'
+                        ? 
this.canvasUtils.getConnectionDestinationComponentId(connection) === request.id
+                        : 
this.canvasUtils.getConnectionSourceComponentId(connection) === request.id;
+
+                return from(this.flowService.getFlow(request.groupId)).pipe(
+                    map((flowEntity: ProcessGroupFlowEntity) =>
+                        FlowActions.openComponentConnectionsDialog({
+                            request: {
+                                componentName: request.name,
+                                componentType: request.type,
+                                groupId: request.groupId,
+                                direction: request.direction,
+                                connections: 
flowEntity.processGroupFlow.flow.connections.filter(attachedTo),
+                                groupIdToName: 
this.buildProcessGroupIdToNameMap(flowEntity),
+                                remoteProcessGroupIds: 
this.buildRemoteProcessGroupIdSet(flowEntity),

Review Comment:
   Resolved. `npx ns run nifi:lint` is clean.



-- 
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