From 2ad1bacef70eed361d6685aec20a43bb409888e9 Mon Sep 17 00:00:00 2001 From: Chris Langhout Date: Thu, 9 Nov 2023 10:25:57 +0100 Subject: [PATCH 1/2] feat: add entityRef to Entity Inspector view Signed-off-by: Chris Langhout --- .changeset/cool-bulldogs-itch.md | 5 +++++ .../InspectEntityDialog/components/OverviewPage.tsx | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/cool-bulldogs-itch.md diff --git a/.changeset/cool-bulldogs-itch.md b/.changeset/cool-bulldogs-itch.md new file mode 100644 index 0000000000..8f48befee2 --- /dev/null +++ b/.changeset/cool-bulldogs-itch.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': patch +--- + +Add EntityRef to Entity Inspector UI diff --git a/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx b/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx index d2eb6d4266..26aa69e425 100644 --- a/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx +++ b/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx @@ -36,6 +36,7 @@ import { ListSubheader, } from './common'; import { EntityKindIcon } from './EntityKindIcon'; +import { stringifyEntityRef } from '@backstage/catalog-model'; const useStyles = makeStyles({ root: { @@ -90,6 +91,12 @@ export function OverviewPage(props: { entity: AlphaEntity }) { )} + + + From 20d440e4564b9d92bc3c9402432c3e0ed8f7adb1 Mon Sep 17 00:00:00 2001 From: Chris Langhout Date: Thu, 9 Nov 2023 18:50:31 +0100 Subject: [PATCH 2/2] feat: add copy to clipboard button for uid etag and entityRef Signed-off-by: Chris Langhout --- .../components/OverviewPage.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx b/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx index 26aa69e425..8b3b69a55a 100644 --- a/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx +++ b/plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx @@ -21,6 +21,7 @@ import { List, ListItem, ListItemIcon, + ListItemSecondaryAction, makeStyles, Typography, } from '@material-ui/core'; @@ -37,6 +38,7 @@ import { } from './common'; import { EntityKindIcon } from './EntityKindIcon'; import { stringifyEntityRef } from '@backstage/catalog-model'; +import { CopyTextButton } from '@backstage/core-components'; const useStyles = makeStyles({ root: { @@ -61,6 +63,7 @@ export function OverviewPage(props: { entity: AlphaEntity }) { 'type', ); + const entityRef = stringifyEntityRef(props.entity); return ( <> Overview @@ -84,18 +87,24 @@ export function OverviewPage(props: { entity: AlphaEntity }) { {metadata.uid && ( + + + )} {metadata.etag && ( + + + )} - + + + +