Browse Source

added isLoading disable form

pull/12700/head
mpetrov 2 years ago
parent
commit
b30329be98
  1. 13
      ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.ts

13
ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.ts

@ -97,6 +97,7 @@ export class CalculatedFieldDialogComponent extends DialogComponent<CalculatedFi
private destroyRef: DestroyRef, private destroyRef: DestroyRef,
private fb: FormBuilder) { private fb: FormBuilder) {
super(store, router, dialogRef); super(store, router, dialogRef);
this.observeIsLoading();
this.applyDialogData(); this.applyDialogData();
this.observeTypeChanges(); this.observeTypeChanges();
} }
@ -174,4 +175,16 @@ export class CalculatedFieldDialogComponent extends DialogComponent<CalculatedFi
this.configFormGroup.get('expressionSCRIPT').enable({emitEvent: false}); 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);
}
});
}
} }

Loading…
Cancel
Save