From 6600d96a20aa5e5ede1d1d4f362c1e4c745f5b4e Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:13:58 +0100 Subject: [PATCH 01/62] minor updates to templates --- templates/workspace_services/guacamole/porter.yaml | 2 +- templates/workspace_services/guacamole/template_schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/workspace_services/guacamole/porter.yaml b/templates/workspace_services/guacamole/porter.yaml index f49e3b02e3..dd081ea0b9 100644 --- a/templates/workspace_services/guacamole/porter.yaml +++ b/templates/workspace_services/guacamole/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-service-guacamole -version: 0.10.7 +version: 0.10.8 description: "An Azure TRE service for Guacamole" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspace_services/guacamole/template_schema.json b/templates/workspace_services/guacamole/template_schema.json index c14d4e6d65..701667b2b8 100644 --- a/templates/workspace_services/guacamole/template_schema.json +++ b/templates/workspace_services/guacamole/template_schema.json @@ -41,7 +41,7 @@ "title": "Disable 'Paste'", "description": "Disable Paste functionality", "updateable": true, - "default": true + "default": false }, "guac_enable_drive": { "$id": "#/properties/guac_enable_drive", From 8fb025a7d08acfc9bdfb0ce8e1dcd462c568f614 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 11 Apr 2024 09:53:59 +0100 Subject: [PATCH 02/62] Update config.py --- api_app/core/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app/core/config.py b/api_app/core/config.py index aa84020783..bab2ee3b36 100644 --- a/api_app/core/config.py +++ b/api_app/core/config.py @@ -65,6 +65,6 @@ API_AUDIENCE: str = config("API_AUDIENCE", default=API_CLIENT_ID) -AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=1) +AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=48) API_ROOT_SCOPE: str = f"api://{API_CLIENT_ID}/user_impersonation" From 47c5de6a9e781427cfbca53364a3229c4674e7b3 Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:00:43 +0100 Subject: [PATCH 03/62] disable delete if not owner --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index f57487b43a..530152f0f5 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -130,7 +130,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !roles.includes(WorkspaceRoleName.WorkspaceOwner)) }, ]; From 876ca1b3df09e4cd65cdd1c149156b7ed3b82294 Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:03:48 +0100 Subject: [PATCH 04/62] disable enabling services if off by researcher --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 530152f0f5..a8a1e2818f 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -122,7 +122,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock) + disabled: (props.componentAction === ComponentAction.Lock || !roles.includes(WorkspaceRoleName.WorkspaceOwner)) }, { key: 'delete', From ccf1a25e04ff919dfefe4fe09cfa6892e9227433 Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:04:58 +0100 Subject: [PATCH 05/62] disable updating vm in reseracher --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index a8a1e2818f..e1cf8d0a97 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -115,7 +115,7 @@ export const ResourceContextMenu: React.FunctionComponent Date: Mon, 15 Apr 2024 10:36:48 +0100 Subject: [PATCH 06/62] Update config.py --- api_app/core/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app/core/config.py b/api_app/core/config.py index bab2ee3b36..aa84020783 100644 --- a/api_app/core/config.py +++ b/api_app/core/config.py @@ -65,6 +65,6 @@ API_AUDIENCE: str = config("API_AUDIENCE", default=API_CLIENT_ID) -AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=48) +AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=1) API_ROOT_SCOPE: str = f"api://{API_CLIENT_ID}/user_impersonation" From 6f0b1ac47f6193be321fe06cb969a6f445946cf2 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:41:22 +0100 Subject: [PATCH 07/62] Update config.py --- api_app/core/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app/core/config.py b/api_app/core/config.py index aa84020783..bab2ee3b36 100644 --- a/api_app/core/config.py +++ b/api_app/core/config.py @@ -65,6 +65,6 @@ API_AUDIENCE: str = config("API_AUDIENCE", default=API_CLIENT_ID) -AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=1) +AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=48) API_ROOT_SCOPE: str = f"api://{API_CLIENT_ID}/user_impersonation" From b74e0d682f8ecb747c15c48b82254ee48cc493a2 Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:38:24 +0100 Subject: [PATCH 08/62] update version --- api_app/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app/_version.py b/api_app/_version.py index fce337455e..2cfeb05209 100644 --- a/api_app/_version.py +++ b/api_app/_version.py @@ -1 +1 @@ -__version__ = "0.18.10" +__version__ = "0.18.11" From df07e4b4829bbff80aa70f56af4a60a66e23a8d2 Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:40:38 +0100 Subject: [PATCH 09/62] update version --- core/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/version.txt b/core/version.txt index f8c6ac7fea..50533e307d 100644 --- a/core/version.txt +++ b/core/version.txt @@ -1 +1 @@ -__version__ = "0.9.5" +__version__ = "0.9.6" From 50e7e2bd51caa1503b86ae168a281f12f17032b2 Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:47:54 +0100 Subject: [PATCH 10/62] update devcontainer --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9d49130458..ef7c799c76 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,7 @@ "args": { // To ensure that the group ID for the docker group in the container // matches the group ID on the host, add this to your .bash_profile on the host - // export DOCKER_GROUP_ID=$(getent group docker | awk -F ":" '{ print $3 }') + // export DOCKER_GROUP_ID=$(getent group docker | awk -F ":" '{ print $3 }' ) "DOCKER_GROUP_ID": "${localEnv:DOCKER_GROUP_ID}", "INTERACTIVE": "true" } From ec3bb39e209320a0564e70c1717f21ca89d3370d Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:46:50 +0100 Subject: [PATCH 11/62] update required roles --- ui/app/src/components/shared/ResourceContextMenu.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index e1cf8d0a97..bdad7d0677 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -104,6 +104,11 @@ export const ResourceContextMenu: React.FunctionComponent = []; + const hasRequiredRoles = (roles) => { + const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; + return requiredRoles.some(role => roles.includes(role)); + } + menuItems = [ { key: 'update', @@ -115,14 +120,14 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || !roles.includes(WorkspaceRoleName.WorkspaceOwner)) + disabled: (props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) }, { key: 'delete', @@ -130,7 +135,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !roles.includes(WorkspaceRoleName.WorkspaceOwner)) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) }, ]; From eb9651e64ae85a3a738911cd5919c5894119525e Mon Sep 17 00:00:00 2001 From: Wojciech <159798789+wojciechcloudkubed@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:49:29 +0100 Subject: [PATCH 12/62] fix type --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index bdad7d0677..8cba30e2ae 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -104,7 +104,7 @@ export const ResourceContextMenu: React.FunctionComponent = []; - const hasRequiredRoles = (roles) => { + const hasRequiredRoles = (roles: string | string[]) => { const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; return requiredRoles.some(role => roles.includes(role)); } From 4a4f4df738eb97e9e8143616dd48d89d0f97e373 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:31:26 +0100 Subject: [PATCH 13/62] Update ResourceContextMenu.tsx --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 8cba30e2ae..5083df99cc 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -211,7 +211,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock) + disabled: (props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) }) } From 654484ba2bd8eb7abb2d9001969a0bc1318d9df7 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:25:14 +0100 Subject: [PATCH 14/62] slight update to roles --- ui/app/package.json | 2 +- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index 72e418d50f..08fc9df2ab 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.10", + "version": "0.5.11", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 5083df99cc..75ac41f3cf 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -77,7 +77,7 @@ export const ResourceContextMenu: React.FunctionComponent Date: Wed, 17 Apr 2024 13:10:57 +0100 Subject: [PATCH 15/62] Update ResourceContextMenu.tsx --- .../components/shared/ResourceContextMenu.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 75ac41f3cf..a874ca2a98 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -21,12 +21,18 @@ import { useAppDispatch } from '../../hooks/customReduxHooks'; import { addUpdateOperation } from '../shared/notifications/operationsSlice'; import { ConfirmUpgradeResource } from './ConfirmUpgradeResource'; + interface ResourceContextMenuProps { resource: Resource, componentAction: ComponentAction, commandBar?: boolean } +const hasRequiredRoles = (roles: string | string[]) => { + const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; + return requiredRoles.some(role => roles.includes(role)); +} + export const ResourceContextMenu: React.FunctionComponent = (props: ResourceContextMenuProps) => { const apiCall = useAuthApiCall(); const workspaceCtx = useContext(WorkspaceContext); @@ -40,6 +46,10 @@ export const ResourceContextMenu: React.FunctionComponent); const appRoles = useContext(AppRolesContext); // the user is in these roles which apply across the app const dispatch = useAppDispatch(); + useEffect(() => { + const disable = !hasRequiredRoles(roles); + setShowDisable(disable); + }, [roles]); // get the resource template useEffect(() => { @@ -77,7 +87,7 @@ export const ResourceContextMenu: React.FunctionComponent = []; - const hasRequiredRoles = (roles: string | string[]) => { - const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; - return requiredRoles.some(role => roles.includes(role)); - } - menuItems = [ { key: 'update', From bc4dda27f088ddad21b9abdcf95526269b64cb4f Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:40:13 +0100 Subject: [PATCH 16/62] Update ResourceContextMenu.tsx --- ui/app/src/components/shared/ResourceContextMenu.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index a874ca2a98..90fad52fda 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -46,10 +46,7 @@ export const ResourceContextMenu: React.FunctionComponent); const appRoles = useContext(AppRolesContext); // the user is in these roles which apply across the app const dispatch = useAppDispatch(); - useEffect(() => { - const disable = !hasRequiredRoles(roles); - setShowDisable(disable); - }, [roles]); + // get the resource template useEffect(() => { From 8f16befbe8b78d1e3fd647ae0e26753ec5c41fc3 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:09:59 +0100 Subject: [PATCH 17/62] Update ResourceContextMenu.tsx --- ui/app/src/components/shared/ResourceContextMenu.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 90fad52fda..3347dd2aff 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -22,6 +22,7 @@ import { addUpdateOperation } from '../shared/notifications/operationsSlice'; import { ConfirmUpgradeResource } from './ConfirmUpgradeResource'; + interface ResourceContextMenuProps { resource: Resource, componentAction: ComponentAction, From 034315ed5499ed95651c9346b54dc4228eb1bae6 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 16:28:16 +0100 Subject: [PATCH 18/62] testing role --- .../components/shared/ResourceContextMenu.tsx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 3347dd2aff..18ba6cf5a5 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -21,19 +21,12 @@ import { useAppDispatch } from '../../hooks/customReduxHooks'; import { addUpdateOperation } from '../shared/notifications/operationsSlice'; import { ConfirmUpgradeResource } from './ConfirmUpgradeResource'; - - interface ResourceContextMenuProps { resource: Resource, componentAction: ComponentAction, commandBar?: boolean } -const hasRequiredRoles = (roles: string | string[]) => { - const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; - return requiredRoles.some(role => roles.includes(role)); -} - export const ResourceContextMenu: React.FunctionComponent = (props: ResourceContextMenuProps) => { const apiCall = useAuthApiCall(); const workspaceCtx = useContext(WorkspaceContext); @@ -47,8 +40,13 @@ export const ResourceContextMenu: React.FunctionComponent); const appRoles = useContext(AppRolesContext); // the user is in these roles which apply across the app const dispatch = useAppDispatch(); - - + + const disallowedRoles = (roles: string | string[]) => { + const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; + console.log(requiredRoles.some(role => roles.includes(role))) + return requiredRoles.some(role => roles.includes(role)); + } + // get the resource template useEffect(() => { const getTemplate = async () => { @@ -123,22 +121,25 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) - }, + disabled: (props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), + hidden: disallowedRoles(roles) + }, { key: 'delete', text: 'Delete', title: props.resource.isEnabled ? 'Resource must be disabled before deleting' : 'Delete this resource', iconProps: { iconName: 'Delete' }, onClick: () => setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), + hidden: !disallowedRoles(roles) }, ]; @@ -173,7 +174,6 @@ export const ResourceContextMenu: React.FunctionComponent { return props.componentAction === ComponentAction.Lock || actionsDisabledStates.includes(props.resource.deploymentStatus) @@ -214,7 +214,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) + disabled: (props.componentAction === ComponentAction.Lock) }) } From 5434590d92dc70804d751c20327bf6515ae8b5d1 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 16:36:11 +0100 Subject: [PATCH 19/62] update --- ui/app/src/components/shared/ResourceContextMenu.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 18ba6cf5a5..d7f82c13e2 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -121,16 +121,14 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), - hidden: disallowedRoles(roles) + disabled: (props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)) }, { key: 'delete', @@ -138,8 +136,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), - hidden: !disallowedRoles(roles) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)) }, ]; From ce334338cb3d92e0d0394740e00345c719dcd905 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 16:36:31 +0100 Subject: [PATCH 20/62] update ui --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index 08fc9df2ab..ec70d88686 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.11", + "version": "0.5.12", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From aaf6fa4ce1e851d315462ec4235c09d596c7118c Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 11 Apr 2024 09:53:59 +0100 Subject: [PATCH 21/62] Update config.py --- api_app/core/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app/core/config.py b/api_app/core/config.py index aa84020783..bab2ee3b36 100644 --- a/api_app/core/config.py +++ b/api_app/core/config.py @@ -65,6 +65,6 @@ API_AUDIENCE: str = config("API_AUDIENCE", default=API_CLIENT_ID) -AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=1) +AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=48) API_ROOT_SCOPE: str = f"api://{API_CLIENT_ID}/user_impersonation" From 1beca08b62ca87b55b49085c4619b7e20484d459 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:36:48 +0100 Subject: [PATCH 22/62] Update config.py --- api_app/core/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app/core/config.py b/api_app/core/config.py index bab2ee3b36..aa84020783 100644 --- a/api_app/core/config.py +++ b/api_app/core/config.py @@ -65,6 +65,6 @@ API_AUDIENCE: str = config("API_AUDIENCE", default=API_CLIENT_ID) -AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=48) +AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=1) API_ROOT_SCOPE: str = f"api://{API_CLIENT_ID}/user_impersonation" From 5046b6b7676640780bd318ff7293f74587d60631 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:41:22 +0100 Subject: [PATCH 23/62] Update config.py --- api_app/core/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app/core/config.py b/api_app/core/config.py index aa84020783..bab2ee3b36 100644 --- a/api_app/core/config.py +++ b/api_app/core/config.py @@ -65,6 +65,6 @@ API_AUDIENCE: str = config("API_AUDIENCE", default=API_CLIENT_ID) -AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=1) +AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS: int = config("AIRLOCK_SAS_TOKEN_EXPIRY_PERIOD_IN_HOURS", default=48) API_ROOT_SCOPE: str = f"api://{API_CLIENT_ID}/user_impersonation" From 7b23fbe83335d18ecf23507917f8e7adb1b86afc Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 16:28:16 +0100 Subject: [PATCH 24/62] testing role --- .../components/shared/ResourceContextMenu.tsx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 3347dd2aff..18ba6cf5a5 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -21,19 +21,12 @@ import { useAppDispatch } from '../../hooks/customReduxHooks'; import { addUpdateOperation } from '../shared/notifications/operationsSlice'; import { ConfirmUpgradeResource } from './ConfirmUpgradeResource'; - - interface ResourceContextMenuProps { resource: Resource, componentAction: ComponentAction, commandBar?: boolean } -const hasRequiredRoles = (roles: string | string[]) => { - const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; - return requiredRoles.some(role => roles.includes(role)); -} - export const ResourceContextMenu: React.FunctionComponent = (props: ResourceContextMenuProps) => { const apiCall = useAuthApiCall(); const workspaceCtx = useContext(WorkspaceContext); @@ -47,8 +40,13 @@ export const ResourceContextMenu: React.FunctionComponent); const appRoles = useContext(AppRolesContext); // the user is in these roles which apply across the app const dispatch = useAppDispatch(); - - + + const disallowedRoles = (roles: string | string[]) => { + const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; + console.log(requiredRoles.some(role => roles.includes(role))) + return requiredRoles.some(role => roles.includes(role)); + } + // get the resource template useEffect(() => { const getTemplate = async () => { @@ -123,22 +121,25 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) - }, + disabled: (props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), + hidden: disallowedRoles(roles) + }, { key: 'delete', text: 'Delete', title: props.resource.isEnabled ? 'Resource must be disabled before deleting' : 'Delete this resource', iconProps: { iconName: 'Delete' }, onClick: () => setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), + hidden: !disallowedRoles(roles) }, ]; @@ -173,7 +174,6 @@ export const ResourceContextMenu: React.FunctionComponent { return props.componentAction === ComponentAction.Lock || actionsDisabledStates.includes(props.resource.deploymentStatus) @@ -214,7 +214,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock || !hasRequiredRoles(roles)) + disabled: (props.componentAction === ComponentAction.Lock) }) } From 15ec49f802cc404453d518c569767d3a7ece0aaf Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 16:36:11 +0100 Subject: [PATCH 25/62] update --- ui/app/src/components/shared/ResourceContextMenu.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 18ba6cf5a5..d7f82c13e2 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -121,16 +121,14 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), - hidden: disallowedRoles(roles) + disabled: (props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)) }, { key: 'delete', @@ -138,8 +136,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)), - hidden: !disallowedRoles(roles) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)) }, ]; From 3a0c2bb78951c996d373dae52d22940e295f7be5 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 16:36:31 +0100 Subject: [PATCH 26/62] update ui --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index 08fc9df2ab..ec70d88686 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.11", + "version": "0.5.12", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From d8768a50fcb6699dcb47f2c320b69ad4a65b9fdc Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 18:24:22 +0100 Subject: [PATCH 27/62] update to context menu --- ui/app/package.json | 2 +- .../components/shared/ResourceContextMenu.tsx | 32 ++++++++++++++----- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index ec70d88686..f3bc2b1801 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.12", + "version": "0.5.13", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index d7f82c13e2..40d635825e 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -41,10 +41,26 @@ export const ResourceContextMenu: React.FunctionComponent { - const requiredRoles = [WorkspaceRoleName.WorkspaceResearcher, WorkspaceRoleName.WorkspaceResearchLead]; - console.log(requiredRoles.some(role => roles.includes(role))) - return requiredRoles.some(role => roles.includes(role)); + const requiredRoles = (roles: string | string[], type: ResourceType) => { + let r = [] as Array; + switch (type) { + case ResourceType.SharedService: + r = [RoleName.TREAdmin, WorkspaceRoleName.WorkspaceOwner]; + break; + case ResourceType.WorkspaceService: + r = [WorkspaceRoleName.WorkspaceOwner] + break; + case ResourceType.UserResource: + r = [WorkspaceRoleName.WorkspaceOwner, WorkspaceRoleName.AirlockManager, WorkspaceRoleName.WorkspaceDataEngineer]; + break; + case ResourceType.Workspace: + r = [RoleName.TREAdmin, RoleName.ImperialTREAdmin]; + break; + default: + throw Error('Unsupported resource type.'); + } + console.log(r.some(role => roles.includes(role))) + return r.some(role => roles.includes(role)); } // get the resource template @@ -121,14 +137,14 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType)) }, { key: 'delete', @@ -136,7 +152,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || !disallowedRoles(roles)) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType)) }, ]; @@ -211,7 +227,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType)) }) } From b45ef05b0ed066e7dd2fd5cce90e24e69e1f0dbd Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 20:12:39 +0100 Subject: [PATCH 28/62] edit logging --- ui/app/package.json | 2 +- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index f3bc2b1801..db6258bc88 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.13", + "version": "0.5.14", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 1ba2647996..8727d2dea9 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -59,7 +59,7 @@ export const ResourceContextMenu: React.FunctionComponent roles.includes(role))) + console.log("Menu Role " + type + " : " + r.some(role => roles.includes(role))) return r.some(role => roles.includes(role)); } From 16b1f5f6e1f3abe7449a427b03692f13f64e1276 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 20:26:25 +0100 Subject: [PATCH 29/62] update ResourceType.Workspace --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 8727d2dea9..672f627038 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -54,7 +54,7 @@ export const ResourceContextMenu: React.FunctionComponent Date: Wed, 17 Apr 2024 20:33:45 +0100 Subject: [PATCH 30/62] update logging --- ui/app/src/components/shared/ResourceContextMenu.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 672f627038..8f92ff3bd0 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -41,7 +41,7 @@ export const ResourceContextMenu: React.FunctionComponent { + const requiredRoles = (roles: string | string[], type: ResourceType, menu: string) => { let r = [] as Array; switch (type) { case ResourceType.SharedService: @@ -59,7 +59,7 @@ export const ResourceContextMenu: React.FunctionComponent roles.includes(role))) + console.log(menu + " role " + type + " : " + r) return r.some(role => roles.includes(role)); } @@ -137,14 +137,14 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType)) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType, "disable")) }, { key: 'delete', @@ -152,7 +152,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType)) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType, "delete")) }, ]; @@ -227,7 +227,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType)) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType, "upgrade")) }) } From e82c9984265e697b3f2dd88a11073b06858be26c Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Wed, 17 Apr 2024 20:33:56 +0100 Subject: [PATCH 31/62] update ui --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index db6258bc88..039975a844 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.14", + "version": "0.5.15", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From d1d59a79540c1b757871e22029abd0a603bcac41 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 11:14:06 +0100 Subject: [PATCH 32/62] add in loggin --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 8f92ff3bd0..681c02a484 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -59,7 +59,7 @@ export const ResourceContextMenu: React.FunctionComponent roles.includes(role)); } From 98ae06e2b029d3443d4a6441fe0fef00dad868b7 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 11:15:42 +0100 Subject: [PATCH 33/62] update ui --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index 039975a844..1e6667fde5 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.15", + "version": "0.5.16", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From 24a01dceb42970b5c7e87cb108e32f376432ed29 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 11:57:40 +0100 Subject: [PATCH 34/62] update find role --- ui/app/package.json | 2 +- .../components/shared/ResourceContextMenu.tsx | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index 1e6667fde5..979dfa0a47 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.16", + "version": "0.5.17", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 681c02a484..6bee1ab4b6 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -41,7 +41,9 @@ export const ResourceContextMenu: React.FunctionComponent { + const requiredRoles = (type: ResourceType, menu: string) => { + + let wsAuth = false; let r = [] as Array; switch (type) { case ResourceType.SharedService: @@ -49,9 +51,11 @@ export const ResourceContextMenu: React.FunctionComponent roles.includes(role)); + const userRoles = wsAuth ? workspaceCtx.roles : appRoles.roles; + console.log(menu + " role " + type + " : " + r + " " + userRoles) + return !r.some(role => userRoles.includes(role)); } // get the resource template @@ -137,14 +142,14 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType, "disable")) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, "disable")) }, { key: 'delete', @@ -152,7 +157,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType, "delete")) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, "delete")) }, ]; @@ -227,7 +232,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(roles, props.resource.resourceType, "upgrade")) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, "upgrade")) }) } From 38fbc06eee68250db562e52d2ef5225cc3c05a8e Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 12:53:54 +0100 Subject: [PATCH 35/62] rewrite --- ui/app/package.json | 2 +- .../components/shared/ResourceContextMenu.tsx | 51 +++++++++++-------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index 979dfa0a47..2970d07636 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.17", + "version": "0.5.18", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 6bee1ab4b6..06c382d8f4 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -27,6 +27,15 @@ interface ResourceContextMenuProps { commandBar?: boolean } +enum ActionType { + Update = 'update', + Disable = 'disable', + Delete = 'delete', + Upgrade = 'upgrade', + Connect = 'connect', + Actions = 'actions' +} + export const ResourceContextMenu: React.FunctionComponent = (props: ResourceContextMenuProps) => { const apiCall = useAuthApiCall(); const workspaceCtx = useContext(WorkspaceContext); @@ -41,10 +50,10 @@ export const ResourceContextMenu: React.FunctionComponent { - + const requiredRoles = (type: ResourceType, action: ActionType) => { let wsAuth = false; let r = [] as Array; + switch (type) { case ResourceType.SharedService: r = [RoleName.TREAdmin, WorkspaceRoleName.WorkspaceOwner]; @@ -63,11 +72,11 @@ export const ResourceContextMenu: React.FunctionComponent userRoles.includes(role)); } - + // get the resource template useEffect(() => { const getTemplate = async () => { @@ -87,7 +96,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, "disable")) - }, + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Disable)) + }, { key: 'delete', text: 'Delete', title: props.resource.isEnabled ? 'Resource must be disabled before deleting' : 'Delete this resource', iconProps: { iconName: 'Delete' }, onClick: () => setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, "delete")) + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Delete)) }, ]; @@ -169,7 +178,7 @@ export const ResourceContextMenu: React.FunctionComponent !upgrade.forceUpdateRequired) - if (nonMajorUpgrades?.length > 0) { + if (nonMajorUpgrades?.length > 0 || !requiredRoles(props.resource.resourceType, ActionType.Upgrade)) { menuItems.push({ key: 'upgrade', text: 'Upgrade', title: 'Upgrade this resource template version', iconProps: { iconName: 'Refresh' }, onClick: () => setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, "upgrade")) + disabled: (props.componentAction === ComponentAction.Lock) }) } @@ -245,12 +254,12 @@ export const ResourceContextMenu: React.FunctionComponent - : - + + : + } /> { showDisable && @@ -261,7 +270,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowDelete(false)} resource={props.resource} /> } { - showCopyUrl && + showCopyUrl && setShowCopyUrl(false)} resource={props.resource} /> } { From 34268927fdcfbf9a260f509535f69881a712ed31 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 13:00:42 +0100 Subject: [PATCH 36/62] fixing logic --- ui/app/src/components/shared/ResourceContextMenu.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 06c382d8f4..d0d7079d06 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -72,7 +72,10 @@ export const ResourceContextMenu: React.FunctionComponent 0){ + userRoles.concat(workspaceCtx.roles); + } console.log(action + " role " + type + " : " + r + " : " + userRoles) return !r.some(role => userRoles.includes(role)); } From dd44af033f9638c35dfda5b8ace5b145dbc8c759 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:23:41 +0100 Subject: [PATCH 37/62] Update ResourceContextMenu.tsx --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index d0d7079d06..b23d92c952 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -244,7 +244,7 @@ export const ResourceContextMenu: React.FunctionComponent setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Upgrade)) }) } From 18a5b7b9f585aceca305ff18325f0357a7962925 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:24:04 +0100 Subject: [PATCH 38/62] Update package.json --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index 2970d07636..e451a92237 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.18", + "version": "0.5.19", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From b5049c8a1dc3273ce55cd1478b9eb7d631a19d70 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 13:46:07 +0100 Subject: [PATCH 39/62] remove logic --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index b23d92c952..0123c0791c 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -237,7 +237,7 @@ export const ResourceContextMenu: React.FunctionComponent !upgrade.forceUpdateRequired) - if (nonMajorUpgrades?.length > 0 || !requiredRoles(props.resource.resourceType, ActionType.Upgrade)) { + if (nonMajorUpgrades?.length > 0) { menuItems.push({ key: 'upgrade', text: 'Upgrade', From d9796d95d098a32b0747a7cd6db79a2a81bd8250 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 13:46:32 +0100 Subject: [PATCH 40/62] update --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index e451a92237..80d743cf93 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.19", + "version": "0.5.20", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From fa5b43a6ae6bcf215c49aa43eaff63382c0a4b45 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 14:23:49 +0100 Subject: [PATCH 41/62] fix --- ui/app/src/components/shared/ResourceContextMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 0123c0791c..5f033224fa 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -72,9 +72,9 @@ export const ResourceContextMenu: React.FunctionComponent 0){ - userRoles.concat(workspaceCtx.roles); + userRoles = userRoles.concat(workspaceCtx.roles); } console.log(action + " role " + type + " : " + r + " : " + userRoles) return !r.some(role => userRoles.includes(role)); From c37b55bc09681ed13622d3e881226188dbe8999c Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 18 Apr 2024 14:24:00 +0100 Subject: [PATCH 42/62] ui chnage --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index 80d743cf93..583ba8226f 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.20", + "version": "0.5.21", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From 02d34179d79aef17a39f88e0851f39abb38bd1ec Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 19 Apr 2024 11:56:40 +0100 Subject: [PATCH 43/62] testing update --- ui/app/src/components/shared/ResourceContextMenu.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 5f033224fa..dbd3071e46 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -161,7 +161,8 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Disable)) + // disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Disable)) + disabled: (props.componentAction === ComponentAction.Lock) }, { key: 'delete', From de7995b317b25e098304dd5266380c27a6e68248 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 19 Apr 2024 11:57:07 +0100 Subject: [PATCH 44/62] update version --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index 583ba8226f..c56874cce5 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.21", + "version": "0.5.22", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", From 70d9a75a7dce568f568ba80fbb4e7dba42e13754 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 19 Apr 2024 14:09:25 +0100 Subject: [PATCH 45/62] update --- ui/app/package.json | 2 +- ui/app/src/components/shared/ResourceContextMenu.tsx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index c56874cce5..f10160ea1f 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.22", + "version": "0.5.24", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index dbd3071e46..b1c32ef1ce 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -72,12 +72,12 @@ export const ResourceContextMenu: React.FunctionComponent 0){ - userRoles = userRoles.concat(workspaceCtx.roles); + currentUserRoles = currentUserRoles.concat(workspaceCtx.roles); } - console.log(action + " role " + type + " : " + r + " : " + userRoles) - return !r.some(role => userRoles.includes(role)); + console.log(action + " role " + type + " : " + r + " : " + currentUserRoles) + return !r.some(role => currentUserRoles.includes(role)); } // get the resource template @@ -161,8 +161,8 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - // disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Disable)) - disabled: (props.componentAction === ComponentAction.Lock) + disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Disable)) + // disabled: (props.componentAction === ComponentAction.Lock) }, { key: 'delete', From 64b63f193ff45b7661eb9329bb1848a920952d9c Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 19 Apr 2024 14:47:29 +0100 Subject: [PATCH 46/62] update to async --- ui/app/package.json | 2 +- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index f10160ea1f..2b8e3ff859 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.24", + "version": "0.5.25", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index b1c32ef1ce..8ded9e4d41 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -50,7 +50,7 @@ export const ResourceContextMenu: React.FunctionComponent { + const requiredRoles = async (type: ResourceType, action: ActionType) => { let wsAuth = false; let r = [] as Array; From 593f02a0ac014c2bde8f4c9fcf26906d43f08dbc Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 19 Apr 2024 15:21:30 +0100 Subject: [PATCH 47/62] update --- ui/app/package.json | 2 +- .../components/shared/ResourceContextMenu.tsx | 125 ++++++++++++------ 2 files changed, 82 insertions(+), 45 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index 2b8e3ff859..21e7938f1d 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.25", + "version": "0.5.26", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 8ded9e4d41..fd0d2a8f7d 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -50,36 +50,6 @@ export const ResourceContextMenu: React.FunctionComponent { - let wsAuth = false; - let r = [] as Array; - - switch (type) { - case ResourceType.SharedService: - r = [RoleName.TREAdmin, WorkspaceRoleName.WorkspaceOwner]; - break; - case ResourceType.WorkspaceService: - r = [WorkspaceRoleName.WorkspaceOwner] - wsAuth = true; - break; - case ResourceType.UserResource: - r = [WorkspaceRoleName.WorkspaceOwner, WorkspaceRoleName.AirlockManager, WorkspaceRoleName.WorkspaceDataEngineer]; - wsAuth = true; - break; - case ResourceType.Workspace: - r = [RoleName.TREAdmin, RoleName.ImperialTREAdmin, WorkspaceRoleName.WorkspaceOwner]; - break; - default: - throw Error('Unsupported resource type.'); - } - let currentUserRoles = appRoles.roles - if (workspaceCtx.roles.length > 0){ - currentUserRoles = currentUserRoles.concat(workspaceCtx.roles); - } - console.log(action + " role " + type + " : " + r + " : " + currentUserRoles) - return !r.some(role => currentUserRoles.includes(role)); - } - // get the resource template useEffect(() => { const getTemplate = async () => { @@ -140,11 +110,42 @@ export const ResourceContextMenu: React.FunctionComponent { + let wsAuth = false; + let r = [] as Array; + + switch (type) { + case ResourceType.SharedService: + r = [RoleName.TREAdmin, WorkspaceRoleName.WorkspaceOwner]; + break; + case ResourceType.WorkspaceService: + r = [WorkspaceRoleName.WorkspaceOwner] + wsAuth = true; + break; + case ResourceType.UserResource: + r = [WorkspaceRoleName.WorkspaceOwner, WorkspaceRoleName.AirlockManager, WorkspaceRoleName.WorkspaceDataEngineer]; + wsAuth = true; + break; + case ResourceType.Workspace: + r = [RoleName.TREAdmin, RoleName.ImperialTREAdmin, WorkspaceRoleName.WorkspaceOwner]; + break; + default: + throw Error('Unsupported resource type.'); + } + let currentUserRoles = appRoles.roles + if (workspaceCtx.roles.length > 0){ + currentUserRoles = currentUserRoles.concat(workspaceCtx.roles); + } + console.log(action + " role " + type + " : " + r + " : " + currentUserRoles) + return r.some(role => currentUserRoles.includes(role)); + } + + // context menu let menuItems: Array = []; - menuItems = [ - { + if (requiredRoles(props.resource.resourceType, ActionType.Update)) { + menuItems.push({ key: 'update', text: 'Update', iconProps: { iconName: 'WindowEdit' }, @@ -154,25 +155,61 @@ export const ResourceContextMenu: React.FunctionComponent setShowDisable(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Disable)) - // disabled: (props.componentAction === ComponentAction.Lock) - }, - { + disabled: (props.componentAction === ComponentAction.Lock) + }) + } + + if (requiredRoles(props.resource.resourceType, ActionType.Delete)) { + menuItems.push({ key: 'delete', text: 'Delete', title: props.resource.isEnabled ? 'Resource must be disabled before deleting' : 'Delete this resource', iconProps: { iconName: 'Delete' }, onClick: () => setShowDelete(true), - disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Delete)) - }, - ]; + disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock) + }) + } + + // menuItems = [ + // { + // key: 'update', + // text: 'Update', + // iconProps: { iconName: 'WindowEdit' }, + // onClick: () => createFormCtx.openCreateForm({ + // resourceType: props.resource.resourceType, + // updateResource: props.resource, + // resourceParent: parentResource, + // workspaceApplicationIdURI: workspaceCtx.workspaceApplicationIdURI, + // }), + // disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Update)) + // }, + // { + // key: 'disable', + // text: props.resource.isEnabled ? 'Disable' : 'Enable', + // iconProps: { iconName: props.resource.isEnabled ? 'CirclePause' : 'PlayResume' }, + // onClick: () => setShowDisable(true), + // disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Disable)) + // // disabled: (props.componentAction === ComponentAction.Lock) + // }, + // { + // key: 'delete', + // text: 'Delete', + // title: props.resource.isEnabled ? 'Resource must be disabled before deleting' : 'Delete this resource', + // iconProps: { iconName: 'Delete' }, + // onClick: () => setShowDelete(true), + // disabled: (props.resource.isEnabled || props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Delete)) + // }, + // ]; const shouldDisableConnect = () => { return props.componentAction === ComponentAction.Lock @@ -238,14 +275,14 @@ export const ResourceContextMenu: React.FunctionComponent !upgrade.forceUpdateRequired) - if (nonMajorUpgrades?.length > 0) { + if (nonMajorUpgrades?.length > 0 || requiredRoles(props.resource.resourceType, ActionType.Update)) { menuItems.push({ key: 'upgrade', text: 'Upgrade', title: 'Upgrade this resource template version', iconProps: { iconName: 'Refresh' }, onClick: () => setShowUpgrade(true), - disabled: (props.componentAction === ComponentAction.Lock || requiredRoles(props.resource.resourceType, ActionType.Upgrade)) + disabled: (props.componentAction === ComponentAction.Lock) }) } From 6620c8f3b603eb92ff26f3149ceb57e5b52af802 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 19 Apr 2024 15:46:45 +0100 Subject: [PATCH 48/62] update menu --- ui/app/package.json | 2 +- .../src/components/shared/ResourceContextMenu.tsx | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index 21e7938f1d..ad32d4d9c9 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.26", + "version": "0.5.27", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index fd0d2a8f7d..04228f45be 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -116,7 +116,7 @@ export const ResourceContextMenu: React.FunctionComponent 0){ - currentUserRoles = currentUserRoles.concat(workspaceCtx.roles); - } + // let currentUserRoles = appRoles.roles + // if (workspaceCtx.roles.length > 0){ + // currentUserRoles = currentUserRoles.concat(workspaceCtx.roles); + // } + const currentUserRoles = wsAuth ? workspaceCtx.roles : appRoles.roles; console.log(action + " role " + type + " : " + r + " : " + currentUserRoles) return r.some(role => currentUserRoles.includes(role)); } From 43c50727f21d28712f72e4c6df357359ce2d2a77 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 19 Apr 2024 16:49:34 +0100 Subject: [PATCH 49/62] update --- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 04228f45be..1d539d3c00 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -276,7 +276,7 @@ export const ResourceContextMenu: React.FunctionComponent !upgrade.forceUpdateRequired) - if (nonMajorUpgrades?.length > 0 || requiredRoles(props.resource.resourceType, ActionType.Update)) { + if (nonMajorUpgrades?.length > 0 || requiredRoles(props.resource.resourceType, ActionType.Upgrade)) { menuItems.push({ key: 'upgrade', text: 'Upgrade', From 6b943501b4e614ac356322a3a892ecf01c3cc484 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Mon, 22 Apr 2024 10:17:58 +0100 Subject: [PATCH 50/62] chnage to upgrade logic --- ui/app/package.json | 2 +- ui/app/src/components/shared/ResourceContextMenu.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/package.json b/ui/app/package.json index ad32d4d9c9..a152a541c1 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.27", + "version": "0.5.28", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0", diff --git a/ui/app/src/components/shared/ResourceContextMenu.tsx b/ui/app/src/components/shared/ResourceContextMenu.tsx index 1d539d3c00..af1dc36bd3 100644 --- a/ui/app/src/components/shared/ResourceContextMenu.tsx +++ b/ui/app/src/components/shared/ResourceContextMenu.tsx @@ -276,7 +276,7 @@ export const ResourceContextMenu: React.FunctionComponent !upgrade.forceUpdateRequired) - if (nonMajorUpgrades?.length > 0 || requiredRoles(props.resource.resourceType, ActionType.Upgrade)) { + if (nonMajorUpgrades?.length > 0 && requiredRoles(props.resource.resourceType, ActionType.Upgrade)) { menuItems.push({ key: 'upgrade', text: 'Upgrade', From 6fc962d7d9f3b701a17682eea17f3a4d1dbc4a25 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:29:44 +0100 Subject: [PATCH 51/62] adding new nexus --- .../sonatype-nexus-vm/parameters.json | 2 +- .../sonatype-nexus-vm/porter.yaml | 4 +-- .../scripts/configure_nexus_repos.sh | 2 +- .../scripts/deploy_nexus_container.sh | 2 +- .../microsoft_download_conf.json | 32 +++++++++++++++++++ .../sonatype-nexus-vm/template_schema.json | 2 +- .../sonatype-nexus-vm/terraform/vm.tf | 3 +- 7 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/microsoft_download_conf.json diff --git a/templates/shared_services/sonatype-nexus-vm/parameters.json b/templates/shared_services/sonatype-nexus-vm/parameters.json index 0e7c0c4e58..518185450b 100755 --- a/templates/shared_services/sonatype-nexus-vm/parameters.json +++ b/templates/shared_services/sonatype-nexus-vm/parameters.json @@ -53,4 +53,4 @@ } } ] -} +} \ No newline at end of file diff --git a/templates/shared_services/sonatype-nexus-vm/porter.yaml b/templates/shared_services/sonatype-nexus-vm/porter.yaml index 307bee19bc..ad78ed9b1d 100644 --- a/templates/shared_services/sonatype-nexus-vm/porter.yaml +++ b/templates/shared_services/sonatype-nexus-vm/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-sonatype-nexus -version: 2.8.13 +version: 2.8.15 description: "A Sonatype Nexus shared service" dockerfile: Dockerfile.tmpl registry: azuretre @@ -127,4 +127,4 @@ uninstall: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } container_name: ${ bundle.parameters.tfstate_container_name } - key: ${ bundle.parameters.tre_id }-shared-service-sonatype-nexus-vm + key: ${ bundle.parameters.tre_id }-shared-service-sonatype-nexus-vm \ No newline at end of file diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh b/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh index 3487f1413c..952717069b 100644 --- a/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh +++ b/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh @@ -58,4 +58,4 @@ status_code=$(curl -iu admin:"$1" -XPUT \ -H 'Content-Type: application/json' \ -d @"$(dirname "${BASH_SOURCE[0]}")"/nexus_realms_config.json \ -k -s -w "%{http_code}" -o /dev/null) -echo "Response received from Nexus: $status_code" +echo "Response received from Nexus: $status_code" \ No newline at end of file diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh b/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh index 84e4d964b4..8ee69957d6 100644 --- a/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh +++ b/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh @@ -24,4 +24,4 @@ docker run -d -p 80:8081 -p 443:8443 -p 8083:8083 -v /etc/nexus-data:/nexus-data --restart always \ --name nexus \ --log-driver local \ - sonatype/nexus3 + sonatype/nexus3 \ No newline at end of file diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/microsoft_download_conf.json b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/microsoft_download_conf.json new file mode 100644 index 0000000000..a153c626a9 --- /dev/null +++ b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/microsoft_download_conf.json @@ -0,0 +1,32 @@ +{ + "name": "microsoft-download", + "online": true, + "storage": { + "blobStoreName": "default", + "strictContentTypeValidation": true, + "write_policy": "ALLOW" + }, + "proxy": { + "remoteUrl": "https://download.microsoft.com/download", + "contentMaxAge": 1440, + "metadataMaxAge": 1440 + }, + "negativeCache": { + "enabled": true, + "timeToLive": 1440 + }, + "httpClient": { + "blocked": false, + "autoBlock": false, + "connection": { + "retries": 0, + "userAgentSuffix": "string", + "timeout": 60, + "enableCircularRedirects": false, + "enableCookies": false, + "useTrustStore": false + } + }, + "baseType": "raw", + "repoType": "proxy" + } \ No newline at end of file diff --git a/templates/shared_services/sonatype-nexus-vm/template_schema.json b/templates/shared_services/sonatype-nexus-vm/template_schema.json index a63d7fefcd..311d2c1371 100644 --- a/templates/shared_services/sonatype-nexus-vm/template_schema.json +++ b/templates/shared_services/sonatype-nexus-vm/template_schema.json @@ -192,4 +192,4 @@ } ] } -} +} \ No newline at end of file diff --git a/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf b/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf index 27a6a3d04f..f6e9d02bfa 100644 --- a/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf +++ b/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf @@ -83,6 +83,7 @@ resource "azurerm_user_assigned_identity" "nexus_msi" { location = data.azurerm_resource_group.rg.location resource_group_name = local.core_resource_group_name tags = local.tre_shared_service_tags + lifecycle { ignore_changes = [tags] } } @@ -252,4 +253,4 @@ resource "azurerm_virtual_machine_extension" "keyvault" { }) lifecycle { ignore_changes = [tags] } -} +} \ No newline at end of file From e206535ce972fc1cff8018282abd2fe4f1fb2486 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:31:28 +0100 Subject: [PATCH 52/62] adding new nexus --- templates/shared_services/sonatype-nexus-vm/parameters.json | 2 +- templates/shared_services/sonatype-nexus-vm/porter.yaml | 4 ++-- .../sonatype-nexus-vm/scripts/configure_nexus_repos.sh | 2 +- .../sonatype-nexus-vm/scripts/deploy_nexus_container.sh | 2 +- .../shared_services/sonatype-nexus-vm/template_schema.json | 2 +- templates/shared_services/sonatype-nexus-vm/terraform/vm.tf | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/shared_services/sonatype-nexus-vm/parameters.json b/templates/shared_services/sonatype-nexus-vm/parameters.json index 518185450b..0e7c0c4e58 100755 --- a/templates/shared_services/sonatype-nexus-vm/parameters.json +++ b/templates/shared_services/sonatype-nexus-vm/parameters.json @@ -53,4 +53,4 @@ } } ] -} \ No newline at end of file +} diff --git a/templates/shared_services/sonatype-nexus-vm/porter.yaml b/templates/shared_services/sonatype-nexus-vm/porter.yaml index ad78ed9b1d..fccc7bffd4 100644 --- a/templates/shared_services/sonatype-nexus-vm/porter.yaml +++ b/templates/shared_services/sonatype-nexus-vm/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-sonatype-nexus -version: 2.8.15 +version: 2.8.16 description: "A Sonatype Nexus shared service" dockerfile: Dockerfile.tmpl registry: azuretre @@ -127,4 +127,4 @@ uninstall: resource_group_name: ${ bundle.parameters.tfstate_resource_group_name } storage_account_name: ${ bundle.parameters.tfstate_storage_account_name } container_name: ${ bundle.parameters.tfstate_container_name } - key: ${ bundle.parameters.tre_id }-shared-service-sonatype-nexus-vm \ No newline at end of file + key: ${ bundle.parameters.tre_id }-shared-service-sonatype-nexus-vm diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh b/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh index 952717069b..3487f1413c 100644 --- a/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh +++ b/templates/shared_services/sonatype-nexus-vm/scripts/configure_nexus_repos.sh @@ -58,4 +58,4 @@ status_code=$(curl -iu admin:"$1" -XPUT \ -H 'Content-Type: application/json' \ -d @"$(dirname "${BASH_SOURCE[0]}")"/nexus_realms_config.json \ -k -s -w "%{http_code}" -o /dev/null) -echo "Response received from Nexus: $status_code" \ No newline at end of file +echo "Response received from Nexus: $status_code" diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh b/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh index 8ee69957d6..84e4d964b4 100644 --- a/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh +++ b/templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh @@ -24,4 +24,4 @@ docker run -d -p 80:8081 -p 443:8443 -p 8083:8083 -v /etc/nexus-data:/nexus-data --restart always \ --name nexus \ --log-driver local \ - sonatype/nexus3 \ No newline at end of file + sonatype/nexus3 diff --git a/templates/shared_services/sonatype-nexus-vm/template_schema.json b/templates/shared_services/sonatype-nexus-vm/template_schema.json index 311d2c1371..a63d7fefcd 100644 --- a/templates/shared_services/sonatype-nexus-vm/template_schema.json +++ b/templates/shared_services/sonatype-nexus-vm/template_schema.json @@ -192,4 +192,4 @@ } ] } -} \ No newline at end of file +} diff --git a/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf b/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf index f6e9d02bfa..79dfa04472 100644 --- a/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf +++ b/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf @@ -253,4 +253,4 @@ resource "azurerm_virtual_machine_extension" "keyvault" { }) lifecycle { ignore_changes = [tags] } -} \ No newline at end of file +} From ff7c1d89cbfa4ccad03751d70a506fcffa374785 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:57:38 +0100 Subject: [PATCH 53/62] Update apt_sources_config.yml --- .../guacamole-azure-linuxvm/terraform/apt_sources_config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/terraform/apt_sources_config.yml b/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/terraform/apt_sources_config.yml index 22b3418d5b..ae558a7085 100644 --- a/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/terraform/apt_sources_config.yml +++ b/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/terraform/apt_sources_config.yml @@ -14,6 +14,8 @@ apt: deb [trusted=yes] $PRIMARY $RELEASE main restricted universe multiverse deb [trusted=yes] $PRIMARY $RELEASE-updates main restricted universe multiverse deb [trusted=yes] $SECURITY $RELEASE main restricted universe multiverse - deb [signed-by=/etc/apt/trusted.gpg.d/microsoft.gpg] ${nexus_proxy_url}/repository/microsoft-apt/ubuntu/18.04/prod $RELEASE main + deb [signed-by=/etc/apt/trusted.gpg.d/microsoft.gpg] ${nexus_proxy_url}/repository/microsoft-apt/ubuntu/${apt_sku}/prod $RELEASE main deb [signed-by=/etc/apt/trusted.gpg.d/microsoft.gpg] ${nexus_proxy_url}/repository/microsoft-apt/repos/edge stable main + deb [signed-by=/etc/apt/trusted.gpg.d/microsoft.gpg] ${nexus_proxy_url}/repository/microsoft-apt/repos/vscode stable main + deb [signed-by=/etc/apt/trusted.gpg.d/microsoft.gpg] ${nexus_proxy_url}/repository/microsoft-apt/repos/azure-cli stable main deb [signed-by=/etc/apt/trusted.gpg.d/docker-archive-keyring.gpg] ${nexus_proxy_url}/repository/docker/ $RELEASE stable From 485213897d79af3f2b8a59de1f383cf3d8727b8a Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:58:04 +0100 Subject: [PATCH 54/62] Update porter.yaml --- .../user_resources/guacamole-azure-linuxvm/porter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/porter.yaml b/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/porter.yaml index f36a668258..14ea690b02 100644 --- a/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/porter.yaml +++ b/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-service-guacamole-linuxvm -version: 0.6.9 +version: 0.6.10 description: "An Azure TRE User Resource Template for Guacamole (Linux)" dockerfile: Dockerfile.tmpl registry: azuretre From df7e02a09e7e0a761fa37e50bd8c201d8ceceee8 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:22:22 +0100 Subject: [PATCH 55/62] Update locals.tf --- templates/shared_services/sonatype-nexus-vm/terraform/locals.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/shared_services/sonatype-nexus-vm/terraform/locals.tf b/templates/shared_services/sonatype-nexus-vm/terraform/locals.tf index c0484c712f..67cae90039 100644 --- a/templates/shared_services/sonatype-nexus-vm/terraform/locals.tf +++ b/templates/shared_services/sonatype-nexus-vm/terraform/locals.tf @@ -1,7 +1,7 @@ locals { core_vnet = "vnet-${var.tre_id}" core_resource_group_name = "rg-${var.tre_id}" - nexus_allowed_fqdns = "pypi.org,*.pypi.org,files.pythonhosted.org,security.ubuntu.com,archive.ubuntu.com,keyserver.ubuntu.com,repo.anaconda.com,*.docker.com,*.docker.io,conda.anaconda.org,azure.archive.ubuntu.com,packages.microsoft.com,repo.almalinux.org,download-ib01.fedoraproject.org,cran.r-project.org,cloud.r-project.org" + nexus_allowed_fqdns = "pypi.org,*.pypi.org,files.pythonhosted.org,security.ubuntu.com,archive.ubuntu.com,keyserver.ubuntu.com,repo.anaconda.com,*.docker.com,*.docker.io,conda.anaconda.org,azure.archive.ubuntu.com,packages.microsoft.com,repo.almalinux.org,download-ib01.fedoraproject.org,cran.r-project.org,cloud.r-project.org,download1.rstudio.org,*.snapcraftcontent.com,download.microsoft.com" nexus_allowed_fqdns_list = distinct(compact(split(",", replace(local.nexus_allowed_fqdns, " ", "")))) workspace_vm_allowed_fqdns = "r3.o.lencr.org,x1.c.lencr.org" workspace_vm_allowed_fqdns_list = distinct(compact(split(",", replace(local.workspace_vm_allowed_fqdns, " ", "")))) From 117f65b445298d2f9ff01d89dffb9b668baeaf00 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:05:13 +0100 Subject: [PATCH 56/62] Update nexus_realms_config.json Moved Docker to the top of priority and removed the realm which doesn't exist anymore --- .../sonatype-nexus-vm/scripts/nexus_realms_config.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/nexus_realms_config.json b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_realms_config.json index 51fa1053e0..eeb2530e36 100644 --- a/templates/shared_services/sonatype-nexus-vm/scripts/nexus_realms_config.json +++ b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_realms_config.json @@ -1,5 +1,4 @@ [ - "NexusAuthenticatingRealm", - "NexusAuthorizingRealm", - "DockerToken" + "DockerToken", + "NexusAuthenticatingRealm" ] From 3e82794f75e7e08bac59039830742d07f41a1029 Mon Sep 17 00:00:00 2001 From: danny-cooke-icl <138700430+danny-cooke-icl@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:28:02 +0100 Subject: [PATCH 57/62] last of the nexus changes --- .../sonatype-nexus-vm/porter.yaml | 2 +- .../r_studio_download_conf.json | 32 +++++++++++++++++++ .../nexus_repos_config/snapcraft_conf.json | 32 +++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/r_studio_download_conf.json create mode 100644 templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/snapcraft_conf.json diff --git a/templates/shared_services/sonatype-nexus-vm/porter.yaml b/templates/shared_services/sonatype-nexus-vm/porter.yaml index fccc7bffd4..3a43b76d2b 100644 --- a/templates/shared_services/sonatype-nexus-vm/porter.yaml +++ b/templates/shared_services/sonatype-nexus-vm/porter.yaml @@ -1,7 +1,7 @@ --- schemaVersion: 1.0.0 name: tre-shared-service-sonatype-nexus -version: 2.8.16 +version: 2.8.17 description: "A Sonatype Nexus shared service" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/r_studio_download_conf.json b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/r_studio_download_conf.json new file mode 100644 index 0000000000..264deeeb36 --- /dev/null +++ b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/r_studio_download_conf.json @@ -0,0 +1,32 @@ +{ + "name": "r-studio-download", + "online": true, + "storage": { + "blobStoreName": "default", + "strictContentTypeValidation": true, + "write_policy": "ALLOW" + }, + "proxy": { + "remoteUrl": "https://download1.rstudio.org", + "contentMaxAge": 1440, + "metadataMaxAge": 1440 + }, + "negativeCache": { + "enabled": true, + "timeToLive": 1440 + }, + "httpClient": { + "blocked": false, + "autoBlock": false, + "connection": { + "retries": 0, + "userAgentSuffix": "string", + "timeout": 60, + "enableCircularRedirects": false, + "enableCookies": false, + "useTrustStore": false + } + }, + "baseType": "raw", + "repoType": "proxy" + } \ No newline at end of file diff --git a/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/snapcraft_conf.json b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/snapcraft_conf.json new file mode 100644 index 0000000000..33019c0a48 --- /dev/null +++ b/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/snapcraft_conf.json @@ -0,0 +1,32 @@ +{ + "name": "snapcraft", + "online": true, + "storage": { + "blobStoreName": "default", + "strictContentTypeValidation": true, + "write_policy": "ALLOW" + }, + "proxy": { + "remoteUrl": "https://snapcraftcontent.com", + "contentMaxAge": 1440, + "metadataMaxAge": 1440 + }, + "negativeCache": { + "enabled": true, + "timeToLive": 1440 + }, + "httpClient": { + "blocked": false, + "autoBlock": false, + "connection": { + "retries": 0, + "userAgentSuffix": "string", + "timeout": 60, + "enableCircularRedirects": false, + "enableCookies": false, + "useTrustStore": false + } + }, + "baseType": "raw", + "repoType": "proxy" + } \ No newline at end of file From 55b5e7da30301371eca10c7a5e0d4184aa9dcd79 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Thu, 2 May 2024 17:39:41 +0100 Subject: [PATCH 58/62] edit branding --- ui/app/src/App.scss | 2 +- ui/app/src/assets/imperial_college_logo.svg | 60 ++++++++----------- .../src/assets/imperial_college_logo_old.svg | 35 +++++++++++ ui/app/src/components/shared/Footer.tsx | 2 +- ui/app/src/components/shared/TopNav.tsx | 2 +- 5 files changed, 64 insertions(+), 37 deletions(-) create mode 100644 ui/app/src/assets/imperial_college_logo_old.svg diff --git a/ui/app/src/App.scss b/ui/app/src/App.scss index a1965cb715..316d62644c 100644 --- a/ui/app/src/App.scss +++ b/ui/app/src/App.scss @@ -26,7 +26,7 @@ code { .tre-top-nav { // box-shadow: 0 1px 2px 0px #033d68; - box-shadow: 0 1px 2px 0px #003E74; + box-shadow: 0 1px 2px 0px #0000CD; z-index: 100; } diff --git a/ui/app/src/assets/imperial_college_logo.svg b/ui/app/src/assets/imperial_college_logo.svg index a3e0fb051e..0b82a52c91 100644 --- a/ui/app/src/assets/imperial_college_logo.svg +++ b/ui/app/src/assets/imperial_college_logo.svg @@ -1,35 +1,27 @@ - - - - Logo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/ui/app/src/assets/imperial_college_logo_old.svg b/ui/app/src/assets/imperial_college_logo_old.svg new file mode 100644 index 0000000000..a3e0fb051e --- /dev/null +++ b/ui/app/src/assets/imperial_college_logo_old.svg @@ -0,0 +1,35 @@ + + + + Logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/app/src/components/shared/Footer.tsx b/ui/app/src/components/shared/Footer.tsx index 3b2e9bce84..e2bd70832b 100644 --- a/ui/app/src/components/shared/Footer.tsx +++ b/ui/app/src/components/shared/Footer.tsx @@ -127,7 +127,7 @@ const contentClass = mergeStyles([ { alignItems: 'center', // backgroundColor: theme.palette.themeDark, - backgroundColor: '#003E74', + backgroundColor: '#0000CD', color: theme.palette.white, lineHeight: '25px', padding: '0 20px', diff --git a/ui/app/src/components/shared/TopNav.tsx b/ui/app/src/components/shared/TopNav.tsx index eabecd77e5..0b8f365f8b 100644 --- a/ui/app/src/components/shared/TopNav.tsx +++ b/ui/app/src/components/shared/TopNav.tsx @@ -32,7 +32,7 @@ const theme = getTheme(); const contentClass = mergeStyles([ { // backgroundColor: theme.palette.themeDark, - backgroundColor: '#003E74', + backgroundColor: '#0000CD', color: theme.palette.white, lineHeight: '50px', padding: '0 10px 0 10px' From a68e01dc2de1a7919e50b94582af82e60742bf6b Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 3 May 2024 09:36:29 +0100 Subject: [PATCH 59/62] update logo to white one --- ui/app/src/assets/imperial_college_logo.svg | 31 +++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ui/app/src/assets/imperial_college_logo.svg b/ui/app/src/assets/imperial_college_logo.svg index 0b82a52c91..e39aca2d37 100644 --- a/ui/app/src/assets/imperial_college_logo.svg +++ b/ui/app/src/assets/imperial_college_logo.svg @@ -2,26 +2,29 @@ + - - + - + - - - - - + + + + From 5bd911573c099bc28022f3489e38f98f567e4dfb Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 3 May 2024 09:38:03 +0000 Subject: [PATCH 60/62] update colours --- ui/app/src/components/shared/ComplexItemDisplay.tsx | 8 ++++---- ui/app/src/components/shared/Footer.tsx | 2 +- ui/app/src/components/workspaces/WorkspaceHeader.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/app/src/components/shared/ComplexItemDisplay.tsx b/ui/app/src/components/shared/ComplexItemDisplay.tsx index a2b684b092..7759604b8e 100644 --- a/ui/app/src/components/shared/ComplexItemDisplay.tsx +++ b/ui/app/src/components/shared/ComplexItemDisplay.tsx @@ -91,8 +91,8 @@ const contentStyles = mergeStyleSets({ { flex: '1 1 auto', // borderTop: `4px solid ${theme.palette.themePrimary}`, - borderTop: `4px solid #006EAF`, - color: theme.palette.neutralPrimary, + borderTop: `4px solid #0000CD`, + color: '#0000CD', display: 'flex', alignItems: 'center', fontWeight: FontWeights.semibold, @@ -112,12 +112,12 @@ const contentStyles = mergeStyleSets({ }); const iconButtonStyles: Partial = { root: { - color: theme.palette.neutralPrimary, + color: '#0000CD', marginLeft: 'auto', marginTop: '4px', marginRight: '2px', }, rootHovered: { - color: theme.palette.neutralDark, + color: '#161A1D', }, }; diff --git a/ui/app/src/components/shared/Footer.tsx b/ui/app/src/components/shared/Footer.tsx index e2bd70832b..84988bafc7 100644 --- a/ui/app/src/components/shared/Footer.tsx +++ b/ui/app/src/components/shared/Footer.tsx @@ -140,7 +140,7 @@ const iconButtonStyles: Partial = { color: theme.palette.white, }, rootHovered: { - color: theme.palette.neutralDark, + color: '#161A1D', }, }; diff --git a/ui/app/src/components/workspaces/WorkspaceHeader.tsx b/ui/app/src/components/workspaces/WorkspaceHeader.tsx index ffd998de41..16cd0b58ea 100644 --- a/ui/app/src/components/workspaces/WorkspaceHeader.tsx +++ b/ui/app/src/components/workspaces/WorkspaceHeader.tsx @@ -23,7 +23,7 @@ const theme = getTheme(); const contentClass = mergeStyles([ { // backgroundColor: theme.palette.themeDarker, - backgroundColor: '#002147', + backgroundColor: '#161A1D', color: theme.palette.white, lineHeight: '15px', padding: '0 20px', From 84150f948773a889d8bc699c40d380020d8ada32 Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 3 May 2024 09:39:15 +0000 Subject: [PATCH 61/62] update --- .../components/shared/airlock/AirlockReviewRequest.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/app/src/components/shared/airlock/AirlockReviewRequest.tsx b/ui/app/src/components/shared/airlock/AirlockReviewRequest.tsx index 4c8b771f55..30b114d9a7 100644 --- a/ui/app/src/components/shared/airlock/AirlockReviewRequest.tsx +++ b/ui/app/src/components/shared/airlock/AirlockReviewRequest.tsx @@ -337,8 +337,8 @@ const contentStyles = mergeStyleSets({ { flex: '1 1 auto', // borderTop: `4px solid ${theme.palette.themePrimary}`, - borderTop: `4px solid #006EAF`, - color: theme.palette.neutralPrimary, + borderTop: `4px solid #0000CD`, + color: '#0000CD', display: 'flex', alignItems: 'center', fontWeight: FontWeights.semibold, @@ -360,13 +360,13 @@ const contentStyles = mergeStyleSets({ const iconButtonStyles: Partial = { root: { - color: theme.palette.neutralPrimary, + color: '#0000CD', marginLeft: 'auto', marginTop: '4px', marginRight: '2px', }, rootHovered: { - color: theme.palette.neutralDark, + color: '#161A1D', }, }; From 958454488c21b7f8c518080da165d3c490df3a2d Mon Sep 17 00:00:00 2001 From: tim-allen-ck Date: Fri, 3 May 2024 11:02:49 +0100 Subject: [PATCH 62/62] update version --- ui/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/package.json b/ui/app/package.json index a152a541c1..76c04f2b7a 100644 --- a/ui/app/package.json +++ b/ui/app/package.json @@ -1,6 +1,6 @@ { "name": "tre-ui", - "version": "0.5.28", + "version": "0.5.29", "private": true, "dependencies": { "@azure/msal-browser": "^2.35.0",