diff --git a/api/src/main/java/org/pmiops/workbench/api/WorkspacesController.java b/api/src/main/java/org/pmiops/workbench/api/WorkspacesController.java index 7f167de4fc5..744198d1a62 100644 --- a/api/src/main/java/org/pmiops/workbench/api/WorkspacesController.java +++ b/api/src/main/java/org/pmiops/workbench/api/WorkspacesController.java @@ -516,7 +516,9 @@ public ResponseEntity updateWorkspace( .equals(workspace.getAccessTierShortName())) { throw new BadRequestException("Attempted to change data access tier"); } - if (workspace.getName() != null) { + if (workspace.getDisplayName() != null) { + dbWorkspace.setName(workspace.getDisplayName()); + } else if (workspace.getName() != null) { dbWorkspace.setName(workspace.getName()); } ResearchPurpose researchPurpose = request.getWorkspace().getResearchPurpose(); diff --git a/ui/src/app/pages/runtimes-list.tsx b/ui/src/app/pages/runtimes-list.tsx index f4ffd223cc6..d0ca178758d 100644 --- a/ui/src/app/pages/runtimes-list.tsx +++ b/ui/src/app/pages/runtimes-list.tsx @@ -103,6 +103,8 @@ const css = display: none !important }`; +const stringToSlug = (s: string) => s.toLowerCase().replace(/\s+/g, ''); + interface RuntimesListProps extends WithSpinnerOverlayProps, NavigationProps, @@ -137,9 +139,12 @@ export const RuntimesList = fp.flow( nav: { // called from, for example: // https://github.com/DataBiosphere/terra-ui/blob/4333c7b94d6ce10a6fe079361e98c2b6cc71f83a/src/pages/Environments.js#L420 - getLink: (_, { namespace, terraName }) => - analysisTabPath(namespace, terraName), - // TODO JOEL does this even work ??? + getLink: (_, { namespace, name, terraName }) => + analysisTabPath( + namespace, + // TODO why: this backup is necessary for Cloud Environments but not Disks + terraName ?? stringToSlug(name) + ), }, }} /> diff --git a/ui/src/app/pages/workspace/workspace-edit.tsx b/ui/src/app/pages/workspace/workspace-edit.tsx index 1f046dc5cbc..ef1729355c0 100644 --- a/ui/src/app/pages/workspace/workspace-edit.tsx +++ b/ui/src/app/pages/workspace/workspace-edit.tsx @@ -1167,6 +1167,7 @@ export const WorkspaceEdit = fp.flow( } else if (this.isMode(WorkspaceEditMode.Duplicate)) { workspace = await this.apiDuplicateWorkspaceAsync(); } else { + // this does NOT update displayname workspace = await workspacesApi().updateWorkspace( this.state.workspace.namespace, this.state.workspace.terraName,