From ef8e6b03866cb061275ee8847420a48b553142e5 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 12 Jan 2023 09:16:19 +0000 Subject: [PATCH] customization of labels title & defualt to Labels Signed-off-by: Brian Fletcher --- plugins/catalog/api-report.md | 2 ++ .../src/components/EntityLabelsCard/EntityLabelsCard.tsx | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index ada173fd5d..82df851239 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -282,6 +282,8 @@ export const EntityLabelsCard: (props: EntityLabelsCardProps) => JSX.Element; // @public (undocumented) export interface EntityLabelsCardProps { + // (undocumented) + title?: string; // (undocumented) variant?: InfoCardVariants; } diff --git a/plugins/catalog/src/components/EntityLabelsCard/EntityLabelsCard.tsx b/plugins/catalog/src/components/EntityLabelsCard/EntityLabelsCard.tsx index e3bee02c43..500c651cc0 100644 --- a/plugins/catalog/src/components/EntityLabelsCard/EntityLabelsCard.tsx +++ b/plugins/catalog/src/components/EntityLabelsCard/EntityLabelsCard.tsx @@ -28,6 +28,7 @@ import { makeStyles, Typography } from '@material-ui/core'; /** @public */ export interface EntityLabelsCardProps { variant?: InfoCardVariants; + title?: string; } const useStyles = makeStyles(_ => ({ @@ -37,7 +38,7 @@ const useStyles = makeStyles(_ => ({ })); export const EntityLabelsCard = (props: EntityLabelsCardProps) => { - const { variant } = props; + const { variant, title } = props; const { entity } = useEntity(); const classes = useStyles(); @@ -59,7 +60,7 @@ export const EntityLabelsCard = (props: EntityLabelsCardProps) => { const labels = entity?.metadata?.labels; return ( - + {!labels || Object.keys(labels).length === 0 ? ( ) : (