]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: NFS - Fix Edit NFS export request
authorDnyaneshwari <dnyaneshwari@li-9c9fbecc-2d5c-11b2-a85c-e2a7cc8a424f.ibm.com>
Tue, 4 Mar 2025 12:54:32 +0000 (18:24 +0530)
committerDnyaneshwari <dnyaneshwari@li-9c9fbecc-2d5c-11b2-a85c-e2a7cc8a424f.ibm.com>
Fri, 21 Mar 2025 08:48:42 +0000 (14:18 +0530)
Fixes: https://tracker.ceph.com/issues/70284
Signed-off-by: Dnyaneshwari Talwekar <dtalweka@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts

index 0da4913e9b8a417627baf5f48c5528dccd6b0ef0..6b091e14639dc64e043b36a0fa8d345da614ee2e 100644 (file)
       </div>
 
       <div class="form-item"
-           *ngIf="storageBackend === 'CEPH' && nfsForm.getValue('fsal').fs_name">
+           *ngIf="storageBackend === 'CEPH' && nfsForm.getValue('fsal').fs_name && !this.isEdit">
         <cds-select formControlName="subvolume_group"
                     name="subvolume_group"
                     for="subvolume_group"
       </div>
 
     <div class="form-group row"
-         *ngIf="storageBackend === 'CEPH' && nfsForm.getValue('fsal').fs_name">
+         *ngIf="storageBackend === 'CEPH' && nfsForm.getValue('fsal').fs_name && !this.isEdit">
       <cds-select formControlName="subvolume"
                   name="subvolume"
                   for="subvolume"
index d502524256ee909910a1ced91bdcf6b01f1ad095..2d6dffcb298347a4300cca2aad89d996f2e4c54d 100644 (file)
@@ -150,8 +150,8 @@ export class NfsFormComponent extends CdForm implements OnInit {
         }
       );
       this.nfsForm.get('cluster_id').disable();
+      this.nfsForm.get('fsal').disable();
       this.nfsForm.get('path').disable();
-      this.nfsForm.get('fsal.user_id').disable();
     } else {
       this.action = this.actionLabels.CREATE;
       this.route.params.subscribe(
@@ -491,7 +491,7 @@ export class NfsFormComponent extends CdForm implements OnInit {
   setBucket() {
     this.nfsForm.get('path').enable();
     this.nfsForm.get('fsal.user_id').setValue('');
-    this.nfsForm.get('fsal.user_id').disable();
+    this.nfsForm.get('fsal').disable();
 
     this.setPathValidation();
   }
@@ -617,12 +617,12 @@ export class NfsFormComponent extends CdForm implements OnInit {
 
   private buildRequest() {
     const requestModel: any = _.cloneDeep(this.nfsForm.value);
-
+    requestModel.fsal = this.nfsForm.get('fsal').value;
     if (this.isEdit) {
       requestModel.export_id = _.parseInt(this.export_id);
+      requestModel.path = this.nfsForm.get('path').value;
       if (requestModel.fsal.name === SUPPORTED_FSAL.RGW) {
         requestModel.fsal.user_id = this.nfsForm.getValue('fsal').user_id;
-        requestModel.path = this.nfsForm.getValue('path');
       }
     }