From 3eba8334ce2961f5ac97c41fe3a5496f41b82000 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Tue, 9 Jan 2024 11:49:23 -0500 Subject: [PATCH] NIFI-12586: Fix handling of getParameters in NF Editor (#8223) * NIFI-12586: - Fixing the handling of getParameters since the supplied input could be undefined in some instances. * NIFI-12586: - Removing unused event. --- .../nf-editor/nf-editor.component.html | 2 +- .../editors/nf-editor/nf-editor.component.ts | 23 +++++++------------ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.html b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.html index b483741217..f7eb3d033d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.html +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.html @@ -15,7 +15,7 @@ ~ limitations under the License. --> -
+
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts index 27883bfb9b..01cf9521de 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/app/ui/common/property-table/editors/nf-editor/nf-editor.component.ts @@ -76,7 +76,6 @@ export class NfEditor implements OnDestroy { } @Input() set getParameters(getParameters: (sensitive: boolean) => Observable) { - this.supportsParameters = true; this._getParameters = getParameters; this.getParametersSet = true; @@ -128,6 +127,8 @@ export class NfEditor implements OnDestroy { if (this.getParametersSet) { if (this._getParameters) { + this.supportsParameters = true; + this._getParameters(this.sensitive) .pipe(take(1)) .subscribe((parameters) => { @@ -142,25 +143,17 @@ export class NfEditor implements OnDestroy { } }); } else { + this.supportsParameters = false; + + this.nfel.disableParameters(); + this.nfpr.disableParameters(); + if (this.supportsEl) { - this.nfel.enableParameters(); - this.nfel.setParameters([]); this.nfel.configureAutocomplete(); } else { - this.nfpr.enableParameters(); - this.nfpr.setParameters([]); this.nfpr.configureAutocomplete(); } } - } else { - this.nfel.disableParameters(); - this.nfpr.disableParameters(); - - if (this.supportsEl) { - this.nfel.configureAutocomplete(); - } else { - this.nfpr.configureAutocomplete(); - } } } } @@ -181,7 +174,7 @@ export class NfEditor implements OnDestroy { }; } - resized(rect: DOMRect): void { + resized(): void { this.editor.setSize('100%', '100%'); }