added isLoading disable form

This commit is contained in:
mpetrov 2025-02-17 18:13:20 +02:00
parent a6a0c8dfc0
commit b30329be98

View File

@ -97,6 +97,7 @@ export class CalculatedFieldDialogComponent extends DialogComponent<CalculatedFi
private destroyRef: DestroyRef,
private fb: FormBuilder) {
super(store, router, dialogRef);
this.observeIsLoading();
this.applyDialogData();
this.observeTypeChanges();
}
@ -174,4 +175,16 @@ export class CalculatedFieldDialogComponent extends DialogComponent<CalculatedFi
this.configFormGroup.get('expressionSCRIPT').enable({emitEvent: false});
}
}
private observeIsLoading(): void {
this.isLoading$.pipe(takeUntilDestroyed()).subscribe(loading => {
if (loading) {
this.fieldFormGroup.disable({emitEvent: false});
} else {
this.fieldFormGroup.enable({emitEvent: false});
this.toggleScopeByOutputType(this.outputFormGroup.get('type').value);
this.toggleKeyByCalculatedFieldType(this.fieldFormGroup.get('type').value);
}
});
}
}