]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Cloning subvolume not listing _nogroup subvolumegroup if there are... 59595/head
authorDnyaneshwari <dnyaneshwari@li-9c9fbecc-2d5c-11b2-a85c-e2a7cc8a424f.ibm.com>
Wed, 4 Sep 2024 10:48:08 +0000 (16:18 +0530)
committerDnyaneshwari <dnyaneshwari@li-9c9fbecc-2d5c-11b2-a85c-e2a7cc8a424f.ibm.com>
Tue, 17 Sep 2024 09:36:39 +0000 (15:06 +0530)
Fixes: https://tracker.ceph.com/issues/67891
Signed-off-by: Dnyaneshwari talwekar <dtalweka@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-subvolume-snapshots-list/cephfs-subvolume-snapshots-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/constants/cephfs.ts [new file with mode: 0644]

index 5d3fe6b2ddad809b00e4aa175dda5e29ed81e649..92f337f85a68ca5e294bf19dc46375436285c921 100644 (file)
@@ -26,6 +26,7 @@ import moment from 'moment';
 import { Validators } from '@angular/forms';
 import { CdValidators } from '~/app/shared/forms/cd-validators';
 import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
+import { DEFAULT_SUBVOLUME_GROUP } from '~/app/shared/constants/cephfs';
 
 @Component({
   selector: 'cd-cephfs-subvolume-snapshots-list',
@@ -57,6 +58,7 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
   isLoading = true;
 
   observables: any = [];
+  allGroups: any = [];
 
   constructor(
     private cephfsSubvolumeGroupService: CephfsSubvolumeGroupService,
@@ -126,8 +128,14 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
       .pipe(
         switchMap((groups) => {
           // manually adding the group '_nogroup' to the list.
-          groups.unshift({ name: '' });
 
+          groups.unshift({ name: '' });
+          this.allGroups = Array.from(groups).map((group) => {
+            return {
+              value: group.name,
+              text: group.name === '' ? DEFAULT_SUBVOLUME_GROUP : group.name
+            };
+          });
           const observables = groups.map((group) =>
             this.cephfsSubvolumeService.existsInFs(this.fsName, group.name).pipe(
               switchMap((resp) => {
@@ -248,9 +256,6 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
 
   cloneModal() {
     const cloneName = `clone_${moment().toISOString(true)}`;
-    const allGroups = Array.from(this.subvolumeGroupList).map((group) => {
-      return { value: group, text: group === '' ? '_nogroup' : group };
-    });
     this.modalService.show(FormModalComponent, {
       titleText: $localize`Create clone`,
       fields: [
@@ -284,7 +289,7 @@ export class CephfsSubvolumeSnapshotsListComponent implements OnInit, OnChanges
           valueChangeListener: true,
           dependsOn: 'cloneName',
           typeConfig: {
-            options: allGroups
+            options: this.allGroups
           }
         }
       ],
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/cephfs.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/constants/cephfs.ts
new file mode 100644 (file)
index 0000000..56890ff
--- /dev/null
@@ -0,0 +1 @@
+export const DEFAULT_SUBVOLUME_GROUP = '_nogroup';