1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-02 01:17:58 +02:00
unleash.unleash/frontend/src/component/common
Thomas Heartman c7bb6c5179
fix: prevent long project names from blowing out the form (#7673)
This change prevents long project names from blowing the form out of
proportion.

To do so, it:
1. sets `whitespace: no-wrap` on the button labels. Judging by the other
styles, this was the intention all along, but it didn't really come up
until now.

2. It also sets the label width for projects to 30ch,so that you'll get
to see quite a bit of the project name before it gets cut off.

It would be possible to set a dynamic width for this button based on the
longest project name, but I'm not sure it adds much value, so I'm
leaning towards keeping it simple.

Here's what the dynamic width would look like:

``` tsx
    const projectButtonLabelWidth = useMemo(() => {
        const longestProjectName = projects.reduce(
            (prev: number, type: { name: string }) =>
                prev >= type.name.length ? prev : type.name.length,
            0,
        );
        return `${Math.min(longestProjectName, 30)}ch`;
    }, [projects]);
```

What it looks like:

![image](https://github.com/user-attachments/assets/51bca3f6-aeb3-4a41-b57e-5ebd9baa3ef6)
2024-07-26 11:39:43 +02:00
..
AnimateOnMount feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
Announcer chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
ApiError chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
ApiTokenTable feat: show orphaned API tokens (#7569) 2024-07-11 14:06:22 +02:00
AutocompleteBox chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
Badge fix: badge should render children 0 value (#6981) 2024-05-06 13:24:52 +03:00
BatchSelectionActionsBar feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
BreadcrumbNav Insights layout (#7610) 2024-07-18 12:43:52 +02:00
CheckmarkBadge fix: icon imports (#6499) 2024-03-12 10:56:10 +01:00
Codebox
ConditionallyRender chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
ConstraintAccordion feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
CreateButton chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
DateTimePicker chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
DialogFormTemplate fix: prevent long project names from blowing out the form (#7673) 2024-07-26 11:39:43 +02:00
Dialogue feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
DividerText
DropdownMenu chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
EnterpriseBadge chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
EnvironmentIcon fix: icon imports (#6499) 2024-03-12 10:56:10 +01:00
ExperimentalFeedback chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
FavoriteIconButton chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
FeatureArchiveDialog chore: rename toggle to flag #1 (#7092) 2024-05-21 15:18:00 +03:00
FeatureStaleDialog chore: rename toggle to flag #1 (#7092) 2024-05-21 15:18:00 +03:00
FeatureStatusChip chore: rename toggle to flag #2 (#7097) 2024-05-22 08:20:11 +03:00
Feedback chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
FilterDateItem feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
FormSwitch chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
FormTemplate fix: project icon sizing and color (#7672) 2024-07-26 10:26:16 +02:00
GeneralSelect fix: prevent long names from breaking form layouts (#7591) 2024-07-16 10:47:46 +02:00
Gradient feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
GridCol feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
GridRow feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
GuidanceIndicator feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
HelpIcon chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
Highlighter chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
HtmlTooltip fix: prevent project cell overflow on api keys table (#7472) 2024-07-02 12:10:02 +02:00
Input chore: update input field text sizes (#7107) 2024-05-22 13:26:22 +02:00
InputCaption
InputListField chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
InstanceStatus feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
ItemList chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
Limit chore: don't ask OSS users to reach out to CS (#7633) 2024-07-22 11:03:10 +02:00
Loader fix: make loader not exlpode to 100vh in unnecessary locations (#7589) 2024-07-15 14:41:45 +02:00
LoginRedirect chore: update react-router to v6 (#946) 2022-05-05 13:42:18 +02:00
MainHeader chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
Markdown chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
MultiActionButton feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
MultipleRoleSelect feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
NewConstraintAccordion feat: constraints values limit in a strategy UI (#7557) 2024-07-08 15:08:16 +02:00
NoItems feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
NotFound feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
Notifications feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
OperatorUpgradeAlert
PageContent feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
PageHeader feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
PasswordField chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
PercentageCircle chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
PermissionButton feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
PermissionGuard chore: add support for project and environment in PermissionGuard (#6008) 2024-01-24 08:20:38 +00:00
PermissionHOC chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
PermissionIconButton Feat: feature view created by field - frontend (#7382) 2024-06-13 13:00:57 +02:00
PermissionSwitch chore: use HTML (custom) tooltip for permission switches (#7355) 2024-06-11 14:03:35 +02:00
PremiumFeature task: Make Inactive users an enterprise feature (#6510) 2024-03-12 10:01:10 +00:00
PrettifyLargeNumber chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
Proclamation chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
ProjectIcon fix: project icon sizing and color (#7672) 2024-07-26 10:26:16 +02:00
ProjectSelect fix: Project select should not expand when selecting multiple projects (#6811) 2024-04-10 12:34:11 +03:00
ProtectedRoute chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
ReactJSONEditor chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
ResponsiveButton feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
RoleBadge fix: icon imports (#6499) 2024-03-12 10:56:10 +01:00
RoleDescription chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
RoleSelect chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
ScreenReaderOnly feat: filter by user when interacting with the avatar (#7347) 2024-06-11 12:15:35 +02:00
ScrollTop
Search feat: separate command bar and search hotkeys (#7651) 2024-07-24 12:46:03 +03:00
SegmentItem fix: show segment details in targetting (#6640) 2024-03-22 10:14:19 +01:00
SidebarModal chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
SidePanelList chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
SkipNavLink
StaleDataNotification feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Sticky feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
StrategyItemContainer feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
StrategySeparator
StrategyVariantsUpgradeAlert
StringTruncator
Table API tokens - virtualized table (#7531) 2024-07-09 13:22:55 +02:00
TabNav feat: upgrade from react v17 to v18 (#7265) 2024-06-11 13:59:52 +03:00
ThemeMode
ToastRenderer chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
TooltipLink chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
TooltipResolver feat: command menu items can have description as tooltip now (#7455) 2024-06-26 12:39:53 +03:00
UpdateButton chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
UserAvatar fix: add workaround for tooltip (#7649) 2024-07-24 09:33:29 +00:00
VariantInfoAlert chore: rename toggle to flag #2 (#7097) 2024-05-22 08:20:11 +03:00
VerticalTabs fix: project settings table overflow (#7288) 2024-06-05 14:05:41 +02:00
common.module.scss
flags.ts
index.jsx chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
select.tsx chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
util.test.ts fix: prevent strategy variant weight from going into negative numbers on Frontend (#7460) 2024-06-27 09:06:59 +00:00
util.ts fix: prevent strategy variant weight from going into negative numbers on Frontend (#7460) 2024-06-27 09:06:59 +00:00