From 8bbb654f7a12473be0b456093e67525b1b41d391 Mon Sep 17 00:00:00 2001 From: marrobi Date: Mon, 16 Oct 2023 15:32:40 +0000 Subject: [PATCH] Notifications how workspace details, rather than the actual resource Fixes #3746 --- CHANGELOG.md | 1 + ui/app/package.json | 2 +- .../components/shared/notifications/NotificationItem.tsx | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6261b3bdbb..a6f75efb98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ FEATURES: ENHANCEMENTS: BUG FIXES: +* Fix notifications displaying workspace name rather than actual resource ([#3746](https://github.com/microsoft/AzureTRE/issues/3746)) COMPONENTS: diff --git a/ui/app/package.json b/ui/app/package.json index fd34b55863..5f08e021a1 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/notifications/NotificationItem.tsx b/ui/app/src/components/shared/notifications/NotificationItem.tsx index 39bd45580f..9a44d412c8 100644 --- a/ui/app/src/components/shared/notifications/NotificationItem.tsx +++ b/ui/app/src/components/shared/notifications/NotificationItem.tsx @@ -47,14 +47,15 @@ export const NotificationItem: React.FunctionComponent = if (op.resourcePath.indexOf(ApiEndpoint.Workspaces) !== -1) { const wsId = op.resourcePath.split('/')[2]; let scopeId = (await apiCall(`${ApiEndpoint.Workspaces}/${wsId}/scopeid`, HttpMethod.Get)).workspaceAuth.scopeId; + ws = (await apiCall(`${ApiEndpoint.Workspaces}/${wsId}`, HttpMethod.Get, scopeId)).workspace; - // is actually a workspace operation or workspace child resource operation + // is a workspace child resource operation if (op.resourcePath.split('/').length >= 3) { - ws = (await apiCall(`${ApiEndpoint.Workspaces}/${wsId}`, HttpMethod.Get, scopeId)).workspace; - resource = ws; - } else { let r = await apiCall(op.resourcePath, HttpMethod.Get, scopeId); resource = getResourceFromResult(r); + // is a workspace operation + } else { + resource = ws; } } else { let r = await apiCall(op.resourcePath, HttpMethod.Get);