NIFI-15823: Adding the proveance preview component into the connector…#11238
Open
mcgilman wants to merge 1 commit into
Open
NIFI-15823: Adding the proveance preview component into the connector…#11238mcgilman wants to merge 1 commit into
mcgilman wants to merge 1 commit into
Conversation
… canvas graph controls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… canvas graph controls.
Summary
NIFI-15823
Adds a Provenance preview card to the connector canvas graph-controls side panel, sitting directly below the existing Connector info card. When a provenance-eligible component is selected on the canvas, the card lists the latest provenance events for that component and offers the standard per-event actions (view details, view/download input/output content, replay). The preview is implemented as a new reusable presentation component under
apps/nifi/src/app/ui/common/so it can be hosted by any page that already mounts the reusable<reusable-canvas>, and is backed by a new feature-scoped NgRx slice that lives with the connector canvas.What changed
New reusable component (
apps/nifi/src/app/ui/common/provenance-preview/)ProvenancePreview— amat-expansion-panelshell containing a compact table of recent provenance events. Owns its own collapsed state and persists it undergraph-control-visibility[<storageKey>]via the sharedStorageservice. ThestorageKeyinput is configurable so independent instances on different pages do not collide (the connector canvas passesconnector-provenance-control). Cluster-aware: when multiple nodes are reporting events the panel exposes a node-filter dropdown sourced fromconnectedToCluster+ the events themselves. Surfaces a per-row action menu (View Details / View Input / View Output / Download Input / Download Output / Replay) with each item conditionally enabled based oncontentViewerAvailable,inputContentAvailable,outputContentAvailable, andreplayAvailable. Pure presentation -- all intent flows out asoutput()events (refresh,collapsedChange,viewDetails,viewContent,downloadContent,replayEvent) so the host page owns the side effects (the "emit, don't dispatch" rule).New NgRx state slice (
pages/connectors/state/connector-provenance-preview/)connectorProvenancePreviewFeatureKeyregistered alongsideconnectorCanvasinConnectorCanvasModule. State shape is{ events, error, status }with a'pending' | 'loading' | 'success' | 'error'status machine.loadLatestEventsForComponent,openProvenanceEventDialog,downloadContent,viewContent,replayEvent,showOkDialog, andresetState. Effects reuse the existingProvenanceService,ProvenanceEventDialog,OkDialog, andErrorHelper; replay failures surface through the standardErrorActions.addBannerErrorchannel withErrorContextKey.CONNECTOR_CANVAS. Module-scoped (forFeature) so the slice activates with the connector canvas and tears down when leaving.getLatestEventsForComponent(componentId)to the sharedProvenanceService, calling the existing/provenance-events/latest/{id}REST endpoint.Wiring into the connector canvas (
pages/connectors/ui/connector-canvas/)connector-graph-controlsnow hosts<provenance-preview storageKey="connector-provenance-control" …>below the Connector info card, guarded by@if (canAccessProvenance())so it is not rendered for users withoutprovenancePermissions.canRead. All inputs/outputs are forwarded through the parent shell unchanged.connector-canvas.component.tswires the slice into the page:provenanceEvents/provenanceStatus/provenanceError, plusconnectedToCluster(fromselectClusterSummary) andcontentViewerAvailable(fromselectAbout).combineLatestof route params, input ports, and output ports and reduces them throughcomputeEligibleProvenanceId(...)to a single eligible component id. Eligible types:Processor,Connection,RemoteProcessGroup;InputPort/OutputPortare only eligible whenallowRemoteAccess === true. Everything else (Funnel, Label, ProcessGroup, multi-select, no selection) clears the preview viaresetState.graphControlsOpen(existing) and aprovenanceCollapsedmirror (updated only via the child's(collapsedChange)output). Eligibility changes only dispatchloadLatestEventsForComponentwhen both flags allow it; otherwise the component id is parked inlastDeferredComponentIdand flushed when the user either opens the side panel (toggleGraphControls) or expands the card (onProvenanceCollapsedChange(false)). This avoids issuing the network call -- and showing skeleton rows -- for users who keep the card collapsed.viewDetails -> openProvenanceEventDialog,downloadContent -> downloadContent,viewContent -> viewContent,replayEvent -> replayEvent,refresh -> loadLatestEventsForComponentfor the current eligible id.ngOnDestroydispatchesresetStatealongside the existing canvas / entity resets.Architectural note for reviewers
The card follows the same separation-of-concerns pattern as the sibling cards added in this series (
CanvasNavigationControl,ConnectorInfoControl): the child owns its own collapsed state and persists it via the sharedgraph-control-visibilitybag keyed by itsstorageKeyinput, and only emits intent. The page hosts a small in-memory mirror of that flag for one reason -- it gates an eager network call. That mirror starts collapsed-by-default and is updated solely through the child's(collapsedChange)output, so persistence stays single-owner in the child.The new NgRx slice deliberately lives under
pages/connectors/state/rather than the global provenance module: it is short-lived (registered withforFeature, reset on every selection change and on destroy), and its dialog/replay handlers are connector-canvas specific (they route errors toErrorContextKey.CONNECTOR_CANVAS). Reusing the existingProvenanceServicekeeps the REST surface unchanged.