@@ -33,20 +33,16 @@ export function ConfigureCloudInstanceStep() {
33
33
useCreateClusterContext ( )
34
34
35
35
const cloud = CloudProvider . Aws
36
+ const region = REGIONS [ 0 ]
37
+
36
38
const [ name , setName ] = useState ( '' )
37
39
const [ size , setSize ] = useState < ConsoleSize > ( ConsoleSize . Small )
38
- const [ region , setRegion ] = useState < string > ( REGIONS [ 0 ] )
39
40
const [ confirm , setConfirm ] = useState ( false )
40
41
41
42
const [ showNameError , setShowNameError ] = useState ( false )
42
43
const { isNameValid, nameErrorMessage } = validateName ( name )
43
44
44
- const canSubmit = ! ! (
45
- ! ! name &&
46
- size &&
47
- cloud &&
48
- ( cloud === CloudProvider . Aws ? region : true )
49
- )
45
+ const canSubmit = ! ! ( name && size )
50
46
51
47
const [ mutation , { loading, error } ] = useCreateConsoleInstanceMutation ( {
52
48
variables : {
@@ -131,21 +127,6 @@ export function ConfigureCloudInstanceStep() {
131
127
) ) }
132
128
</ Select >
133
129
</ 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
- ) }
149
130
</ Flex >
150
131
< Confirm
151
132
open = { confirm }
@@ -171,7 +152,7 @@ const ValidationHintSC = styled.span(({ theme }) => ({
171
152
172
153
const validateName = ( name : string ) => {
173
154
const nameValidity = {
174
- length : name . length >= 4 && name . length <= 11 ,
155
+ length : name . length >= 5 && name . length <= 15 ,
175
156
lowercase : ! / [ A - Z ] / . test ( name ) ,
176
157
alphanumeric : ! ! name . match ( / ^ [ a - z 0 - 9 ] + $ / ) ,
177
158
startsWithLetter : ! ! name . at ( 0 ) ?. match ( / [ a - z ] / ) ,
@@ -185,7 +166,7 @@ const validateName = (name: string) => {
185
166
: ! nameValidity . alphanumeric
186
167
? 'Name must be alphanumeric'
187
168
: ! nameValidity . length
188
- ? 'Name must be between 4 and 11 characters'
169
+ ? 'Name must be between 5 and 15 characters'
189
170
: '' ,
190
171
}
191
172
}
0 commit comments