Skip to content
Merged
Prev Previous commit
Next Next commit
Adjust width determination logic
  • Loading branch information
rafrdz committed Aug 28, 2025
commit c80dc124da051ac35ebe314eb5155b0d6cfbc7bd
7 changes: 4 additions & 3 deletions site/src/pages/AuditPage/AuditFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ interface AuditFilterProps {
}

export const AuditFilter: FC<AuditFilterProps> = ({ filter, error, menus }) => {
const width = menus.organization ? DEFAULT_USER_FILTER_WIDTH : undefined;
return (
<Filter
learnMoreLink={docs("/admin/security/audit-logs#filtering-logs")}
Expand All @@ -61,14 +62,14 @@ export const AuditFilter: FC<AuditFilterProps> = ({ filter, error, menus }) => {
options={
<>
<ResourceTypeMenu
width={DEFAULT_USER_FILTER_WIDTH}
width={width}
menu={menus.resourceType}
/>
<ActionMenu width={DEFAULT_USER_FILTER_WIDTH} menu={menus.action} />
<ActionMenu width={width} menu={menus.action} />
<UserMenu menu={menus.user} />
{menus.organization && (
<OrganizationsMenu
width={DEFAULT_USER_FILTER_WIDTH}
width={width}
menu={menus.organization}
/>
)}
Expand Down
7 changes: 4 additions & 3 deletions site/src/pages/ConnectionLogPage/ConnectionLogFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const ConnectionLogFilter: FC<ConnectionLogFilterProps> = ({
error,
menus,
}) => {
const width = menus.organization ? DEFAULT_USER_FILTER_WIDTH : undefined;
return (
<Filter
learnMoreLink={docs(
Expand All @@ -58,12 +59,12 @@ export const ConnectionLogFilter: FC<ConnectionLogFilterProps> = ({
options={
<>
<UserMenu placeholder="All owners" menu={menus.user} />
<StatusMenu menu={menus.status} width={DEFAULT_USER_FILTER_WIDTH} />
<TypeMenu menu={menus.type} width={DEFAULT_USER_FILTER_WIDTH} />
<StatusMenu menu={menus.status} width={width} />
<TypeMenu menu={menus.type} width={width} />
{menus.organization && (
<OrganizationsMenu
menu={menus.organization}
width={DEFAULT_USER_FILTER_WIDTH}
width={width}
/>
)}
</>
Expand Down
7 changes: 4 additions & 3 deletions site/src/pages/WorkspacesPage/filter/WorkspacesFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const WorkspacesFilter: FC<WorkspaceFilterProps> = ({
organizationsMenu,
}) => {
const { entitlements, showOrganizations } = useDashboard();
const width = showOrganizations ? DEFAULT_USER_FILTER_WIDTH : undefined;
const presets = entitlements.features.advanced_template_scheduling.enabled
? PRESETS_WITH_DORMANT
: PRESET_FILTERS;
Expand All @@ -118,11 +119,11 @@ export const WorkspacesFilter: FC<WorkspaceFilterProps> = ({
options={
<>
{userMenu && <UserMenu menu={userMenu} />}
<TemplateMenu width={DEFAULT_USER_FILTER_WIDTH} menu={templateMenu} />
<StatusMenu width={DEFAULT_USER_FILTER_WIDTH} menu={statusMenu} />
<TemplateMenu width={width} menu={templateMenu} />
<StatusMenu width={width} menu={statusMenu} />
{organizationsActive && (
<OrganizationsMenu
width={DEFAULT_USER_FILTER_WIDTH}
width={width}
menu={organizationsMenu}
/>
)}
Expand Down
Loading