Skip to content

NIFI-15817: Adding support for view the flow managed by a Connector i…#11127

Merged
rfellows merged 2 commits intoapache:mainfrom
mcgilman:NIFI-15817
Apr 13, 2026
Merged

NIFI-15817: Adding support for view the flow managed by a Connector i…#11127
rfellows merged 2 commits intoapache:mainfrom
mcgilman:NIFI-15817

Conversation

@mcgilman
Copy link
Copy Markdown
Contributor

…n a new reusable component.

Summary

Adds a reusable canvas engine and connector canvas page to the NiFi frontend, enabling users to view the internal flow managed by a connector in a read-only canvas.

Reusable Canvas Engine (ui/common/canvas/)

A D3-based graph rendering component that can be consumed by any page needing to display a NiFi flow. Includes:

  • Canvas component — D3 zoom/pan, box selection, viewport persistence, signal-based inputs/outputs, birdseye public API
  • 7 rendering layers — Processors, connections, process groups, remote process groups, ports, funnels, and labels, each with their own SVG renderer
  • Supporting utilities — Text ellipsis, format utils, component utils, overlap detection, canvas constants and types
  • Global canvasUi state slice — NgRx feature state for transform and feature flags (canEdit/canSelect) shared across canvas consumers

Connector Canvas Page (pages/connectors/ui/connector-canvas/)

A read-only view of a connector's internal flow, accessible at /connectors/:id/canvas/:processGroupId. Includes:

  • Page shell with global navigation header, error state handling, and dataReady gating
  • NgRx state managementconnectorCanvas (flow data, breadcrumbs, PG navigation) and connectorCanvasEntity (connector metadata) feature states
  • Routing — Root guard that resolves the connector's managedProcessGroupId, redirector component, child routes for selection and PG navigation
  • Process group navigation — Double-click to enter child groups, Escape to return to parent, with canNavigateToParent gating
  • Keyboard shortcuts — Escape (leave group) and Ctrl/Cmd+R (refresh flow) with guards for dialogs and input elements
  • API integrationConnectorService.getConnectorFlow() for loading flow data

Other Changes

  • VersionControlTip relocated from pages/flow-designer/ui/common/tooltips/ to ui/common/tooltips/ to avoid cross-page imports from the reusable canvas
  • navigateToViewConnector effect updated to navigate to the canvas (replaces window.alert placeholder)

Feature Gating

All changes are behind the existing enableConnectors feature flag (environment.enableConnectors). The /connectors route uses connectorsFeatureGuard (canMatch), so the canvas page and its lazy-loaded module are unreachable when the flag is off.

Testing

17 spec files with comprehensive coverage:

  • Connector canvas — component, effects, reducers, selectors, guard, and redirector specs
  • Reusable canvas — canvas component spec (birdseye API, zoom, viewport, selection), all 7 renderer specs, overlap detection utils spec

@mcgilman mcgilman added the ui Pull requests for work relating to the user interface label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@rfellows rfellows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice @mcgilman. I just noted a couple of differences in how process groups and remote process groups render their titles on the new canvas vs the flow designer canvas.

Overall this is a nice incremental feature. I look forward to this becoming more fully-featured... and eventually replacing the flow designer canvas 🤞

// Process group name
pgGroups
.append('text')
.attr('class', 'process-group-name secondary-contrast font-semibold')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want the font-semibold here. The flow designer canvas doesn't have this class and it makes a fairly noticeable difference between the 2.

// Remote process group name
rpgGroups
.append('text')
.attr('class', 'remote-process-group-name secondary-contrast font-semibold')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want the font-semibold here. The flow designer canvas doesn't have this class.

Copy link
Copy Markdown
Contributor

@rfellows rfellows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @mcgilman 👍

@rfellows rfellows merged commit d7722d2 into apache:main Apr 13, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui Pull requests for work relating to the user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants