NIFI-15931: Fetching parameter values in the Connector canvas.#11263
Open
mcgilman wants to merge 2 commits into
Open
NIFI-15931: Fetching parameter values in the Connector canvas.#11263mcgilman wants to merge 2 commits into
mcgilman wants to merge 2 commits into
Conversation
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.
Summary
JIRA: 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
GET /connectors/{connectorId}/flow/process-groups/{processGroupId}/parameter-contextonConnectorResource. RequiresREADon the connector, returns aParameterContextEntityfor the PG's bound context, or204 No Contentwhen no context is bound. Sensitive values are masked via the existingDtoFactorypath.NiFiServiceFacade#getConnectorParameterContextand itsStandardNiFiServiceFacadeimplementation look up theConnectorNode, locate the targetProcessGroup, and return its boundParameterContext.DtoFactory#createParameterDtonow walks the in-memory inheritance graph of the suppliedParameterContextto populatecontainingParameterContext(with cycle protection), falling back to the suppliedParameterContextLookuponly when no in-memory match is found. This is required because connector-managed parameter contexts are not registered in the globalParameterContextDAO, 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, mapping204tonullso the caller can distinguish "no context" from a load failure.loadConnectorParameterContext/Success/Failure) andparameterContextslice onConnectorCanvasState. Selectors expose the current value to dialogs.loadConnectorParameterContextOnLoadSuccess$, listens to bothloadConnectorFlowSuccessandloadConnectorControllerServicesSuccess, normalizes their payloads, filters out nullprocessGroupIds, and dedupes viadistinctUntilChangedon(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.errorContext: ErrorContextKeychosen by the trigger (CONNECTOR_CANVASfor canvas,CONTROLLER_SERVICESfor CS-listing) soloadConnectorParameterContext$can surface failures on the page the user is actually looking at viaaddBannerError.bindConnectorParameterContext(store, teardown$, apply)wires the current parameter context onto the read-onlyEditProcessorandEditControllerServicedialogs for the lifetime ofdialogRef.afterClosed().goToParameteris 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) => voidis now optional onEditProcessorandEditControllerServiceto match.property-value-tiptemplate and the codemirrorparameter-tiptemplate render explicit empty-state copy ("No value set" / "Empty string set") so users can tell unset parameters from values that simply weren't fetched. Bothnullandundefinedare handled because the wire format prunes nulls.connectorId(in addition toprocessGroupId) changes, so navigating between connectors doesn't briefly leak stale shapes.Test fixture
pages/connectors/testing/parameter-context-fixture.tscentralizes theas unknown as ParameterContextEntitycast 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, andResourceNotFoundExceptionwhen the PG cannot be located.TestConnectorResource: 200 / 204 /AccessDeniedExceptioncases for the new endpoint.ConnectorService(200 vs 204),connectorCanvasReducerparameter context handling and connector-id reset behavior,ConnectorCanvasEffects(load on canvas + CS deep link, polling/transition dedupe, failure routing per trigger),ConnectorControllerServicesEffectsparameter-context binding in the read-only dialog, andproperty-tablecanGoToParameterwith/without callback. Tooltip rendering fornull/undefined/''/non-empty across bothproperty-value-tipandparameter-tip.