[
https://issues.apache.org/jira/browse/NIFI-16396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matt Gilman updated NIFI-16396:
-------------------------------
Assignee: Matt Gilman
Status: Patch Available (was: Open)
> Migrate connector canvas state and service boundaries to canonical entity
> types
> -------------------------------------------------------------------------------
>
> Key: NIFI-16396
> URL: https://issues.apache.org/jira/browse/NIFI-16396
> Project: Apache NiFi
> Issue Type: Task
> Components: Core UI
> Reporter: Matt Gilman
> Assignee: Matt Gilman
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h2. Background
> The connector canvas currently stores labels, funnels, ports, process groups,
> remote process groups, processors, and connections as any[]. Related actions,
> selectors, effects, and service responses also use permissive any types.
> This prevents the compiler from validating API response handling and allows
> incorrect component shapes to propagate into the canvas.
> h2. Goals
> * Store each connector canvas collection using its canonical entity type.
> * Type the connector flow service response.
> * Remove permissive entity types from connector canvas state, actions,
> effects, reducers, and selectors.
> * Preserve current loading, polling, navigation, selection, and sanitization
> behavior.
> * Establish a typed state boundary for subsequent reusable-canvas work.
> h2. Scope
> h3. Connector Canvas State
> Change the state collections to:
> * labels: LabelEntity[]
> * funnels: FunnelEntity[]
> * inputPorts: PortEntity[]
> * outputPorts: PortEntity[]
> * remoteProcessGroups: RemoteProcessGroupEntity[]
> * processGroups: ProcessGroupEntity[]
> * processors: ProcessorEntity[]
> * connections: ConnectionEntity[]
> h3. Actions and Reducers
> * Type loadConnectorFlowSuccess with concrete entity arrays.
> * Type component-selection and component-configuration action payloads.
> * Remove entity any usage from reducer inputs.
> * Preserve collection replacement and route-change reset behavior.
> * Ensure state updates remain immutable.
> h3. Service Boundary
> * Define ProcessGroupFlowEntity and FlowDTO response contracts.
> * Change ConnectorService.getConnectorFlow() from Observable<any> to
> Observable<ProcessGroupFlowEntity>.
> * Type the nested processGroupFlow, breadcrumb, parent group, and component
> collections.
> * Type child input-port and output-port retrieval without Observable<any> or
> callback parameter casts.
> h3. Effects and Selectors
> * Remove collection casts from connector flow loading.
> * Type position and bend sanitization helpers.
> * Type entity-by-id selectors.
> * Type connection cloning and bend copying.
> * Type provenance eligibility and component-configuration lookups from the
> concrete entity union.
> * Preserve polling and error handling behavior.
> h3. Tests and Linting
> * Add reusable typed factories for each connector canvas entity kind.
> * Replace permissive test fixtures and action casts with the typed factories.
> * Enable no-explicit-any for the migrated connector canvas state directory.
> * Cover readable and unreadable component entities where relevant.
> h2. Out of Scope
> * Retyping reusable-canvas wrappers, renderers, and gesture handlers.
> * Adding connector troubleshooting operations.
> * Changing REST endpoint behavior.
> * Changing canvas rendering or interaction behavior.
> * Migrating the legacy flow-designer canvas.
> h2. Acceptance Criteria
> * ConnectorCanvasState contains no any[] component collections.
> * loadConnectorFlowSuccess uses concrete entity arrays.
> * ConnectorService.getConnectorFlow() returns
> Observable<ProcessGroupFlowEntity>.
> * Connector flow effects do not cast API collections to entity types.
> * Connector canvas selectors do not use any callback parameters.
> * Component configuration and provenance lookups use canonical entity types.
> * Position and bend sanitization remain behaviorally unchanged and are fully
> typed.
> * Existing polling, navigation, loading, and error behavior remains unchanged.
> * Typed factories replace permissive fixtures in affected tests.
> * no-explicit-any is enabled for the migrated state directory.
> * Frontend lint, strict type-check, unit tests, and production build pass.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)