From 5c0f095c76603a5ba399db000c8e84a301682e58 Mon Sep 17 00:00:00 2001 From: Heikki Hellgren Date: Thu, 15 Jun 2023 15:37:23 +0300 Subject: [PATCH] feat: show user as a link in feedback response table Signed-off-by: Heikki Hellgren --- .changeset/lovely-donuts-tan.md | 5 +++++ .../FeedbackResponseTable.test.tsx | 4 ++++ .../FeedbackResponseTable/FeedbackResponseTable.tsx | 12 +++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .changeset/lovely-donuts-tan.md diff --git a/.changeset/lovely-donuts-tan.md b/.changeset/lovely-donuts-tan.md new file mode 100644 index 0000000000..73dc312498 --- /dev/null +++ b/.changeset/lovely-donuts-tan.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-entity-feedback': patch +--- + +Show user in feedback response table as link diff --git a/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.test.tsx b/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.test.tsx index c5d3d51884..5e0dcbf67b 100644 --- a/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.test.tsx +++ b/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.test.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { entityRouteRef } from '@backstage/plugin-catalog-react'; import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; import React from 'react'; import { EntityFeedbackApi, entityFeedbackApiRef } from '../../api'; @@ -44,6 +45,9 @@ describe('FeedbackResponseTable', () => { , + { + mountedRoutes: { '/catalog/:namespace/:kind/:name': entityRouteRef }, + }, ); beforeEach(() => { diff --git a/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.tsx b/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.tsx index ba954c7747..4bfda764f7 100644 --- a/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.tsx +++ b/plugins/entity-feedback/src/components/FeedbackResponseTable/FeedbackResponseTable.tsx @@ -17,7 +17,7 @@ import { parseEntityRef } from '@backstage/catalog-model'; import { ErrorPanel, Table } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; -import { humanizeEntityRef } from '@backstage/plugin-catalog-react'; +import { EntityRefLink } from '@backstage/plugin-catalog-react'; import { FeedbackResponse } from '@backstage/plugin-entity-feedback-common'; import { BackstageTheme } from '@backstage/theme'; import { Chip, makeStyles } from '@material-ui/core'; @@ -65,10 +65,12 @@ export const FeedbackResponseTable = (props: FeedbackResponseTableProps) => { title: 'User', field: 'userRef', width: '15%', - render: (response: ResponseRow) => - humanizeEntityRef(parseEntityRef(response.userRef), { - defaultKind: 'user', - }), + render: (response: ResponseRow) => ( + + ), }, { title: 'OK to contact?',