Skip to content

Commit a66e5d0

Browse files
committed
fix: open hub org settings
1 parent 8b10f1d commit a66e5d0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

gui/src/pages/config/sections/OrganizationsSection.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Cog6ToothIcon } from "@heroicons/react/24/outline";
22
import { BuildingOfficeIcon, UserIcon } from "@heroicons/react/24/solid";
3+
import { SerializedOrgWithProfiles } from "core/config/ProfileLifecycleManager";
34
import { isOnPremSession } from "core/control-plane/AuthTypes";
45
import { useContext } from "react";
56
import { Button, Card, Divider } from "../../../components/ui";
@@ -30,14 +31,20 @@ export function OrganizationsSection() {
3031
session && organizations.length > 1 && !isOnPremSession(session);
3132

3233
function handleAddOrganization() {
33-
ideMessenger.request("controlPlane/openUrl", {
34+
void ideMessenger.request("controlPlane/openUrl", {
3435
path: "/organizations/new",
3536
});
3637
}
3738

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,
4148
});
4249
}
4350

@@ -82,7 +89,7 @@ export function OrganizationsSection() {
8289
</div>
8390
</div>
8491
<Button
85-
onClick={() => handleConfigureOrganization(organization.id)}
92+
onClick={() => handleConfigureOrganization(organization)}
8693
variant="ghost"
8794
size="sm"
8895
className="text-description-muted hover:enabled:text-foreground my-0 h-6 w-6 p-0"

0 commit comments

Comments
 (0)