mirror of https://github.com/apache/nifi.git
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.
This commit is contained in:
parent
bbd8d7fd8d
commit
3eba8334ce
|
@ -15,7 +15,7 @@
|
|||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<div class="property-editor p-4" [style.width.px]="width" cdkDrag resizable (resized)="resized($event)">
|
||||
<div class="property-editor p-4" [style.width.px]="width" cdkDrag resizable (resized)="resized()">
|
||||
<form class="h-full" [formGroup]="nfEditorForm" cdkTrapFocus cdkTrapFocusAutoCapture>
|
||||
<div class="flex flex-col gap-y-3 h-full">
|
||||
<div class="flex justify-end">
|
||||
|
|
|
@ -76,7 +76,6 @@ export class NfEditor implements OnDestroy {
|
|||
}
|
||||
|
||||
@Input() set getParameters(getParameters: (sensitive: boolean) => Observable<Parameter[]>) {
|
||||
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%');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue