mcgilman opened a new pull request, #11263:
URL: https://github.com/apache/nifi/pull/11263

   # Summary
   
   JIRA: [NIFI-15931](https://issues.apache.org/jira/browse/NIFI-15931)
   
   Surfaces parameter values inline in the Connector canvas so property tables 
and the codemirror parameter tip can resolve `#{param}` references without 
leaving the canvas. Read-only by design: values render in tooltips, but the "Go 
to Parameter" affordance is hidden because connector-managed parameter contexts 
are not navigable.
   
   # Description
   
   ## Backend
   
   - New REST endpoint `GET 
/connectors/{connectorId}/flow/process-groups/{processGroupId}/parameter-context`
 on `ConnectorResource`. Requires `READ` on the connector, returns a 
`ParameterContextEntity` for the PG's bound context, or `204 No Content` when 
no context is bound. Sensitive values are masked via the existing `DtoFactory` 
path.
   - `NiFiServiceFacade#getConnectorParameterContext` and its 
`StandardNiFiServiceFacade` implementation look up the `ConnectorNode`, locate 
the target `ProcessGroup`, and return its bound `ParameterContext`.
   - `DtoFactory#createParameterDto` now walks the in-memory inheritance graph 
of the supplied `ParameterContext` to populate `containingParameterContext` 
(with cycle protection), falling back to the supplied `ParameterContextLookup` 
only when no in-memory match is found. This is required because 
connector-managed parameter contexts are not registered in the global 
`ParameterContextDAO`, so the previous lookup-only path returned "Unable to 
find Parameter Context …" for any inherited parameter on a connector PG.
   
   ## Frontend
   
   - `ConnectorService.getConnectorParameterContext(connectorId, 
processGroupId)` wraps the new endpoint, mapping `204` to `null` so the caller 
can distinguish "no context" from a load failure.
   - New NgRx action set (`loadConnectorParameterContext` / `Success` / 
`Failure`) and `parameterContext` slice on `ConnectorCanvasState`. Selectors 
expose the current value to dialogs.
   - A single effect, `loadConnectorParameterContextOnLoadSuccess$`, listens to 
both `loadConnectorFlowSuccess` and `loadConnectorControllerServicesSuccess`, 
normalizes their payloads, filters out null `processGroupId`s, and dedupes via 
`distinctUntilChanged` on `(connectorId, processGroupId)`. This covers the 
deep-link case where the user lands directly on 
`/connectors/:id/canvas/:pgId/controller-services` (the CS route is a sibling 
of the canvas route, not a child, so it does not activate the canvas component) 
without firing duplicate fetches when polling or the canvas → CS transition 
refires within the same PG.
   - The action carries an `errorContext: ErrorContextKey` chosen by the 
trigger (`CONNECTOR_CANVAS` for canvas, `CONTROLLER_SERVICES` for CS-listing) 
so `loadConnectorParameterContext$` can surface failures on the page the user 
is actually looking at via `addBannerError`.
   - A shared helper `bindConnectorParameterContext(store, teardown$, apply)` 
wires the current parameter context onto the read-only `EditProcessor` and 
`EditControllerService` dialogs for the lifetime of `dialogRef.afterClosed()`. 
`goToParameter` is intentionally left undefined; the property table now hides 
the "Go to Parameter" menu item whenever the callback is missing 
(`property-table.component.ts`).
   - `@Input() goToParameter?: (parameter: string) => void` is now optional on 
`EditProcessor` and `EditControllerService` to match.
   - The `property-value-tip` template and the codemirror `parameter-tip` 
template render explicit empty-state copy ("No value set" / "Empty string set") 
so users can tell unset parameters from values that simply weren't fetched. 
Both `null` and `undefined` are handled because the wire format prunes nulls.
   - Canvas reducer also resets cached component data + parameter context 
whenever `connectorId` (in addition to `processGroupId`) changes, so navigating 
between connectors doesn't briefly leak stale shapes.
   
   ## Test fixture
   
   - `pages/connectors/testing/parameter-context-fixture.ts` centralizes the 
`as unknown as ParameterContextEntity` cast for test fixtures.
   
   # Tests
   
   - `DtoFactoryTest`: 7 new cases covering null/matching IDs, direct and 
transitive inheritance, fallback to lookup, cyclic inheritance graphs, and 
sensitive value masking.
   - `StandardNiFiServiceFacadeTest`: happy path returning the entity, null 
when no context is bound, and `ResourceNotFoundException` when the PG cannot be 
located.
   - `TestConnectorResource`: 200 / 204 / `AccessDeniedException` cases for the 
new endpoint.
   - Frontend (Vitest): `ConnectorService` (200 vs 204), 
`connectorCanvasReducer` parameter context handling and connector-id reset 
behavior, `ConnectorCanvasEffects` (load on canvas + CS deep link, 
polling/transition dedupe, failure routing per trigger), 
`ConnectorControllerServicesEffects` parameter-context binding in the read-only 
dialog, and `property-table` `canGoToParameter` with/without callback. Tooltip 
rendering for `null`/`undefined`/`''`/non-empty across both 
`property-value-tip` and `parameter-tip`.


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