mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-01 13:47:27 +02:00
fix: long flag names push table to overflow and flag descriptions are not truncated (#9350)
Addresses two issues related to flag names and descriptions overflowing: 1: In the project flag overview, long flag names push the environments off screen. This is handled by setting overflow-wrap: anywhere on the offending text. The text will now use ellipses instead. Before full-width:  Before narrower:  After full-width:  After narrower:  2: On the flag page, long descriptions are rendered in their entirety, even if that's not sensible. They are now truncated after five lines. There is a tooltip that shows the full text, or you can go the flag settings to see the full description. Before:  After:  After (with tooltip):  --- Note, I don't think this is necessarily the perfect solution (it'd be nice to get tooltips for overflowing flag names a "show full description" disclosure button instead of the stupidly long tooltip), but I think it's a step in the right direction.
This commit is contained in:
parent
7ec6c141f3
commit
000ee66692
@ -21,7 +21,6 @@ export const StyledPopover = styled(Popover)(({ theme }) => ({
|
|||||||
paddingTop: theme.spacing(dropdownPadding),
|
paddingTop: theme.spacing(dropdownPadding),
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
|
|
||||||
gap: theme.spacing(1),
|
gap: theme.spacing(1),
|
||||||
maxHeight: '70vh',
|
maxHeight: '70vh',
|
||||||
},
|
},
|
||||||
|
@ -132,6 +132,7 @@ const FeatureName: FC<{
|
|||||||
style={{
|
style={{
|
||||||
WebkitLineClamp: 1,
|
WebkitLineClamp: 1,
|
||||||
lineClamp: 1,
|
lineClamp: 1,
|
||||||
|
overflowWrap: 'anywhere',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Highlighter search={searchQuery}>{feature}</Highlighter>
|
<Highlighter search={searchQuery}>{feature}</Highlighter>
|
||||||
|
@ -16,6 +16,7 @@ import { TagRow } from './TagRow';
|
|||||||
import { capitalizeFirst } from 'utils/capitalizeFirst';
|
import { capitalizeFirst } from 'utils/capitalizeFirst';
|
||||||
import { Collaborators } from './Collaborators';
|
import { Collaborators } from './Collaborators';
|
||||||
import { EnvironmentVisibilityMenu } from './EnvironmentVisibilityMenu/EnvironmentVisibilityMenu';
|
import { EnvironmentVisibilityMenu } from './EnvironmentVisibilityMenu/EnvironmentVisibilityMenu';
|
||||||
|
import { Truncator } from 'component/common/Truncator/Truncator';
|
||||||
|
|
||||||
const StyledMetaDataContainer = styled('div')(({ theme }) => ({
|
const StyledMetaDataContainer = styled('div')(({ theme }) => ({
|
||||||
padding: theme.spacing(3),
|
padding: theme.spacing(3),
|
||||||
@ -97,7 +98,9 @@ const FeatureOverviewMetaData: FC<FeatureOverviewMetaDataProps> = ({
|
|||||||
{description ? (
|
{description ? (
|
||||||
<StyledMetaDataItem data-loading>
|
<StyledMetaDataItem data-loading>
|
||||||
<StyledMetaDataItemText>
|
<StyledMetaDataItemText>
|
||||||
{description}
|
<Truncator arrow lines={5} title={description}>
|
||||||
|
{description}
|
||||||
|
</Truncator>
|
||||||
</StyledMetaDataItemText>
|
</StyledMetaDataItemText>
|
||||||
</StyledMetaDataItem>
|
</StyledMetaDataItem>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -220,9 +220,6 @@ export const ProjectFeatureToggles = ({
|
|||||||
header: 'Name',
|
header: 'Name',
|
||||||
cell: FeatureOverviewCell(onTagClick, onFlagTypeClick),
|
cell: FeatureOverviewCell(onTagClick, onFlagTypeClick),
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
|
||||||
width: '50%',
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor('createdAt', {
|
columnHelper.accessor('createdAt', {
|
||||||
id: 'createdAt',
|
id: 'createdAt',
|
||||||
|
Loading…
Reference in New Issue
Block a user