From 005e4ecdc1ec917d0e350449837a5b7b04d56b44 Mon Sep 17 00:00:00 2001 From: Mathis Marcotte <84033116+mathis-marcotte@users.noreply.github.com> Date: Fri, 5 Sep 2025 09:23:40 -0400 Subject: [PATCH 1/2] fix(crud-web-apps): fix default workspace volume name to match default configs Signed-off-by: Mathis Marcotte <84033116+mathis-marcotte@users.noreply.github.com> --- .../form-workspace-volume/form-workspace-volume.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.ts b/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.ts index 63bab5c1c..9dbf010bb 100755 --- a/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.ts +++ b/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.ts @@ -50,7 +50,9 @@ export class FormWorkspaceVolumeComponent implements OnInit, OnDestroy { } addNewVolume() { - this.volGroup.addControl('newPvc', createNewPvcFormGroup()); + this.volGroup.addControl('newPvc', createNewPvcFormGroup( + '{notebook-name}-workspace' + )); this.volGroup.get('mount').setValue('/home/jovyan'); this.volGroup.enable(); this.volGroup.get('newPvc.spec.storageClassName').disable(); From a9ff01f71f581ce18f7c18383b241729e6b750b4 Mon Sep 17 00:00:00 2001 From: Mathis Marcotte Date: Wed, 17 Sep 2025 18:23:00 +0000 Subject: [PATCH 2/2] feat: added a new test case for adding new workspace volume --- .../form-workspace-volume.component.spec.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.spec.ts b/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.spec.ts index 605301d4e..7f12a9924 100755 --- a/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.spec.ts +++ b/components/crud-web-apps/jupyter/frontend/src/app/pages/form/form-new/form-workspace-volume/form-workspace-volume.component.spec.ts @@ -60,4 +60,24 @@ describe('FormWorkspaceVolumeComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should add new volume', () => { + // initialize a blank volGroup + component.volGroup = new FormGroup({ + mount: new FormControl(), + }); + + expect(component.volGroup.get('newPvc')).toBeFalsy(); + + component.addNewVolume(); + + expect(component.volGroup.get('newPvc')).toBeTruthy(); + expect(component.volGroup.get('newPvc.metadata.name').value).toBe('{notebook-name}-workspace'); + + expect(component.volGroup.get('mount').value).toBe('/home/jovyan'); + + expect(component.volGroup.enabled).toBeTrue(); + + expect(component.volGroup.get('newPvc.spec.storageClassName').enabled).toBeFalse(); + }); });