diff --git a/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/jquery/nfeditor/languages/nfeditor.css b/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/jquery/nfeditor/languages/nfeditor.css index 24093e000a..abf9437ef9 100644 --- a/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/jquery/nfeditor/languages/nfeditor.css +++ b/nifi-extension-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/src/main/webapp/js/jquery/nfeditor/languages/nfeditor.css @@ -15,10 +15,6 @@ * limitations under the License. */ -ul.CodeMirror-hints { - overflow-y: scroll; -} - div.el-section { margin: 5px 0; } diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html index f5de7ef7f3..2abb8908fc 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/flow-designer/ui/canvas/items/processor/edit-processor/edit-processor.component.html @@ -143,7 +143,7 @@
-
+
Concurrent Tasks @@ -163,7 +163,7 @@ [readonly]="readonly" />
-
+
Run Schedule diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/edit-parameter-context/edit-parameter-context.component.html b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/edit-parameter-context/edit-parameter-context.component.html index 932868dcae..bce20e63ff 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/edit-parameter-context/edit-parameter-context.component.html +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/parameter-contexts/ui/parameter-context-listing/edit-parameter-context/edit-parameter-context.component.html @@ -26,7 +26,7 @@
Steps To Update Parameters
- @for (updateStep of requestEntity.request.updateSteps; track updateStep) { + @for (updateStep of requestEntity.request.updateSteps; track updateStep.description) {
{{ updateStep.description }} diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/state/shared/index.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/state/shared/index.ts index 3c1fddbbc3..6b5522572f 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/state/shared/index.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/state/shared/index.ts @@ -259,6 +259,7 @@ export interface ElFunctionTipInput { export interface PropertyHintTipInput { supportsEl: boolean; supportsParameters: boolean; + hasParameterContext: boolean; } export interface RestrictionsTipInput { @@ -372,6 +373,11 @@ export interface ParameterContextReference { name: string; } +export interface ParameterConfig { + supportsParameters: boolean; + parameters: Parameter[] | null; +} + export interface AffectedComponentEntity { permissions: Permissions; id: string; diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/parameter-references/parameter-references.component.html b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/parameter-references/parameter-references.component.html index f9b1e69619..1861b86a31 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/parameter-references/parameter-references.component.html +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/parameter-references/parameter-references.component.html @@ -19,7 +19,7 @@ @if (parameterReferenceMap == null || parameterReferenceMap.size == 0) {
No referencing components
} @else { - @for (pg of processGroups; track pg) { + @for (pg of processGroups; track pg.id) { } @@ -55,7 +55,7 @@
  • Processors ({{ references.length }})

    - @for (reference of references; track reference) { + @for (reference of references; track reference.component.id) {
    @if (isNonServiceInvalid(reference.component)) {

    Controller Services ({{ references.length }})

    - @for (service of references; track service) { + @for (service of references; track service.component.id) {
    @if (isServiceInvalid(service.component)) { @@ -124,7 +124,7 @@
  • Unauthorized ({{ references.length }})

    - @for (reference of references; track reference) { + @for (reference of references; track reference.id) {
    {{ reference.id }}
    diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.spec.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.spec.ts index 53cbb0a74e..38424a9e29 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.spec.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.spec.ts @@ -180,47 +180,50 @@ describe('ComboEditor', () => { } }); - it('verify combo with parameter reference', () => { + it('verify combo with parameter reference', async () => { if (item) { item.value = '#{one}'; component.item = item; component.parameters = parameters; fixture.detectChanges(); - fixture.whenStable().then(() => { - const formValue = component.comboEditorForm.get('value')?.value; - expect(component.itemLookup.get(formValue)?.value).toEqual(item?.value); - expect(component.comboEditorForm.get('parameterReference')).toBeDefined(); + await fixture.whenStable(); - const parameterReferenceValue = component.comboEditorForm.get('parameterReference')?.value; - expect(component.itemLookup.get(parameterReferenceValue)?.value).toEqual(item?.value); + const formValue = component.comboEditorForm.get('value')?.value; + expect(component.itemLookup.get(Number(formValue))?.value).toBeNull(); + expect(component.comboEditorForm.get('parameterReference')).toBeDefined(); - jest.spyOn(component.ok, 'next'); - component.okClicked(); - expect(component.ok.next).toHaveBeenCalledWith(item?.value); - }); + const parameterReferenceValue = component.comboEditorForm.get('parameterReference')?.value; + expect(component.itemLookup.get(Number(parameterReferenceValue))?.value).toEqual(item.value); + + jest.spyOn(component.ok, 'next'); + component.okClicked(); + expect(component.ok.next).toHaveBeenCalledWith(item.value); } }); - it('verify combo with missing parameter reference', () => { + it('verify combo with missing parameter reference', async () => { if (item) { item.value = '#{three}'; component.item = item; component.parameters = parameters; fixture.detectChanges(); - fixture.whenStable().then(() => { - const formValue = component.comboEditorForm.get('value')?.value; - expect(component.itemLookup.get(formValue)?.value).toEqual('#{' + parameters[0].value + '}'); - expect(component.comboEditorForm.get('parameterReference')).toBeDefined(); + await fixture.whenStable(); - const parameterReferenceValue = component.comboEditorForm.get('parameterReference')?.value; - expect(component.itemLookup.get(parameterReferenceValue)?.value).toEqual(item?.value); + const formValue = component.comboEditorForm.get('value')?.value; + expect(component.itemLookup.get(Number(formValue))?.value).toBeNull(); + expect(component.comboEditorForm.get('parameterReference')).toBeDefined(); - jest.spyOn(component.ok, 'next'); - component.okClicked(); - expect(component.ok.next).toHaveBeenCalledWith('#{' + parameters[0].value + '}'); - }); + // since the value does not match any parameters it should match the first + const firstParameterValue = '#{' + parameters[0].name + '}'; + + const parameterReferenceValue = component.comboEditorForm.get('parameterReference')?.value; + expect(component.itemLookup.get(Number(parameterReferenceValue))?.value).toEqual(firstParameterValue); + + jest.spyOn(component.ok, 'next'); + component.okClicked(); + expect(component.ok.next).toHaveBeenCalledWith(firstParameterValue); } }); }); diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.ts index 8f5b81cf66..a05b2d91ce 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/combo-editor/combo-editor.component.ts @@ -24,7 +24,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatButtonModule } from '@angular/material/button'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { NgForOf, NgIf, NgTemplateOutlet } from '@angular/common'; -import { AllowableValue, Parameter, PropertyDescriptor } from '../../../../../state/shared'; +import { AllowableValue, Parameter, ParameterConfig, PropertyDescriptor } from '../../../../../state/shared'; import { MatOptionModule } from '@angular/material/core'; import { MatSelectModule } from '@angular/material/select'; import { MatTooltipModule } from '@angular/material/tooltip'; @@ -75,10 +75,9 @@ export class ComboEditor { this.initialAllowableValues(); } - @Input() set parameters(parameters: Parameter[]) { - this._parameters = parameters; - - this.supportsParameters = parameters != null; + @Input() set parameterConfig(parameterConfig: ParameterConfig) { + this.parameters = parameterConfig.parameters; + this.supportsParameters = parameterConfig.supportsParameters; this.initialAllowableValues(); } @Input() width!: number; @@ -105,7 +104,7 @@ export class ComboEditor { itemSet = false; configuredValue: string | null = null; - _parameters!: Parameter[]; + parameters: Parameter[] | null = null; constructor( private formBuilder: FormBuilder, @@ -181,14 +180,13 @@ export class ComboEditor { this.allowableValueChanged(this.referencesParametersId); } - const parameters: Parameter[] = this._parameters; - if (parameters.length > 0) { + if (this.parameters !== null && this.parameters.length > 0) { // capture the value of i which will be the id of the first // parameter this.configuredParameterId = i; // create allowable values for each parameter - parameters.forEach((parameter) => { + this.parameters.forEach((parameter) => { const parameterItem: AllowableValueItem = { id: i++, displayName: parameter.name, diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts index fe71f8cd29..1a396e2a3f 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts @@ -26,7 +26,7 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; import { NgTemplateOutlet } from '@angular/common'; import { NifiTooltipDirective, Resizable } from '@nifi/shared'; import { PropertyHintTip } from '../../../tooltips/property-hint-tip/property-hint-tip.component'; -import { Parameter, PropertyHintTipInput } from '../../../../../state/shared'; +import { Parameter, ParameterConfig, PropertyHintTipInput } from '../../../../../state/shared'; import { A11yModule } from '@angular/cdk/a11y'; import { CodemirrorModule } from '@ctrl/ngx-codemirror'; import { NfEl } from './modes/nfel'; @@ -74,8 +74,9 @@ export class NfEditor implements OnDestroy { this.loadParameters(); } - @Input() set parameters(parameters: Parameter[] | null) { - this._parameters = parameters; + @Input() set parameterConfig(parameterConfig: ParameterConfig) { + this.parameters = parameterConfig.parameters; + this.supportsParameters = parameterConfig.supportsParameters; this.getParametersSet = true; this.loadParameters(); @@ -98,7 +99,7 @@ export class NfEditor implements OnDestroy { blank = false; mode!: string; - _parameters!: Parameter[] | null; + parameters: Parameter[] | null = null; editor!: Editor; @@ -137,10 +138,8 @@ export class NfEditor implements OnDestroy { this.nfpr.setViewContainerRef(this.viewContainerRef, this.renderer); if (this.getParametersSet) { - if (this._parameters) { - this.supportsParameters = true; - - const parameters: Parameter[] = this._parameters; + if (this.parameters) { + const parameters: Parameter[] = this.parameters; if (this.supportsEl) { this.nfel.enableParameters(); this.nfel.setParameters(parameters); @@ -151,8 +150,6 @@ export class NfEditor implements OnDestroy { this.nfpr.configureAutocomplete(); } } else { - this.supportsParameters = false; - this.nfel.disableParameters(); this.nfpr.disableParameters(); @@ -187,7 +184,8 @@ export class NfEditor implements OnDestroy { getPropertyHintTipData(): PropertyHintTipInput { return { supportsEl: this.supportsEl, - supportsParameters: this.supportsParameters + supportsParameters: this.supportsParameters, + hasParameterContext: this.parameters !== null }; } diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/property-table.component.html b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/property-table.component.html index 9b1af4df3f..b132ccb66f 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/property-table.component.html +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/property-table/property-table.component.html @@ -180,7 +180,7 @@ @if (hasAllowableValues(editorItem)) { parameterEntity.parameter) .filter((parameter: Parameter) => parameter.sensitive == propertyItem.descriptor.sensitive); @@ -450,7 +458,7 @@ export class PropertyTable implements AfterViewInit, ControlValueAccessor { this.editorPositions.pop(); this.editorItem = item; - this.editorParameters = this.getParametersForItem(this.editorItem); + this.editorParameterConfig = this.getParameterConfig(this.editorItem); this.editorTrigger = editorTrigger; this.editorOpen = true; diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/tooltips/property-hint-tip/property-hint-tip.component.html b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/tooltips/property-hint-tip/property-hint-tip.component.html index 31198bc1b5..8914f78e08 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/tooltips/property-hint-tip/property-hint-tip.component.html +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/tooltips/property-hint-tip/property-hint-tip.component.html @@ -43,12 +43,18 @@
    Parameters (PARAM) supported
    -
    - After beginning with the start delimiter - #{ use the keystroke - control+space to see a list of available - parameters. -
    + @if (data?.hasParameterContext) { +
    + After beginning with the start delimiter + #{ use the keystroke + control+space to see a list of available + parameters. +
    + } @else { +
    + Parameters are supported but no Parameter Context is currently bound to this Process Group. +
    + }
    diff --git a/nifi-frontend/src/main/frontend/libs/shared/src/assets/styles/_codemirror-theme.scss b/nifi-frontend/src/main/frontend/libs/shared/src/assets/styles/_codemirror-theme.scss index 031a4913a2..b71b85f8e5 100644 --- a/nifi-frontend/src/main/frontend/libs/shared/src/assets/styles/_codemirror-theme.scss +++ b/nifi-frontend/src/main/frontend/libs/shared/src/assets/styles/_codemirror-theme.scss @@ -255,7 +255,7 @@ background: if($is-dark, rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0.5)); } - .cm-s-nifi .CodeMirror-hints { + .CodeMirror-hints { z-index: 1000 !important; overflow-y: scroll !important; }