Skip to content

Commit 51b7d26

Browse files
committed
remove spacers and apply cols with gaps on tls details
1 parent 5ceda14 commit 51b7d26

File tree

1 file changed

+59
-80
lines changed

1 file changed

+59
-80
lines changed

redisinsight/ui/src/pages/home/components/form/TlsDetails.tsx

Lines changed: 59 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import { DbConnectionInfo } from 'uiSrc/pages/home/interfaces'
2020
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
2121
import { deleteCaCertificateAction } from 'uiSrc/slices/instances/caCerts'
2222
import { deleteClientCertAction } from 'uiSrc/slices/instances/clientCerts'
23-
import { FlexItem, Row } from 'uiSrc/components/base/layout/flex'
24-
import { Spacer } from 'uiSrc/components/base/layout/spacer'
23+
import { Col, FlexItem, Row } from 'uiSrc/components/base/layout/flex'
2524
import { Checkbox } from 'uiSrc/components/base/forms/checkbox/Checkbox'
2625
import { FormField } from 'uiSrc/components/base/forms/FormField'
2726
import { TextArea, TextInput } from 'uiSrc/components/base/inputs'
@@ -185,7 +184,7 @@ const TlsDetails = (props: Props) => {
185184
const verifyTlsId = useGenerateId('', ' verifyServerTlsCert')
186185
const isTlsAuthId = useGenerateId('', ' is_tls_client_auth_required')
187186
return (
188-
<>
187+
<Col gap="l">
189188
<Row gap="m">
190189
<FlexItem>
191190
<FormField>
@@ -202,8 +201,7 @@ const TlsDetails = (props: Props) => {
202201
</Row>
203202

204203
{formik.values.tls && (
205-
<>
206-
<Spacer />
204+
<Col gap="l">
207205
<Row gap="m">
208206
<FlexItem grow={1}>
209207
<Checkbox
@@ -223,31 +221,27 @@ const TlsDetails = (props: Props) => {
223221
</FlexItem>
224222
</Row>
225223
{formik.values.sni && (
226-
<>
227-
<Spacer />
228-
<Row gap="m">
229-
<FlexItem grow>
230-
<FormField label="Server Name" required>
231-
<TextInput
232-
name="servername"
233-
id="servername"
234-
maxLength={200}
235-
placeholder="Enter Server Name"
236-
value={formik.values.servername ?? ''}
237-
onChange={(value) =>
238-
formik.setFieldValue(
239-
'servername',
240-
validateField(value.trim()),
241-
)
242-
}
243-
data-testid="sni-servername"
244-
/>
245-
</FormField>
246-
</FlexItem>
247-
</Row>
248-
</>
224+
<Row gap="m">
225+
<FlexItem grow>
226+
<FormField label="Server Name" required>
227+
<TextInput
228+
name="servername"
229+
id="servername"
230+
maxLength={200}
231+
placeholder="Enter Server Name"
232+
value={formik.values.servername ?? ''}
233+
onChange={(value) =>
234+
formik.setFieldValue(
235+
'servername',
236+
validateField(value.trim()),
237+
)
238+
}
239+
data-testid="sni-servername"
240+
/>
241+
</FormField>
242+
</FlexItem>
243+
</Row>
249244
)}
250-
<Spacer />
251245
<Row gap="m" responsive>
252246
<FlexItem
253247
grow
@@ -263,11 +257,10 @@ const TlsDetails = (props: Props) => {
263257
/>
264258
</FlexItem>
265259
</Row>
266-
</>
260+
</Col>
267261
)}
268262
{formik.values.tls && (
269-
<div className="boxSection">
270-
<Spacer />
263+
<Col gap="l" >
271264
<Row gap="m" responsive>
272265
<FlexItem>
273266
<FormField
@@ -316,53 +309,41 @@ const TlsDetails = (props: Props) => {
316309

317310
{formik.values.tls &&
318311
formik.values.selectedCaCertName === ADD_NEW_CA_CERT && (
319-
<>
320-
<Spacer />
321-
<Row gap="m" responsive>
322-
<FlexItem grow>
323-
<FormField label="Certificate" required>
324-
<TextArea
325-
name="newCaCert"
326-
id="newCaCert"
327-
value={formik.values.newCaCert ?? ''}
328-
onChangeCapture={formik.handleChange}
329-
placeholder="Enter CA Certificate"
330-
data-testid="new-ca-cert"
331-
/>
332-
</FormField>
333-
</FlexItem>
334-
</Row>
335-
</>
312+
<Row gap="m" responsive>
313+
<FlexItem grow>
314+
<FormField label="Certificate" required>
315+
<TextArea
316+
name="newCaCert"
317+
id="newCaCert"
318+
value={formik.values.newCaCert ?? ''}
319+
onChangeCapture={formik.handleChange}
320+
placeholder="Enter CA Certificate"
321+
data-testid="new-ca-cert"
322+
/>
323+
</FormField>
324+
</FlexItem>
325+
</Row>
336326
)}
337-
</div>
327+
</Col>
338328
)}
339329
{formik.values.tls && (
340-
<>
341-
<Spacer />
342-
<Row responsive>
343-
<FlexItem grow>
344-
<Checkbox
345-
id={isTlsAuthId}
346-
name="tlsClientAuthRequired"
347-
label="Requires TLS Client Authentication"
348-
checked={!!formik.values.tlsClientAuthRequired}
349-
onChange={(e: ChangeEvent<HTMLInputElement>) =>
350-
formik.setFieldValue(
351-
'tlsClientAuthRequired',
352-
e.target.checked,
353-
)
354-
}
355-
data-testid="tls-required-checkbox"
356-
/>
357-
</FlexItem>
358-
</Row>
359-
</>
330+
<Row responsive>
331+
<FlexItem grow>
332+
<Checkbox
333+
id={isTlsAuthId}
334+
name="tlsClientAuthRequired"
335+
label="Requires TLS Client Authentication"
336+
checked={!!formik.values.tlsClientAuthRequired}
337+
onChange={(e: ChangeEvent<HTMLInputElement>) =>
338+
formik.setFieldValue('tlsClientAuthRequired', e.target.checked)
339+
}
340+
data-testid="tls-required-checkbox"
341+
/>
342+
</FlexItem>
343+
</Row>
360344
)}
361345
{formik.values.tls && formik.values.tlsClientAuthRequired && (
362-
<div
363-
className={cx('boxSection', styles.tslBoxSection)}
364-
style={{ marginTop: 15 }}
365-
>
346+
<Col gap="l">
366347
<Row gap="m" responsive>
367348
<FlexItem grow>
368349
<FormField label="Client Certificate" required>
@@ -406,8 +387,7 @@ const TlsDetails = (props: Props) => {
406387
{formik.values.tls &&
407388
formik.values.tlsClientAuthRequired &&
408389
formik.values.selectedTlsClientCertId === 'ADD_NEW' && (
409-
<>
410-
<Spacer />
390+
<Col gap="l">
411391
<Row gap="m" responsive>
412392
<FlexItem grow>
413393
<FormField label="Certificate" required>
@@ -423,7 +403,6 @@ const TlsDetails = (props: Props) => {
423403
</FormField>
424404
</FlexItem>
425405
</Row>
426-
<Spacer />
427406
<Row gap="m" responsive>
428407
<FlexItem grow>
429408
<FormField label="Private Key" required>
@@ -438,11 +417,11 @@ const TlsDetails = (props: Props) => {
438417
</FormField>
439418
</FlexItem>
440419
</Row>
441-
</>
420+
</Col>
442421
)}
443-
</div>
422+
</Col>
444423
)}
445-
</>
424+
</Col>
446425
)
447426
}
448427

0 commit comments

Comments
 (0)