]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / mirroring / bootstrap-import-modal / bootstrap-import-modal.component.ts
index d79096f6be6fea81ef934a762028d0f4d2ddda8e..5960abc1594f2e08e8c8a890ffbb3c6e18e1f8b6 100644 (file)
@@ -1,5 +1,5 @@
 import { Component, OnDestroy, OnInit } from '@angular/core';
-import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';
+import { UntypedFormControl, UntypedFormGroup, ValidatorFn, Validators } from '@angular/forms';
 
 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 import _ from 'lodash';
@@ -43,17 +43,17 @@ export class BootstrapImportModalComponent implements OnInit, OnDestroy {
 
   createForm() {
     this.importBootstrapForm = new CdFormGroup({
-      siteName: new FormControl('', {
+      siteName: new UntypedFormControl('', {
         validators: [Validators.required]
       }),
-      direction: new FormControl('rx-tx', {}),
-      pools: new FormGroup(
+      direction: new UntypedFormControl('rx-tx', {}),
+      pools: new UntypedFormGroup(
         {},
         {
           validators: [this.validatePools()]
         }
       ),
-      token: new FormControl('', {
+      token: new UntypedFormControl('', {
         validators: [Validators.required, this.validateToken()]
       })
     });
@@ -74,7 +74,7 @@ export class BootstrapImportModalComponent implements OnInit, OnDestroy {
         return acc;
       }, []);
 
-      const poolsControl = this.importBootstrapForm.get('pools') as FormGroup;
+      const poolsControl = this.importBootstrapForm.get('pools') as UntypedFormGroup;
       _.each(this.pools, (pool) => {
         const poolName = pool['name'];
         const mirroring_disabled = pool['mirror_mode'] === 'disabled';
@@ -89,7 +89,7 @@ export class BootstrapImportModalComponent implements OnInit, OnDestroy {
         } else {
           poolsControl.addControl(
             poolName,
-            new FormControl({ value: !mirroring_disabled, disabled: !mirroring_disabled })
+            new UntypedFormControl({ value: !mirroring_disabled, disabled: !mirroring_disabled })
           );
         }
       });
@@ -103,7 +103,7 @@ export class BootstrapImportModalComponent implements OnInit, OnDestroy {
   }
 
   validatePools(): ValidatorFn {
-    return (poolsControl: FormGroup): { [key: string]: any } => {
+    return (poolsControl: UntypedFormGroup): { [key: string]: any } => {
       let checkedCount = 0;
       _.each(poolsControl.controls, (control) => {
         if (control.value === true) {
@@ -120,7 +120,7 @@ export class BootstrapImportModalComponent implements OnInit, OnDestroy {
   }
 
   validateToken(): ValidatorFn {
-    return (token: FormControl): { [key: string]: any } => {
+    return (token: UntypedFormControl): { [key: string]: any } => {
       try {
         if (JSON.parse(atob(token.value))) {
           return null;
@@ -133,7 +133,7 @@ export class BootstrapImportModalComponent implements OnInit, OnDestroy {
   import() {
     const bootstrapPoolNames: string[] = [];
     const poolNames: string[] = [];
-    const poolsControl = this.importBootstrapForm.get('pools') as FormGroup;
+    const poolsControl = this.importBootstrapForm.get('pools') as UntypedFormGroup;
     _.each(poolsControl.controls, (control, poolName) => {
       if (control.value === true) {
         bootstrapPoolNames.push(poolName);