Skip to content

Commit 8a02972

Browse files
committed
feat: github issue resolve
1 parent e28e51d commit 8a02972

2 files changed

Lines changed: 37 additions & 23 deletions

File tree

src/components/OrgForm.tsx

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,45 @@ import type { FunctionComponent } from "react";
22
import Section from "./common/Section";
33
import { FormControl, FormField, FormItem, FormLabel } from "./ui/form";
44
import { Input } from "./ui/input";
5+
import { InputWithButton } from "./ui/input-with-button";
6+
import { useActiveOrg } from "@/hooks/useActiveOrg";
57

68
interface OrgFormProps {
79
forceVertical?: boolean;
810
}
9-
1011
export const OrgForm: FunctionComponent<OrgFormProps> = ({
1112
forceVertical = true,
12-
}) => (
13-
<Section
14-
description="Enter the name of your organization. This will be used to identify your organization in the system."
15-
title="General Information"
16-
forceVertical={forceVertical}
17-
>
18-
<div className="mt-6">
19-
<FormField
20-
name="name"
21-
render={({ field }) => (
22-
<FormItem>
23-
<FormLabel>Organization name*</FormLabel>
24-
<FormControl>
25-
<Input data-testid="org-name-label" {...field} />
26-
</FormControl>
27-
</FormItem>
28-
)}
29-
/>
30-
</div>
31-
</Section>
32-
);
13+
}) => {
14+
const activeOrg = useActiveOrg();
15+
const orgID = activeOrg.id;
16+
17+
return (
18+
<Section
19+
description="Enter the name of your organization. This will be used to identify your organization in the system."
20+
title="General Information"
21+
forceVertical={forceVertical}
22+
>
23+
<div className="mt-6">
24+
<FormField
25+
name="name"
26+
render={({ field }) => (
27+
<FormItem>
28+
<FormLabel>Organization name*</FormLabel>
29+
<FormControl>
30+
<Input data-testid="org-name-label" {...field} />
31+
</FormControl>
32+
</FormItem>
33+
)}
34+
/>
35+
<InputWithButton
36+
label="Organization-ID"
37+
value={`${orgID}`}
38+
nameKey="settings-org-id"
39+
variant="default"
40+
copyable
41+
copyToastDescription="The organization ID has been copied to your clipboard."
42+
/>
43+
</div>
44+
</Section>
45+
);
46+
};

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const config = {
3434
"https://gitlab.com/l3montree/devguard/-/raw/main",
3535
devguardGithubAppUrl: process.env.DEVGUARD_API_URL_PUBLIC_INTERNET?.includes(
3636
"main.devguard.org",
37-
)
37+
) || process.env.DEVGUARD_API_URL_PUBLIC_INTERNET?.includes("localhost")
3838
? "devguard-bot-dev"
3939
: "devguard-bot",
4040
enforceTheme: (process.env.ENFORCE_THEME || false) as

0 commit comments

Comments
 (0)