Skip to content

Commit 81f167e

Browse files
committed
feat: update create org for premium license
1 parent 164b65e commit 81f167e

File tree

2 files changed

+64
-75
lines changed

2 files changed

+64
-75
lines changed

site/src/pages/ManagementSettingsPage/CreateOrganizationPageView.tsx

Lines changed: 63 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,17 @@ import TextField from "@mui/material/TextField";
22
import { isApiValidationError } from "api/errors";
33
import type { CreateOrganizationRequest } from "api/typesGenerated";
44
import { ErrorAlert } from "components/Alert/ErrorAlert";
5-
import {
6-
Badges,
7-
DisabledBadge,
8-
EntitledBadge,
9-
PremiumBadge,
10-
} from "components/Badges/Badges";
5+
import { ChooseOne, Cond } from "components/Conditionals/ChooseOne";
116
import {
127
FormFields,
138
FormFooter,
149
FormSection,
1510
HorizontalForm,
1611
} from "components/Form/Form";
1712
import { IconField } from "components/IconField/IconField";
18-
import { PopoverPaywall } from "components/Paywall/PopoverPaywall";
19-
import {
20-
Popover,
21-
PopoverContent,
22-
PopoverTrigger,
23-
} from "components/Popover/Popover";
13+
import { Paywall } from "components/Paywall/Paywall";
2414
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
15+
import { Stack } from "components/Stack/Stack";
2516
import { useFormik } from "formik";
2617
import type { FC } from "react";
2718
import { docs } from "utils/docs";
@@ -67,79 +58,77 @@ export const CreateOrganizationPageView: FC<
6758
const getFieldHelpers = getFormHelpers(form, error);
6859

6960
return (
70-
<div>
61+
<Stack spacing={3}>
7162
<SettingsHeader
7263
title="New Organization"
7364
description="Organize your deployment into multiple platform teams."
7465
/>
7566

76-
<Badges>
77-
{isEntitled ? <EntitledBadge /> : <DisabledBadge />}
78-
<Popover mode="hover">
79-
<PopoverTrigger>
80-
<span>
81-
<PremiumBadge />
82-
</span>
83-
</PopoverTrigger>
84-
<PopoverContent css={{ transform: "translateY(-28px)" }}>
85-
<PopoverPaywall
86-
message="Organizations"
87-
description="Organizations allow you to run a Coder deployment with multiple platform teams, all with unique use cases, templates, and even underlying infrastructure."
88-
documentationLink={docs("/guides/using-organizations")}
89-
/>
90-
</PopoverContent>
91-
</Popover>
92-
</Badges>
93-
9467
{Boolean(error) && !isApiValidationError(error) && (
9568
<div css={{ marginBottom: 32 }}>
9669
<ErrorAlert error={error} />
9770
</div>
9871
)}
9972

100-
<HorizontalForm
101-
onSubmit={form.handleSubmit}
102-
aria-label="Organization settings form"
103-
>
104-
<FormSection
105-
title="General info"
106-
description="The name and description of the organization."
107-
>
108-
<fieldset
109-
disabled={form.isSubmitting}
110-
css={{ border: "unset", padding: 0, margin: 0, width: "100%" }}
73+
<ChooseOne>
74+
<Cond condition={!isEntitled}>
75+
<Paywall
76+
message="Organizations"
77+
description="Create multiple organizations within a single Coder deployment, allowing several platform teams to operate with isolated users, templates, and distinct underlying infrastructure."
78+
documentationLink={docs("/guides/using-organizations")}
79+
/>
80+
</Cond>
81+
<Cond>
82+
<HorizontalForm
83+
onSubmit={form.handleSubmit}
84+
aria-label="Organization settings form"
11185
>
112-
<FormFields>
113-
<TextField
114-
{...getFieldHelpers("name")}
115-
onChange={onChangeTrimmed(form)}
116-
autoFocus
117-
fullWidth
118-
label="Name"
119-
/>
120-
<TextField
121-
{...getFieldHelpers("display_name")}
122-
fullWidth
123-
label="Display name"
124-
/>
125-
<TextField
126-
{...getFieldHelpers("description")}
127-
multiline
128-
fullWidth
129-
label="Description"
130-
rows={2}
131-
/>
132-
<IconField
133-
{...getFieldHelpers("icon")}
134-
onChange={onChangeTrimmed(form)}
135-
fullWidth
136-
onPickEmoji={(value) => form.setFieldValue("icon", value)}
137-
/>
138-
</FormFields>
139-
</fieldset>
140-
</FormSection>
141-
<FormFooter isLoading={form.isSubmitting} />
142-
</HorizontalForm>
143-
</div>
86+
<FormSection
87+
title="General info"
88+
description="The name and description of the organization."
89+
>
90+
<fieldset
91+
disabled={form.isSubmitting}
92+
css={{
93+
border: "unset",
94+
padding: 0,
95+
margin: 0,
96+
width: "100%",
97+
}}
98+
>
99+
<FormFields>
100+
<TextField
101+
{...getFieldHelpers("name")}
102+
onChange={onChangeTrimmed(form)}
103+
autoFocus
104+
fullWidth
105+
label="Name"
106+
/>
107+
<TextField
108+
{...getFieldHelpers("display_name")}
109+
fullWidth
110+
label="Display name"
111+
/>
112+
<TextField
113+
{...getFieldHelpers("description")}
114+
multiline
115+
fullWidth
116+
label="Description"
117+
rows={2}
118+
/>
119+
<IconField
120+
{...getFieldHelpers("icon")}
121+
onChange={onChangeTrimmed(form)}
122+
fullWidth
123+
onPickEmoji={(value) => form.setFieldValue("icon", value)}
124+
/>
125+
</FormFields>
126+
</fieldset>
127+
</FormSection>
128+
<FormFooter isLoading={form.isSubmitting} />
129+
</HorizontalForm>
130+
</Cond>
131+
</ChooseOne>
132+
</Stack>
144133
);
145134
};

site/src/pages/ManagementSettingsPage/CustomRolesPage/CustomRolesPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const CustomRolesPageView: FC<CustomRolesPageViewProps> = ({
4949
{!isCustomRolesEnabled && (
5050
<Paywall
5151
message="Custom Roles"
52-
description="Custom Roles are available in the Premium plan and require an upgraded license. Please contact your Customer Success team for more information."
52+
description="Create custom roles to grant users a tailored set of granular permissions."
5353
documentationLink={docs("/admin/groups")}
5454
/>
5555
)}

0 commit comments

Comments
 (0)