|
1 | 1 | import { Cog6ToothIcon } from "@heroicons/react/24/outline"; |
2 | 2 | import { BuildingOfficeIcon, UserIcon } from "@heroicons/react/24/solid"; |
| 3 | +import { SerializedOrgWithProfiles } from "core/config/ProfileLifecycleManager"; |
3 | 4 | import { isOnPremSession } from "core/control-plane/AuthTypes"; |
4 | 5 | import { useContext } from "react"; |
5 | 6 | import { Button, Card, Divider } from "../../../components/ui"; |
@@ -30,14 +31,20 @@ export function OrganizationsSection() { |
30 | 31 | session && organizations.length > 1 && !isOnPremSession(session); |
31 | 32 |
|
32 | 33 | function handleAddOrganization() { |
33 | | - ideMessenger.request("controlPlane/openUrl", { |
| 34 | + void ideMessenger.request("controlPlane/openUrl", { |
34 | 35 | path: "/organizations/new", |
35 | 36 | }); |
36 | 37 | } |
37 | 38 |
|
38 | | - function handleConfigureOrganization(orgId: string) { |
39 | | - ideMessenger.request("controlPlane/openUrl", { |
40 | | - path: `/organizations/${orgId}/settings`, |
| 39 | + function handleConfigureOrganization(org: SerializedOrgWithProfiles) { |
| 40 | + let path: string; |
| 41 | + if (org.id === "personal") { |
| 42 | + path = "/settings"; |
| 43 | + } else { |
| 44 | + path = `/organizations/${org.slug}/settings`; |
| 45 | + } |
| 46 | + void ideMessenger.request("controlPlane/openUrl", { |
| 47 | + path, |
41 | 48 | }); |
42 | 49 | } |
43 | 50 |
|
@@ -82,7 +89,7 @@ export function OrganizationsSection() { |
82 | 89 | </div> |
83 | 90 | </div> |
84 | 91 | <Button |
85 | | - onClick={() => handleConfigureOrganization(organization.id)} |
| 92 | + onClick={() => handleConfigureOrganization(organization)} |
86 | 93 | variant="ghost" |
87 | 94 | size="sm" |
88 | 95 | className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0" |
|
0 commit comments