]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Added missing types in CephFS directories spec
authorStephan Müller <smueller@suse.com>
Wed, 8 Jan 2020 17:06:07 +0000 (18:06 +0100)
committerStephan Müller <smueller@suse.com>
Mon, 17 Feb 2020 14:09:06 +0000 (15:09 +0100)
Fixes: https://tracker.ceph.com/issues/42617
Signed-off-by: Stephan Müller <smueller@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.spec.ts

index 894cfa08ba767a6040617f16c9a7bb34f4f162e2..1d1fd66e774eecee4760747ed75a9dc84c317b0a 100644 (file)
@@ -112,7 +112,7 @@ describe('CephfsDirectoriesComponent', () => {
         mockLib.dir(path, 'b', 2)
       ];
     },
-    lsDir: (_id: number, path = '') => {
+    lsDir: (_id: number, path = ''): Observable<CephfsDir[]> => {
       // will return 2 levels deep
       let data = mockLib.lsSingleDir(path);
       const paths = data.map((dir) => dir.path);
@@ -121,7 +121,7 @@ describe('CephfsDirectoriesComponent', () => {
       });
       return of(data);
     },
-    mkSnapshot: (_id: any, path: string, name: string) => {
+    mkSnapshot: (_id: any, path: string, name: string): Observable<string> => {
       mockData.createdSnaps.push({
         name,
         path,
@@ -129,7 +129,7 @@ describe('CephfsDirectoriesComponent', () => {
       });
       return of(name);
     },
-    rmSnapshot: (_id: any, path: string, name: string) => {
+    rmSnapshot: (_id: any, path: string, name: string): Observable<string> => {
       mockData.deletedSnaps.push({
         name,
         path,
@@ -137,11 +137,11 @@ describe('CephfsDirectoriesComponent', () => {
       });
       return of(name);
     },
-    updateQuota: (_id: any, path: string, updated: CephfsQuotas) => {
+    updateQuota: (_id: any, path: string, updated: CephfsQuotas): Observable<string> => {
       mockData.updatedQuotas[path] = Object.assign(mockData.updatedQuotas[path] || {}, updated);
       return of('Response');
     },
-    modalShow: (comp: any, init: any) => {
+    modalShow: (comp: Type<any>, init: any): any => {
       modal = modalServiceShow(comp, init);
       return modal.ref;
     },
@@ -834,10 +834,7 @@ describe('CephfsDirectoriesComponent', () => {
   describe('table actions', () => {
     let actions: CdTableAction[];
 
-    const empty = (): CdTableSelection => {
-      const selection = new CdTableSelection();
-      return selection;
-    };
+    const empty = (): CdTableSelection => new CdTableSelection();
 
     const select = (value: number): CdTableSelection => {
       const selection = new CdTableSelection();