From: Dnyaneshwari Date: Mon, 13 Oct 2025 07:38:24 +0000 (+0530) Subject: mgr/dashboard: file/smb: Create SMB share dialog is missing a share name input X-Git-Tag: testing/wip-vshankar-testing-20251027.053005-debug~27^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=25621b231a6403ce2aa22bbd994a2481511bd55e;p=ceph-ci.git mgr/dashboard: file/smb: Create SMB share dialog is missing a share name input Fixes: https://tracker.ceph.com/issues/73472 Signed-off-by: Dnyaneshwari Talwekar --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.html index fb0ffee8607..311609a371e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.html @@ -11,32 +11,53 @@ -
- Share Name - - - - +
+ This field is required. - + helperText="A unique identifier for share" + i18n-helperText + cdRequiredField="Share ID" + [invalid]=" + smbShareForm.controls.share_id.invalid && smbShareForm.controls.share_id.dirty + " + [invalidText]="shareError" + >Share ID + + + + This field is required. + +
+ + +
+ Share Name + + +
@@ -49,7 +70,8 @@ (change)="volumeChangeHandler()" [invalid]="smbShareForm.controls.volume.invalid && smbShareForm.controls.volume.dirty" [invalidText]="volumeError" - i18n-label> + i18n-label + > @@ -137,50 +160,50 @@ - -
-
- Prefixed Path - - -
-
- Input Path - +
+
+ Prefixed Path + + +
+
+ - - - This field is required. - + [invalidText]="pathError" + helperText="A relative path in a cephFS file system." + cdRequiredField="Path" + >Input Path + + + + This field is required. + +
-
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.spec.ts index 1d4f3c104c5..2c3ae8037b5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.spec.ts @@ -83,6 +83,7 @@ describe('SmbShareFormComponent', () => { component.smbShareForm.setValue({ share_id: 'share1', volume: 'fs1', + name: 'My Share', subvolume_group: 'group1', subvolume: 'subvol1', prefixedPath: '/volumes/fs1/group1/subvol1', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.ts index b8824cb879a..9adcf2aaeaa 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.ts @@ -70,10 +70,14 @@ export class SmbShareFormComponent extends CdForm implements OnInit { this.shareResponse = resp; this.smbShareForm.get('share_id').setValue(this.shareResponse.share_id); this.smbShareForm.get('share_id').disable(); - this.smbShareForm.get('volume').setValue(this.shareResponse.cephfs.volume); - this.smbShareForm.get('subvolume_group').setValue(this.shareResponse.cephfs.subvolumegroup); - this.smbShareForm.get('subvolume').setValue(this.shareResponse.cephfs.subvolume); - this.smbShareForm.get('inputPath').setValue(this.shareResponse.cephfs.path); + this.smbShareForm.get('name').setValue(this.shareResponse.name); + this.smbShareForm.get('name').disable(); + this.smbShareForm.get('volume').setValue(this.shareResponse?.cephfs?.volume); + this.smbShareForm + .get('subvolume_group') + .setValue(this.shareResponse?.cephfs?.subvolumegroup); + this.smbShareForm.get('subvolume').setValue(this.shareResponse?.cephfs?.subvolume); + this.smbShareForm.get('inputPath').setValue(this.shareResponse?.cephfs?.path); if (this.shareResponse.readonly) { this.smbShareForm.get('readonly').setValue(this.shareResponse.readonly); } @@ -81,9 +85,15 @@ export class SmbShareFormComponent extends CdForm implements OnInit { this.smbShareForm.get('browseable').setValue(this.shareResponse.browseable); } - this.getSubVolGrp(this.shareResponse.cephfs.volume); + this.getSubVolGrp(this.shareResponse?.cephfs?.volume); }); } + this.smbShareForm.get('share_id')?.valueChanges.subscribe((value) => { + const shareName = this.smbShareForm.get('name'); + if (shareName && !shareName.dirty) { + shareName.setValue(value, { emitEvent: false }); + } + }); this.loadingReady(); } @@ -92,6 +102,7 @@ export class SmbShareFormComponent extends CdForm implements OnInit { share_id: new FormControl('', { validators: [Validators.required] }), + name: new FormControl(''), volume: new FormControl('', { validators: [Validators.required] }), @@ -195,11 +206,13 @@ export class SmbShareFormComponent extends CdForm implements OnInit { const rawFormValue = _.cloneDeep(this.smbShareForm.value); const correctedPath = rawFormValue.inputPath; const shareId = this.smbShareForm.get('share_id')?.value; + const shareName = this.smbShareForm.get('name').value; const requestModel: ShareRequestModel = { share_resource: { resource_type: SHARE_RESOURCE, cluster_id: this.clusterId, share_id: shareId, + name: shareName, cephfs: { volume: rawFormValue.volume, path: correctedPath, @@ -211,7 +224,6 @@ export class SmbShareFormComponent extends CdForm implements OnInit { readonly: rawFormValue.readonly } }; - return requestModel; }