diff --git a/.changeset/selfish-hats-wait.md b/.changeset/selfish-hats-wait.md index 40d0d194e7..d706d42e8e 100644 --- a/.changeset/selfish-hats-wait.md +++ b/.changeset/selfish-hats-wait.md @@ -2,4 +2,4 @@ '@backstage/plugin-org': patch --- -Add styling to the MembersListCard and ComponentsGrid to handle overflow text. +Add styling to the `MembersListCard` and `ComponentsGrid` to handle overflow text. diff --git a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx index 65c3144d30..bf561a23a4 100644 --- a/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx +++ b/plugins/org/src/components/Cards/Group/MembersList/MembersListCard.tsx @@ -44,6 +44,7 @@ import { Progress, ResponseErrorPanel, Link, + OverflowTooltip, } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; @@ -59,14 +60,15 @@ const useStyles = makeStyles((theme: Theme) => flex: '1', minWidth: '0px', }, - overflowingText: { + email: { overflow: 'hidden', + whiteSpace: 'nowrap', textOverflow: 'ellipsis', display: 'inline-block', maxWidth: '100%', '&:hover': { overflow: 'visible', - wordBreak: 'break-word', + whiteSpace: 'normal', }, }, }), @@ -105,22 +107,18 @@ const MemberComponent = (props: { member: UserEntity }) => { }} textAlign="center" > - + - {displayName} + {profile?.email && ( - + {profile.email} )} diff --git a/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx b/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx index edd8cc126f..b2714b5dd5 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/ComponentsGrid.tsx @@ -15,7 +15,12 @@ */ import { Entity } from '@backstage/catalog-model'; -import { Link, Progress, ResponseErrorPanel } from '@backstage/core-components'; +import { + Link, + OverflowTooltip, + Progress, + ResponseErrorPanel, +} from '@backstage/core-components'; import { useRouteRef } from '@backstage/core-plugin-api'; import { BackstageTheme } from '@backstage/theme'; import { @@ -44,16 +49,11 @@ const useStyles = makeStyles((theme: BackstageTheme) => }, height: '100%', }, - title: { + bold: { fontWeight: theme.typography.fontWeightBold, - textAlign: 'center', - overflow: 'hidden', - textOverflow: 'ellipsis', - maxWidth: '100%', - '&:hover': { - overflow: 'visible', - wordBreak: 'break-word', - }, + }, + smallFont: { + fontSize: theme.typography.body2.fontSize, }, entityTypeBox: { background: (props: { type: string }) => @@ -76,6 +76,7 @@ const EntityCountTile = ({ const classes = useStyles({ type: type ?? kind }); const rawTitle = type ?? kind; + const isLongText = rawTitle.length > 10; return ( @@ -85,12 +86,19 @@ const EntityCountTile = ({ flexDirection="column" alignItems="center" > - + {counter} - - {pluralize(rawTitle.toLocaleUpperCase('en-US'), counter)} - + + + + + {type && {kind}}