]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fixes type error in RBD form 21681/head
authorStephan Müller <smueller@suse.com>
Thu, 26 Apr 2018 13:24:15 +0000 (15:24 +0200)
committerStephan Müller <smueller@suse.com>
Thu, 26 Apr 2018 15:45:48 +0000 (17:45 +0200)
The form validation function wasn't a 'ValidatorFn' because it didn't
return something, now it's returning null in order to be valid for
type checking engines that also type check functions that are returned
by other functions.

Signed-off-by: Stephan Müller <smueller@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts

index d4c315c36cc3484fe23e7c18a4941acbc14083da..5228063ddc304d28f53652af0550bc60949bed39 100644 (file)
@@ -1,5 +1,5 @@
 import { Component, OnInit } from '@angular/core';
-import { FormControl, FormGroup, Validators } from '@angular/forms';
+import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';
 import { ActivatedRoute, Router } from '@angular/router';
 
 import * as _ from 'lodash';
@@ -293,7 +293,7 @@ export class RbdFormComponent implements OnInit {
     this.pools = newPools;
   }
 
-  validateRbdForm(formatter: FormatterService) {
+  validateRbdForm(formatter: FormatterService): ValidatorFn {
     return (formGroup: FormGroup) => {
       // Data Pool
       const useDataPoolControl = formGroup.get('useDataPool');
@@ -340,6 +340,7 @@ export class RbdFormComponent implements OnInit {
         stripingCountControlErrors = {'min': true};
       }
       stripingCountControl.setErrors(stripingCountControlErrors);
+      return null;
     };
   }