Skip to content

Commit

Permalink
Fix workspace menu and connect button issues (#3821)
Browse files Browse the repository at this point in the history
  • Loading branch information
marrobi authored Jan 5, 2024
1 parent 769ce02 commit 72e5f59
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 30 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENHANCEMENTS:
* Switch to Structured Firewall Logs ([#3816](https://github.com/microsoft/AzureTRE/pull/3816))

BUG FIXES:
* Fix issue with workspace menu not working correctly([#3819](https://github.com/microsoft/AzureTRE/issues/3819))
* Fix issue with connect button showing when no uri([#3820](https://github.com/microsoft/AzureTRE/issues/3820))

COMPONENTS:

Expand Down
2 changes: 1 addition & 1 deletion ui/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tre-ui",
"version": "0.5.17",
"version": "0.5.18",
"private": true,
"dependencies": {
"@azure/msal-browser": "^2.35.0",
Expand Down
40 changes: 21 additions & 19 deletions ui/app/src/components/shared/ResourceContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,27 @@ export const ResourceContextMenu: React.FunctionComponent<ResourceContextMenuPro
}

// add 'connect' button if we have a URL to connect to
if (props.resource.properties.is_exposed_externally === true) {
menuItems.push({
key: 'connect',
text: 'Connect',
title: shouldDisableConnect() ? 'Resource must be deployed, enabled & powered on to connect' : 'Connect to resource',
iconProps: { iconName: 'PlugConnected' },
onClick: () => { window.open(props.resource.properties.connection_uri, '_blank') },
disabled: shouldDisableConnect()
})
}
else if (props.resource.properties.is_exposed_externally === false) {
menuItems.push({
key: 'connect',
text: 'Connect',
title: shouldDisableConnect() ? 'Resource must be deployed, enabled & powered on to connect' : 'Connect to resource',
iconProps: { iconName: 'PlugConnected' },
onClick: () => setShowCopyUrl(true),
disabled: shouldDisableConnect()
})
if(props.resource.properties.connection_uri){
if (props.resource.properties.is_exposed_externally === true) {
menuItems.push({
key: 'connect',
text: 'Connect',
title: shouldDisableConnect() ? 'Resource must be deployed, enabled & powered on to connect' : 'Connect to resource',
iconProps: { iconName: 'PlugConnected' },
onClick: () => { window.open(props.resource.properties.connection_uri, '_blank') },
disabled: shouldDisableConnect()
})
}
else if (props.resource.properties.is_exposed_externally === false) {
menuItems.push({
key: 'connect',
text: 'Connect',
title: shouldDisableConnect() ? 'Resource must be deployed, enabled & powered on to connect' : 'Connect to resource',
iconProps: { iconName: 'PlugConnected' },
onClick: () => setShowCopyUrl(true),
disabled: shouldDisableConnect()
})
}
}


Expand Down
20 changes: 10 additions & 10 deletions ui/app/src/components/workspaces/WorkspaceLeftNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const WorkspaceLeftNav: React.FunctionComponent<WorkspaceLeftNavProps> =
serviceLinkArray.push(
{
name: service.properties.display_name,
url: `${ApiEndpoint.WorkspaceServices}/${service.id}`,
key: `${ApiEndpoint.WorkspaceServices}/${service.id}`
url: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.WorkspaceServices}/${service.id}`,
key: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.WorkspaceServices}/${service.id}`
});
});

Expand All @@ -41,8 +41,8 @@ export const WorkspaceLeftNav: React.FunctionComponent<WorkspaceLeftNavProps> =
sharedServiceLinkArray.push(
{
name: service.properties.display_name,
url: `${ApiEndpoint.SharedServices}/${service.id}`,
key: `${ApiEndpoint.SharedServices}/${service.id}`
url: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.SharedServices}/${service.id}`,
key: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.SharedServices}/${service.id}`
});
});

Expand All @@ -57,15 +57,15 @@ export const WorkspaceLeftNav: React.FunctionComponent<WorkspaceLeftNavProps> =
},
{
name: 'Services',
key: ApiEndpoint.WorkspaceServices,
url: ApiEndpoint.WorkspaceServices,
key: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.WorkspaceServices}`,
url: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.WorkspaceServices}`,
isExpanded: true,
links: serviceLinkArray
},
{
name: 'Shared Services',
key: ApiEndpoint.SharedServices,
url: ApiEndpoint.SharedServices,
key: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.SharedServices}`,
url: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.SharedServices}`,
isExpanded: false,
links: sharedServiceLinkArray
}
Expand All @@ -77,8 +77,8 @@ export const WorkspaceLeftNav: React.FunctionComponent<WorkspaceLeftNavProps> =
if (workspaceCtx.workspace.properties !== undefined && workspaceCtx.workspace.properties.enable_airlock) {
serviceNavLinks[0].links.push({
name: 'Airlock',
key: ApiEndpoint.AirlockRequests,
url: ApiEndpoint.AirlockRequests
key: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.AirlockRequests}`,
url: `/${ApiEndpoint.Workspaces}/${workspaceCtx.workspace.id}/${ApiEndpoint.AirlockRequests}`,
});
}

Expand Down

0 comments on commit 72e5f59

Please sign in to comment.