]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-form-group.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / forms / cd-form-group.ts
index 9869f398c82da442ced73848a1703be2ceeb7400..09aac7136c46aa8af8098dd2bf0032b2eaf761da 100644 (file)
@@ -2,7 +2,7 @@ import {
   AbstractControl,
   AbstractControlOptions,
   AsyncValidatorFn,
-  FormGroup,
+  UntypedFormGroup,
   NgForm,
   ValidatorFn
 } from '@angular/forms';
@@ -10,7 +10,7 @@ import {
 /**
  * CdFormGroup extends FormGroup with a few new methods that will help form development.
  */
-export class CdFormGroup extends FormGroup {
+export class CdFormGroup extends UntypedFormGroup {
   constructor(
     public controls: { [key: string]: AbstractControl },
     validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null,
@@ -68,7 +68,7 @@ export class CdFormGroup extends FormGroup {
   showError(controlName: string, form: NgForm, errorName?: string): boolean {
     const control = this.get(controlName);
     return (
-      (form.submitted || control.dirty) &&
+      (form?.submitted || control.dirty) &&
       (errorName ? control.hasError(errorName) : control.invalid)
     );
   }