Skip to content

Commit 3c68779

Browse files
authored
cloud create menu updates (#1437)
1 parent bab15d9 commit 3c68779

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

www/src/components/create-cluster/CreateCluster.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ const SidebarWrapperSC = styled.div(({ theme }) => ({
210210

211211
const ContentWrapperSC = styled.div(({ theme }) => ({
212212
display: 'flex',
213-
margin: 'auto',
213+
height: 'fit-content',
214214
minWidth: 600,
215215
maxWidth: 720,
216216
flexDirection: 'column',

www/src/components/create-cluster/steps/ConfigureCloudInstanceStep.tsx

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,16 @@ export function ConfigureCloudInstanceStep() {
3333
useCreateClusterContext()
3434

3535
const cloud = CloudProvider.Aws
36+
const region = REGIONS[0]
37+
3638
const [name, setName] = useState('')
3739
const [size, setSize] = useState<ConsoleSize>(ConsoleSize.Small)
38-
const [region, setRegion] = useState<string>(REGIONS[0])
3940
const [confirm, setConfirm] = useState(false)
4041

4142
const [showNameError, setShowNameError] = useState(false)
4243
const { isNameValid, nameErrorMessage } = validateName(name)
4344

44-
const canSubmit = !!(
45-
!!name &&
46-
size &&
47-
cloud &&
48-
(cloud === CloudProvider.Aws ? region : true)
49-
)
45+
const canSubmit = !!(name && size)
5046

5147
const [mutation, { loading, error }] = useCreateConsoleInstanceMutation({
5248
variables: {
@@ -131,21 +127,6 @@ export function ConfigureCloudInstanceStep() {
131127
))}
132128
</Select>
133129
</FormFieldSC>
134-
{cloud === CloudProvider.Aws && (
135-
<FormFieldSC label="Region">
136-
<Select
137-
selectedKey={region}
138-
onSelectionChange={(region) => setRegion(region as string)}
139-
>
140-
{REGIONS.map((region) => (
141-
<ListBoxItem
142-
key={region}
143-
label={region}
144-
/>
145-
))}
146-
</Select>
147-
</FormFieldSC>
148-
)}
149130
</Flex>
150131
<Confirm
151132
open={confirm}
@@ -171,7 +152,7 @@ const ValidationHintSC = styled.span(({ theme }) => ({
171152

172153
const validateName = (name: string) => {
173154
const nameValidity = {
174-
length: name.length >= 4 && name.length <= 11,
155+
length: name.length >= 5 && name.length <= 15,
175156
lowercase: !/[A-Z]/.test(name),
176157
alphanumeric: !!name.match(/^[a-z0-9]+$/),
177158
startsWithLetter: !!name.at(0)?.match(/[a-z]/),
@@ -185,7 +166,7 @@ const validateName = (name: string) => {
185166
: !nameValidity.alphanumeric
186167
? 'Name must be alphanumeric'
187168
: !nameValidity.length
188-
? 'Name must be between 4 and 11 characters'
169+
? 'Name must be between 5 and 15 characters'
189170
: '',
190171
}
191172
}

0 commit comments

Comments
 (0)