Skip to content

Commit 1320c70

Browse files
authored
RI-7063: replace EuiPanel with Card (#4655)
* RI-7063: replace EuiPanel with Card * revert test ids
1 parent face974 commit 1320c70

File tree

35 files changed

+114
-332
lines changed

35 files changed

+114
-332
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { Card } from '@redis-ui/components'

redisinsight/ui/src/components/base/layout/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ import HorizontalRule from './horizontal-rule/HorizontalRule'
22
import LoadingContent from './loading-content/LoadingContent'
33

44
export { HorizontalRule, LoadingContent }
5+
export * from './card'

redisinsight/ui/src/components/connectivity-error/ConnectivityError.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React from 'react'
2-
import { EuiPanel } from '@elastic/eui'
32
import SuspenseLoader from 'uiSrc/components/main-router/components/SuspenseLoader'
43

54
import { Col, FlexItem } from 'uiSrc/components/base/layout/flex'
65
import { PrimaryButton } from 'uiSrc/components/base/forms/buttons'
7-
import styles from './styles.module.scss'
6+
import { Card } from 'uiSrc/components/base/layout'
87

98
export type ConnectivityErrorProps = {
109
onRetry?: () => void
@@ -17,8 +16,8 @@ const ConnectivityError = ({
1716
error,
1817
onRetry,
1918
}: ConnectivityErrorProps) => (
20-
<Col className={styles.connectivityError}>
21-
<EuiPanel>
19+
<Col>
20+
<Card>
2221
<Col style={{ minHeight: '100vh' }} centered>
2322
{isLoading && <SuspenseLoader />}
2423
<Col centered gap="xl">
@@ -30,7 +29,7 @@ const ConnectivityError = ({
3029
)}
3130
</Col>
3231
</Col>
33-
</EuiPanel>
32+
</Card>
3433
</Col>
3534
)
3635

redisinsight/ui/src/components/connectivity-error/styles.module.scss

Lines changed: 0 additions & 4 deletions
This file was deleted.

redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components/WelcomeMyTutorials/WelcomeMyTutorials.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
2-
import { EuiPanel } from '@elastic/eui'
32

43
import { PrimaryButton } from 'uiSrc/components/base/forms/buttons'
4+
import { Card } from 'uiSrc/components/base/layout'
55
import CreateTutorialLink from '../CreateTutorialLink'
66

77
import styles from './styles.module.scss'
@@ -12,12 +12,7 @@ export interface Props {
1212

1313
const WelcomeMyTutorials = ({ handleOpenUpload }: Props) => (
1414
<div className={styles.wrapper} data-testid="welcome-my-tutorials">
15-
<EuiPanel
16-
hasBorder={false}
17-
hasShadow={false}
18-
className={styles.panel}
19-
paddingSize="s"
20-
>
15+
<Card className={styles.panel}>
2116
<div className={styles.link}>
2217
<CreateTutorialLink />
2318
</div>
@@ -29,7 +24,7 @@ const WelcomeMyTutorials = ({ handleOpenUpload }: Props) => (
2924
>
3025
+ Upload <span className={styles.hideText}>tutorial</span>
3126
</PrimaryButton>
32-
</EuiPanel>
27+
</Card>
3328
</div>
3429
)
3530

redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components/WelcomeMyTutorials/styles.module.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
padding: 16px 12px 0;
33

44
.panel {
5-
display: flex;
6-
align-items: center;
7-
justify-content: space-between;
5+
flex-direction: row !important;
86

97
background-color: var(--euiColorLightestShade) !important;
108

11-
padding: 8px 18px !important;
9+
padding: 8px 18px;
1210
}
1311

1412
.link {

redisinsight/ui/src/components/side-panels/panels/live-time-recommendations/components/recommendation/Recommendation.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import React, { useContext } from 'react'
22
import { useDispatch } from 'react-redux'
33
import { useHistory, useParams } from 'react-router-dom'
4-
import {
5-
EuiPanel,
6-
EuiAccordion,
7-
EuiToolTip,
8-
EuiIcon,
9-
} from '@elastic/eui'
4+
import { EuiAccordion, EuiToolTip, EuiIcon } from '@elastic/eui'
105
import { isUndefined } from 'lodash'
116
import cx from 'classnames'
127

@@ -42,6 +37,7 @@ import {
4237

4338
import { openTutorialByPath } from 'uiSrc/slices/panels/sidePanels'
4439
import { FlexItem, Row } from 'uiSrc/components/base/layout/flex'
40+
import { Card } from 'uiSrc/components/base/layout'
4541
import {
4642
IconButton,
4743
SecondaryButton,
@@ -251,10 +247,11 @@ const Recommendation = ({
251247
<FlexItem>
252248
<EuiToolTip
253249
title={`${hide ? 'Show' : 'Hide'} tip`}
254-
content={`${hide
255-
? 'This tip will be shown in the list.'
256-
: 'This tip will be removed from the list and not displayed again.'
257-
}`}
250+
content={`${
251+
hide
252+
? 'This tip will be shown in the list.'
253+
: 'This tip will be removed from the list and not displayed again.'
254+
}`}
258255
position="top"
259256
display="inlineBlock"
260257
anchorClassName="flex-row"
@@ -296,9 +293,9 @@ const Recommendation = ({
296293
data-testid={`${name}-accordion`}
297294
aria-label={`${name}-accordion`}
298295
>
299-
<EuiPanel className={styles.accordionContent} color="subdued">
296+
<Card className={styles.accordionContent} color="subdued">
300297
{recommendationContent()}
301-
</EuiPanel>
298+
</Card>
302299
</EuiAccordion>
303300
</div>
304301
)

redisinsight/ui/src/pages/browser/components/add-key/AddKeyHash/AddKeyHash.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React, {
66
useState,
77
} from 'react'
88
import { useDispatch, useSelector } from 'react-redux'
9-
import { EuiFieldText, EuiForm, EuiPanel } from '@elastic/eui'
9+
import { EuiFieldText, EuiForm } from '@elastic/eui'
1010
import { toNumber } from 'lodash'
1111
import {
1212
isVersionHigherOrEquals,
@@ -237,14 +237,8 @@ const AddKeyHash = (props: Props) => {
237237
Submit
238238
</PrimaryButton>
239239
<AddKeyFooter>
240-
<EuiPanel
241-
color="transparent"
242-
className="flexItemNoFullWidth"
243-
hasShadow={false}
244-
borderRadius="none"
245-
style={{ border: 'none' }}
246-
>
247-
<Row justify="end">
240+
<>
241+
<Row justify="end" style={{ padding: 18 }}>
248242
<FlexItem>
249243
<SecondaryButton
250244
onClick={() => onCancel(true)}
@@ -265,7 +259,7 @@ const AddKeyHash = (props: Props) => {
265259
</PrimaryButton>
266260
</FlexItem>
267261
</Row>
268-
</EuiPanel>
262+
</>
269263
</AddKeyFooter>
270264
</EuiForm>
271265
)

redisinsight/ui/src/pages/browser/components/add-key/AddKeyList/AddKeyList.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { ChangeEvent, FormEvent, useEffect, useState } from 'react'
22
import { useDispatch, useSelector } from 'react-redux'
3-
import { EuiForm, EuiPanel, EuiSuperSelect, EuiFieldText } from '@elastic/eui'
3+
import { EuiForm, EuiSuperSelect, EuiFieldText } from '@elastic/eui'
44

55
import { Maybe, stringToBuffer } from 'uiSrc/utils'
66
import { addKeyStateSelector, addListKey } from 'uiSrc/slices/browser/keys'
@@ -117,13 +117,8 @@ const AddKeyList = (props: Props) => {
117117
Submit
118118
</PrimaryButton>
119119
<AddKeyFooter>
120-
<EuiPanel
121-
style={{ border: 'none' }}
122-
color="transparent"
123-
hasShadow={false}
124-
borderRadius="none"
125-
>
126-
<Row justify="end">
120+
<>
121+
<Row justify="end" style={{ padding: 18 }}>
127122
<FlexItem>
128123
<SecondaryButton
129124
onClick={() => onCancel(true)}
@@ -144,7 +139,7 @@ const AddKeyList = (props: Props) => {
144139
</PrimaryButton>
145140
</FlexItem>
146141
</Row>
147-
</EuiPanel>
142+
</>
148143
</AddKeyFooter>
149144
</EuiForm>
150145
)

redisinsight/ui/src/pages/browser/components/add-key/AddKeyReJSON/AddKeyReJSON.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { FormEvent, useEffect, useState } from 'react'
22
import { useDispatch, useSelector } from 'react-redux'
33
import { useParams } from 'react-router-dom'
4-
import { EuiForm, EuiPanel } from '@elastic/eui'
4+
import { EuiForm } from '@elastic/eui'
55

66
import { Maybe, stringToBuffer } from 'uiSrc/utils'
77
import { addKeyStateSelector, addReJSONKey } from 'uiSrc/slices/browser/keys'
@@ -104,14 +104,8 @@ const AddKeyReJSON = (props: Props) => {
104104
Submit
105105
</PrimaryButton>
106106
<AddKeyFooter>
107-
<EuiPanel
108-
color="transparent"
109-
className="flexItemNoFullWidth"
110-
hasShadow={false}
111-
borderRadius="none"
112-
style={{ border: 'none' }}
113-
>
114-
<Row justify="end">
107+
<>
108+
<Row justify="end" style={{ padding: 18 }}>
115109
<FlexItem>
116110
<div>
117111
<SecondaryButton
@@ -136,7 +130,7 @@ const AddKeyReJSON = (props: Props) => {
136130
</div>
137131
</FlexItem>
138132
</Row>
139-
</EuiPanel>
133+
</>
140134
</AddKeyFooter>
141135
</EuiForm>
142136
)

0 commit comments

Comments
 (0)