feat: show user as a link in feedback response table
Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-entity-feedback': patch
|
||||
---
|
||||
|
||||
Show user in feedback response table as link
|
||||
+4
@@ -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', () => {
|
||||
<TestApiProvider apis={[[entityFeedbackApiRef, feedbackApi]]}>
|
||||
<FeedbackResponseTable {...props} entityRef="component:default/test" />
|
||||
</TestApiProvider>,
|
||||
{
|
||||
mountedRoutes: { '/catalog/:namespace/:kind/:name': entityRouteRef },
|
||||
},
|
||||
);
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+7
-5
@@ -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) => (
|
||||
<EntityRefLink
|
||||
entityRef={parseEntityRef(response.userRef, { defaultKind: 'user' })}
|
||||
defaultKind="user"
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'OK to contact?',
|
||||
|
||||
Reference in New Issue
Block a user