]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / forms / cd-validators.ts
index 22371a50f71ecd0b85b65dd54842443c54a5ee65..bea426724e0736d396dac2f50048b0ca9dc85a5c 100644 (file)
@@ -18,7 +18,7 @@ export function isEmptyInputValue(value: any): boolean {
   return value == null || value.length === 0;
 }
 
-export type existsServiceFn = (value: any) => Observable<boolean>;
+export type existsServiceFn = (value: any, args?: any) => Observable<boolean>;
 
 export class CdValidators {
   /**
@@ -358,7 +358,8 @@ export class CdValidators {
     serviceFn: existsServiceFn,
     serviceFnThis: any = null,
     usernameFn?: Function,
-    uidField = false
+    uidField = false,
+    extraArgs = ''
   ): AsyncValidatorFn {
     let uName: string;
     return (control: AbstractControl): Observable<ValidationErrors | null> => {
@@ -377,7 +378,7 @@ export class CdValidators {
       }
 
       return observableTimer().pipe(
-        switchMapTo(serviceFn.call(serviceFnThis, uName)),
+        switchMapTo(serviceFn.call(serviceFnThis, uName, extraArgs)),
         map((resp: boolean) => {
           if (!resp) {
             return null;