This is an automated email from the ASF dual-hosted git repository.
scottyaslan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 35e95e4a237 NIFI-15978: Rendering allowable value descriptions in the
Connector wizard. (#11286)
35e95e4a237 is described below
commit 35e95e4a237de11a686510c316544c353e18bf7e
Author: Matt Gilman <[email protected]>
AuthorDate: Wed May 27 12:07:13 2026 -0400
NIFI-15978: Rendering allowable value descriptions in the Connector wizard.
(#11286)
---
.../connector-property-input.component.spec.ts | 47 +++++++++++++++++++---
.../connector-property-input.component.ts | 3 +-
.../main/frontend/libs/shared/src/types/index.ts | 1 +
3 files changed, 44 insertions(+), 7 deletions(-)
diff --git
a/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.spec.ts
b/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.spec.ts
index 924e0bf52ce..2b7a75001ee 100644
---
a/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.spec.ts
+++
b/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.spec.ts
@@ -44,9 +44,9 @@ function makeProp(overrides:
Partial<ConnectorPropertyDescriptor> = {}): Connect
};
}
-function makeAllowable(value: string, displayName: string = value):
AllowableValue {
+function makeAllowable(value: string, displayName: string = value,
description?: string): AllowableValue {
return {
- allowableValue: { value, displayName },
+ allowableValue: { value, displayName, description },
canRead: true
};
}
@@ -289,8 +289,24 @@ describe('ConnectorPropertyInput', () => {
});
expect(inputComponent.selectOptions).toEqual([
- { value: 'v1', label: 'Value One' },
- { value: 'v2', label: 'Value Two' }
+ { value: 'v1', label: 'Value One', description: undefined },
+ { value: 'v2', label: 'Value Two', description: undefined }
+ ]);
+ });
+
+ it('includes allowable value descriptions in select options when
present', async () => {
+ const { inputComponent } = await setup({
+ property: makeProp({
+ allowableValues: [
+ makeAllowable('v1', 'Value One', 'First option
description'),
+ makeAllowable('v2', 'Value Two', 'Second option
description')
+ ]
+ })
+ });
+
+ expect(inputComponent.selectOptions).toEqual([
+ { value: 'v1', label: 'Value One', description: 'First option
description' },
+ { value: 'v2', label: 'Value Two', description: 'Second option
description' }
]);
});
@@ -309,8 +325,27 @@ describe('ConnectorPropertyInput', () => {
fixture.detectChanges();
expect(inputComponent.selectOptions).toEqual([
- { value: 'dyn-1', label: 'Dynamic 1' },
- { value: 'dyn-2', label: 'Dynamic 2' }
+ { value: 'dyn-1', label: 'Dynamic 1', description: undefined },
+ { value: 'dyn-2', label: 'Dynamic 2', description: undefined }
+ ]);
+ });
+
+ it('includes descriptions from dynamic allowable values state', async
() => {
+ const { inputComponent, host, fixture } = await setup({
+ property: makeProp({ allowableValuesFetchable: true })
+ });
+
+ host.dynamicAllowableValuesState.set({
+ loading: false,
+ error: null,
+ values: [makeAllowable('dyn-1', 'Dynamic 1', 'Fetched option
description')]
+ });
+ fixture.detectChanges();
+ await fixture.whenStable();
+ fixture.detectChanges();
+
+ expect(inputComponent.selectOptions).toEqual([
+ { value: 'dyn-1', label: 'Dynamic 1', description: 'Fetched
option description' }
]);
});
diff --git
a/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.ts
b/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.ts
index 26504bbdb82..ba3d5a5f8ff 100644
---
a/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.ts
+++
b/nifi-frontend/src/main/frontend/libs/shared/src/components/connector-property-input/connector-property-input.component.ts
@@ -538,7 +538,8 @@ export class ConnectorPropertyInput implements
ControlValueAccessor, DoCheck, On
const options: SearchableSelectOption<string>[] =
allowableValues.map((av) => ({
value: av.allowableValue.value,
- label: av.allowableValue.displayName
+ label: av.allowableValue.displayName,
+ description: av.allowableValue.description
}));
// Surface saved values that are no longer in the loaded allowable list
diff --git a/nifi-frontend/src/main/frontend/libs/shared/src/types/index.ts
b/nifi-frontend/src/main/frontend/libs/shared/src/types/index.ts
index bc97d066f4f..b8e82ac3f61 100644
--- a/nifi-frontend/src/main/frontend/libs/shared/src/types/index.ts
+++ b/nifi-frontend/src/main/frontend/libs/shared/src/types/index.ts
@@ -415,6 +415,7 @@ export interface AllowableValue {
allowableValue: {
displayName: string;
value: string;
+ description?: string;
};
canRead: boolean;
}