Skip to content

Commit 38e6570

Browse files
authored
RI-7681: Polish sentinel add / edit / clone forms (#5153)
* fix edit and clone sentinel modals * fix the message in the add redis sentinel modal * increase Cancel and Discover buttons and align them to the right * remove all messages styles, colors and sizes - they are not needed * remove eui part of message styling, cannot remove them as a whole due to multiple occurrences
1 parent f0c4232 commit 38e6570

File tree

6 files changed

+31
-62
lines changed

6 files changed

+31
-62
lines changed

redisinsight/ui/src/pages/home/components/cluster-connection/styles.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
.message {
22
font-family: 'Graphik', sans-serif;
33
color: var(--euiTextSubduedColor) !important;
4-
5-
:global(.euiTextColor), :global(.euiLink) {
6-
color: currentColor !important;
7-
}
84
}
95

106
.link {

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

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ import { ExternalLink } from 'uiSrc/components'
88
import styles from '../styles.module.scss'
99

1010
const MessageCloudApiKeys = () => (
11-
<Text
12-
color="subdued"
13-
size="s"
14-
className={styles.message}
15-
data-testid="summary"
16-
>
11+
<Text data-testid="summary">
1712
{
1813
'Enter Redis Cloud API keys to discover and add databases. API keys can be enabled by following the steps mentioned in the '
1914
}
@@ -28,12 +23,7 @@ const MessageCloudApiKeys = () => (
2823
)
2924

3025
const MessageStandalone = () => (
31-
<Text
32-
color="subdued"
33-
size="s"
34-
className={styles.message}
35-
data-testid="summary"
36-
>
26+
<Text data-testid="summary">
3727
You can manually add your Redis databases. Enter host and port of your Redis
3828
database to add it to {APPLICATION_NAME}. &nbsp;
3929
<ExternalLink
@@ -49,12 +39,7 @@ const MessageStandalone = () => (
4939
)
5040

5141
const MessageSentinel = () => (
52-
<Text
53-
color="subdued"
54-
size="s"
55-
className={styles.message}
56-
data-testid="summary"
57-
>
42+
<Text data-testid="summary">
5843
You can automatically discover and add primary groups from your Redis
5944
Sentinel. Enter host and port of your Redis Sentinel to automatically
6045
discover your primary groups and add them to {APPLICATION_NAME}. &nbsp;
@@ -71,12 +56,7 @@ const MessageSentinel = () => (
7156
)
7257

7358
const MessageEnterpriceSoftware = () => (
74-
<Text
75-
color="subdued"
76-
size="s"
77-
className={styles.message}
78-
data-testid="summary"
79-
>
59+
<Text data-testid="summary">
8060
Your Redis Software databases can be automatically added. Enter the
8161
connection details of your Redis Software Cluster to automatically discover
8262
your databases and add them to {APPLICATION_NAME}. &nbsp;

redisinsight/ui/src/pages/home/components/form/sentinel/PrimaryGroupSentinel.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import { FormikProps } from 'formik'
33

44
import { DbConnectionInfo } from 'uiSrc/pages/home/interfaces'
5-
import { FlexItem, Row } from 'uiSrc/components/base/layout/flex'
5+
import { Col, FlexItem, Row } from 'uiSrc/components/base/layout/flex'
66
import { FormField } from 'uiSrc/components/base/forms/FormField'
77
import { TextInput } from 'uiSrc/components/base/inputs'
88

@@ -15,10 +15,10 @@ export interface Props {
1515
const PrimaryGroupSentinel = (props: Props) => {
1616
const { flexGroupClassName = '', flexItemClassName = '', formik } = props
1717
return (
18-
<>
18+
<Col gap="l">
1919
<Row gap="m" responsive className={flexGroupClassName}>
2020
<FlexItem grow className={flexItemClassName}>
21-
<FormField label="Database Alias*">
21+
<FormField label="Database alias" required>
2222
<TextInput
2323
name="name"
2424
id="name"
@@ -33,7 +33,7 @@ const PrimaryGroupSentinel = (props: Props) => {
3333
</Row>
3434
<Row gap="m" responsive className={flexGroupClassName}>
3535
<FlexItem grow className={flexItemClassName}>
36-
<FormField label="Primary Group Name*">
36+
<FormField label="Primary group name" required>
3737
<TextInput
3838
name="sentinelMasterName"
3939
id="sentinelMasterName"
@@ -47,7 +47,7 @@ const PrimaryGroupSentinel = (props: Props) => {
4747
</FormField>
4848
</FlexItem>
4949
</Row>
50-
</>
50+
</Col>
5151
)
5252
}
5353

redisinsight/ui/src/pages/home/components/manual-connection/manual-connection-form/forms/EditSentinelConnection.tsx

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
TlsDetails,
1313
} from 'uiSrc/pages/home/components/form'
1414
import { DbConnectionInfo } from 'uiSrc/pages/home/interfaces'
15-
import { FlexItem, Row } from 'uiSrc/components/base/layout/flex'
15+
import { Col, FlexItem, Row } from 'uiSrc/components/base/layout/flex'
1616
import { Spacer } from 'uiSrc/components/base/layout/spacer'
1717
import { FormField } from 'uiSrc/components/base/forms/FormField'
1818
import { Title } from 'uiSrc/components/base/text/Title'
@@ -45,38 +45,36 @@ const EditSentinelConnection = (props: Props) => {
4545
} = props
4646

4747
const GeneralFormClodeMode = (
48-
<>
48+
<Col gap="l">
4949
<PrimaryGroupSentinel formik={formik} />
5050
<Divider />
51-
<Title size="XS">Database</Title>
52-
<Spacer size="s" />
51+
<Title color="primary" size="M">
52+
Database
53+
</Title>
5354
<SentinelMasterDatabase
5455
formik={formik}
5556
db={db}
5657
isCloneMode={isCloneMode}
5758
/>
5859
<Divider />
59-
<Title size="XS">Sentinel</Title>
60-
<Spacer size="s" />
60+
<Title color="primary" size="M">
61+
Sentinel
62+
</Title>
6163
<DatabaseForm
6264
formik={formik}
6365
showFields={{ host: true, port: true, alias: false, timeout: false }}
6466
onHostNamePaste={onHostNamePaste}
6567
/>
66-
<Spacer size="m" />
6768
<Divider />
68-
<Spacer size="m" />
6969
<DbIndex formik={formik} />
70-
<Spacer size="m" />
71-
<Divider />
72-
</>
70+
</Col>
7371
)
7472

7573
const GeneralFormEditMode = (
76-
<>
74+
<Col gap="l">
7775
<Row gap="m">
7876
<FlexItem grow>
79-
<FormField label="Database Alias*">
77+
<FormField label="Database Alias" required>
8078
<TextInput
8179
name="name"
8280
id="name"
@@ -90,24 +88,25 @@ const EditSentinelConnection = (props: Props) => {
9088
</FormField>
9189
</FlexItem>
9290
</Row>
93-
<Spacer size="s" />
9491
<Divider />
95-
<Title size="XS">Database</Title>
96-
<Spacer size="s" />
92+
<Title color="primary" size="M">
93+
Database
94+
</Title>
9795
<SentinelMasterDatabase
9896
formik={formik}
9997
db={db}
10098
isCloneMode={isCloneMode}
10199
/>
102100
<Divider />
103-
<Title size="XS">Sentinel</Title>
104-
<Spacer size="s" />
101+
<Title color="primary" size="M">
102+
Sentinel
103+
</Title>
105104
<DatabaseForm
106105
formik={formik}
107106
showFields={{ host: false, port: true, alias: false, timeout: false }}
108107
onHostNamePaste={onHostNamePaste}
109108
/>
110-
</>
109+
</Col>
111110
)
112111

113112
return (

redisinsight/ui/src/pages/home/components/sentinel-connection/sentinel-connection-form/SentinelConnectionForm.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
SecondaryButton,
2121
} from 'uiSrc/components/base/forms/buttons'
2222
import { RiTooltip } from 'uiSrc/components'
23+
import { Row } from 'uiSrc/components/base/layout/flex'
2324

2425
export interface Props {
2526
loading: boolean
@@ -92,16 +93,14 @@ const SentinelConnectionForm = (props: Props) => {
9293
content={getSubmitButtonContent(errors, submitIsDisabled)}
9394
>
9495
<PrimaryButton
95-
size="s"
9696
type="submit"
9797
onClick={onClick}
9898
disabled={submitIsDisabled}
9999
loading={loading}
100100
icon={submitIsDisabled ? InfoIcon : undefined}
101101
data-testid="btn-submit"
102-
style={{ marginLeft: 12 }}
103102
>
104-
Discover Database
103+
Discover database
105104
</PrimaryButton>
106105
</RiTooltip>
107106
)
@@ -111,10 +110,9 @@ const SentinelConnectionForm = (props: Props) => {
111110

112111
if (footerEl) {
113112
return ReactDOM.createPortal(
114-
<div className="footerAddDatabase">
113+
<Row justify="end" gap="m" className="footerAddDatabase">
115114
{onClose && (
116115
<SecondaryButton
117-
size="s"
118116
onClick={onClose}
119117
className="btn-cancel"
120118
data-testid="btn-cancel"
@@ -126,7 +124,7 @@ const SentinelConnectionForm = (props: Props) => {
126124
onClick={formik.submitForm}
127125
submitIsDisabled={submitIsDisable()}
128126
/>
129-
</div>,
127+
</Row>,
130128
footerEl,
131129
)
132130
}

redisinsight/ui/src/pages/home/components/styles.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@
8383
.message {
8484
font-family: 'Graphik', sans-serif;
8585
color: var(--euiTextSubduedColor) !important;
86-
87-
:global(.euiTextColor), :global(.euiLink) {
88-
color: currentColor !important;
89-
}
9086
}
9187

9288
.link {

0 commit comments

Comments
 (0)