@@ -2,26 +2,17 @@ import TextField from "@mui/material/TextField";
2
2
import { isApiValidationError } from "api/errors" ;
3
3
import type { CreateOrganizationRequest } from "api/typesGenerated" ;
4
4
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" ;
11
6
import {
12
7
FormFields ,
13
8
FormFooter ,
14
9
FormSection ,
15
10
HorizontalForm ,
16
11
} from "components/Form/Form" ;
17
12
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" ;
24
14
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader" ;
15
+ import { Stack } from "components/Stack/Stack" ;
25
16
import { useFormik } from "formik" ;
26
17
import type { FC } from "react" ;
27
18
import { docs } from "utils/docs" ;
@@ -67,79 +58,77 @@ export const CreateOrganizationPageView: FC<
67
58
const getFieldHelpers = getFormHelpers ( form , error ) ;
68
59
69
60
return (
70
- < div >
61
+ < Stack spacing = { 3 } >
71
62
< SettingsHeader
72
63
title = "New Organization"
73
64
description = "Organize your deployment into multiple platform teams."
74
65
/>
75
66
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
-
94
67
{ Boolean ( error ) && ! isApiValidationError ( error ) && (
95
68
< div css = { { marginBottom : 32 } } >
96
69
< ErrorAlert error = { error } />
97
70
</ div >
98
71
) }
99
72
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"
111
85
>
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 >
144
133
) ;
145
134
} ;
0 commit comments