Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthibault79 committed Sep 16, 2024
1 parent c90e96e commit 172b3b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ public ResponseEntity<Workspace> 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();
Expand Down
11 changes: 8 additions & 3 deletions ui/src/app/pages/runtimes-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ const css =
display: none !important
}`;

const stringToSlug = (s: string) => s.toLowerCase().replace(/\s+/g, '');

interface RuntimesListProps
extends WithSpinnerOverlayProps,
NavigationProps,
Expand Down Expand Up @@ -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)
),
},
}}
/>
Expand Down
1 change: 1 addition & 0 deletions ui/src/app/pages/workspace/workspace-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 172b3b0

Please sign in to comment.