@@ -10,7 +10,7 @@ import validationErrors from 'uiSrc/constants/validationErrors'
1010import { ICredentialsRedisCluster } from 'uiSrc/slices/interfaces'
1111
1212import { MessageEnterpriceSoftware } from 'uiSrc/pages/home/components/form/Messages'
13- import { FlexItem , Row } from 'uiSrc/components/base/layout/flex'
13+ import { Col , FlexItem , Row } from 'uiSrc/components/base/layout/flex'
1414import { WindowEvent } from 'uiSrc/components/base/utils/WindowEvent'
1515import {
1616 PrimaryButton ,
@@ -134,12 +134,7 @@ const ClusterConnectionForm = (props: Props) => {
134134 }
135135
136136 const CancelButton = ( { onClick } : { onClick : ( ) => void } ) => (
137- < SecondaryButton
138- size = "s"
139- className = "btn-cancel"
140- onClick = { onClick }
141- style = { { marginRight : 12 } }
142- >
137+ < SecondaryButton className = "btn-cancel" onClick = { onClick } >
143138 Cancel
144139 </ SecondaryButton >
145140 )
@@ -162,7 +157,6 @@ const ClusterConnectionForm = (props: Props) => {
162157 }
163158 >
164159 < PrimaryButton
165- size = "s"
166160 type = "submit"
167161 onClick = { onClick }
168162 disabled = { submitIsDisabled }
@@ -179,13 +173,13 @@ const ClusterConnectionForm = (props: Props) => {
179173 const footerEl = document . getElementById ( 'footerDatabaseForm' )
180174 if ( footerEl ) {
181175 return ReactDOM . createPortal (
182- < div className = "footerAddDatabase ">
176+ < Row justify = "end" gap = "m ">
183177 { onClose && < CancelButton onClick = { onClose } /> }
184178 < SubmitButton
185179 onClick = { formik . submitForm }
186180 submitIsDisabled = { ! submitIsEnable ( ) }
187181 />
188- </ div > ,
182+ </ Row > ,
189183 footerEl ,
190184 )
191185 }
@@ -199,80 +193,77 @@ const ClusterConnectionForm = (props: Props) => {
199193
200194 < form >
201195 < WindowEvent event = "keydown" handler = { onKeyDown } />
202- < Row responsive >
203- < FlexItem grow = { 4 } >
204- < FormField label = "Cluster Host" required infoIconProps = { hostInfo } >
205- < TextInput
206- name = "host"
207- id = "host"
208- data-testid = "host"
209- maxLength = { 200 }
210- placeholder = "Enter Cluster Host"
211- value = { formik . values . host }
212- onChange = { value => {
213- formik . setFieldValue (
214- 'host' ,
215- validateField ( value . trim ( ) ) ,
216- )
217- } }
218- onPaste = { ( event : React . ClipboardEvent < HTMLInputElement > ) =>
219- handlePasteHostName ( onHostNamePaste , event )
220- }
221- />
222- </ FormField >
223- </ FlexItem >
224196
225- < FlexItem grow = { 2 } >
226- < FormField
227- label = "Cluster Port*"
228- additionalText = "Should not exceed 65535."
229- >
230- < NumericInput
231- autoValidate
232- min = { 0 }
233- max = { MAX_PORT_NUMBER }
234- name = "port"
235- id = "port"
236- data-testid = "port"
237- placeholder = "Enter Cluster Port"
238- value = { Number ( formik . values . port ) }
239- onChange = { ( value ) => formik . setFieldValue ( 'port' , value ) }
240- />
241- </ FormField >
242- </ FlexItem >
243- </ Row >
197+ < Col gap = "l" >
198+ < Row gap = "m" responsive >
199+ < FlexItem grow = { 4 } >
200+ < FormField label = "Cluster Host" required infoIconProps = { hostInfo } >
201+ < TextInput
202+ name = "host"
203+ id = "host"
204+ data-testid = "host"
205+ maxLength = { 200 }
206+ placeholder = "Enter Cluster Host"
207+ value = { formik . values . host }
208+ onChange = { ( value ) => {
209+ formik . setFieldValue ( 'host' , validateField ( value . trim ( ) ) )
210+ } }
211+ onPaste = { ( event : React . ClipboardEvent < HTMLInputElement > ) =>
212+ handlePasteHostName ( onHostNamePaste , event )
213+ }
214+ />
215+ </ FormField >
216+ </ FlexItem >
217+
218+ < FlexItem grow = { 2 } >
219+ < FormField label = "Cluster Port" required >
220+ < NumericInput
221+ autoValidate
222+ min = { 0 }
223+ max = { MAX_PORT_NUMBER }
224+ name = "port"
225+ id = "port"
226+ data-testid = "port"
227+ placeholder = "Enter Cluster Port"
228+ value = { Number ( formik . values . port ) }
229+ onChange = { ( value ) => formik . setFieldValue ( 'port' , value ) }
230+ />
231+ </ FormField >
232+ </ FlexItem >
233+ </ Row >
244234
245- < Row responsive >
246- < FlexItem grow >
247- < FormField label = "Admin Username*" >
248- < TextInput
249- name = "username"
250- id = "username"
251- data-testid = "username"
252- maxLength = { 200 }
253- placeholder = "Enter Admin Username"
254- value = { formik . values . username }
255- onChange = { ( value ) => formik . setFieldValue ( 'username' , value ) }
256- />
257- </ FormField >
258- </ FlexItem >
235+ < Row gap = "m" responsive >
236+ < FlexItem grow >
237+ < FormField label = "Admin Username" required >
238+ < TextInput
239+ name = "username"
240+ id = "username"
241+ data-testid = "username"
242+ maxLength = { 200 }
243+ placeholder = "Enter Admin Username"
244+ value = { formik . values . username }
245+ onChange = { ( value ) => formik . setFieldValue ( 'username' , value ) }
246+ />
247+ </ FormField >
248+ </ FlexItem >
259249
260- < FlexItem grow >
261- < FormField label = "Admin Password*" >
262- < PasswordInput
263- type = "dual"
264- name = "password"
265- id = "password"
266- data-testid = "password"
267- maxLength = { 200 }
268- placeholder = "Enter Password"
269- value = { formik . values . password }
270- onChange = { ( value ) => formik . setFieldValue ( 'password' , value ) }
271- autoComplete = "new-password"
272- />
273- </ FormField >
274- </ FlexItem >
275- </ Row >
250+ < FlexItem grow >
251+ < FormField label = "Admin Password" required >
252+ < PasswordInput
253+ type = "dual"
254+ name = "password"
255+ id = "password"
256+ data-testid = "password"
257+ maxLength = { 200 }
258+ placeholder = "Enter Password"
259+ value = { formik . values . password }
260+ onChange = { ( value ) => formik . setFieldValue ( 'password' , value ) }
261+ autoComplete = "new-password"
262+ />
263+ </ FormField >
264+ </ FlexItem >
265+ </ Row >
266+ </ Col >
276267 </ form >
277268 < Footer />
278269 </ div >
0 commit comments