Skip to content

fix: sort orgs alphabetically in dropdown #16583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 19, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: handle create org button when searching
  • Loading branch information
jaaydenh committed Feb 18, 2025
commit b39f5b5dbfab5990912f45a97033de227cad5bf7
19 changes: 11 additions & 8 deletions site/src/modules/management/OrganizationSidebarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { Avatar } from "components/Avatar/Avatar";
import { Button } from "components/Button/Button";
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
} from "components/Command/Command";
import { Loader } from "components/Loader/Loader";
import {
Expand Down Expand Up @@ -130,6 +132,7 @@ const OrganizationsSettingsNavigation: FC<
<Command loop>
<CommandInput placeholder="Find organization" />
<CommandList>
<CommandEmpty>No organization found.</CommandEmpty>
<CommandGroup className="pb-2">
{sortedOrganizations.length > 1 && (
<div className="flex flex-col max-h-[260px] overflow-y-auto">
Expand Down Expand Up @@ -164,11 +167,11 @@ const OrganizationsSettingsNavigation: FC<
))}
</div>
)}
{permissions.createOrganization && (
<>
{organizations.length > 1 && (
<hr className="h-px my-2 border-none bg-border -mx-2" />
)}
</CommandGroup>
{permissions.createOrganization && (
<>
{organizations.length > 1 && <CommandSeparator />}
<CommandGroup>
<CommandItem
className="flex justify-center data-[selected=true]:bg-transparent"
onSelect={() => {
Expand All @@ -180,9 +183,9 @@ const OrganizationsSettingsNavigation: FC<
>
<Plus /> Create Organization
</CommandItem>
</>
)}
</CommandGroup>
</CommandGroup>
</>
)}
</CommandList>
</Command>
</PopoverContent>
Expand Down
Loading