Skip to content

Commit 59650e0

Browse files
committed
fix errors after main merge
1 parent c7bb583 commit 59650e0

File tree

9 files changed

+66
-47
lines changed

9 files changed

+66
-47
lines changed

redisinsight/ui/src/components/consents-settings/ConsentOption/ConsentOption.spec.tsx

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { render, screen, fireEvent } from 'uiSrc/utils/test-utils'
2+
import { render, screen, userEvent } from 'uiSrc/utils/test-utils'
33
import ConsentOption from './ConsentOption'
44
import { IConsent } from '../ConsentsSettings'
55

@@ -39,10 +39,10 @@ describe('ConsentOption', () => {
3939
expect(screen.getByTestId('switch-option-analytics')).toBeInTheDocument()
4040
})
4141

42-
it('should call onChangeAgreement when switch is clicked', () => {
42+
it('should call onChangeAgreement when switch is clicked', async () => {
4343
render(<ConsentOption {...defaultProps} />)
4444

45-
fireEvent.click(screen.getByTestId('switch-option-analytics'))
45+
await userEvent.click(screen.getByTestId('switch-option-analytics'))
4646

4747
expect(mockOnChangeAgreement).toHaveBeenCalledWith(true, 'analytics')
4848
})
@@ -56,7 +56,9 @@ describe('ConsentOption', () => {
5656

5757
render(<ConsentOption {...defaultProps} consent={consentWithDescription} />)
5858

59-
expect(screen.getByText('Help us improve Redis Insight by sharing usage data.')).toBeInTheDocument()
59+
expect(
60+
screen.getByText('Help us improve Redis Insight by sharing usage data.'),
61+
).toBeInTheDocument()
6062
expect(screen.queryByText('Privacy Policy')).not.toBeInTheDocument()
6163
})
6264

@@ -75,7 +77,7 @@ describe('ConsentOption', () => {
7577
const privacyPolicyLink = screen.getByText('Privacy Policy')
7678
expect(privacyPolicyLink.closest('a')).toHaveAttribute(
7779
'href',
78-
'https://redis.io/legal/privacy-policy/?utm_source=redisinsight&utm_medium=app&utm_campaign=telemetry'
80+
'https://redis.io/legal/privacy-policy/?utm_source=redisinsight&utm_medium=app&utm_campaign=telemetry',
7981
)
8082
})
8183

@@ -86,7 +88,13 @@ describe('ConsentOption', () => {
8688
linkToPrivacyPolicy: true,
8789
}
8890

89-
render(<ConsentOption {...defaultProps} consent={consentWithPrivacyLink} isSettingsPage />)
91+
render(
92+
<ConsentOption
93+
{...defaultProps}
94+
consent={consentWithPrivacyLink}
95+
isSettingsPage
96+
/>,
97+
)
9098

9199
// Verify that the Privacy Policy link is rendered
92100
expect(screen.getByText('Privacy Policy')).toBeInTheDocument()
@@ -99,9 +107,17 @@ describe('ConsentOption', () => {
99107
linkToPrivacyPolicy: false,
100108
}
101109

102-
render(<ConsentOption {...defaultProps} consent={consentWithoutPrivacyLink} isSettingsPage />)
110+
render(
111+
<ConsentOption
112+
{...defaultProps}
113+
consent={consentWithoutPrivacyLink}
114+
isSettingsPage
115+
/>,
116+
)
103117

104-
expect(screen.getByText('Help us improve Redis Insight by sharing usage data.')).toBeInTheDocument()
118+
expect(
119+
screen.getByText('Help us improve Redis Insight by sharing usage data.'),
120+
).toBeInTheDocument()
105121
expect(screen.queryByText('Privacy Policy')).not.toBeInTheDocument()
106122
})
107123

@@ -123,4 +139,4 @@ describe('ConsentOption', () => {
123139
const switchElement = screen.getByTestId('switch-option-analytics')
124140
expect(switchElement).toBeChecked()
125141
})
126-
})
142+
})

redisinsight/ui/src/pages/browser/components/browser-right-panel/BrowserRightPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const BrowserRightPanel = (props: Props) => {
9898
}
9999

100100
const handleEditKey = (
101-
key: RedisResponseBuffer,
101+
_key: RedisResponseBuffer,
102102
newKey: RedisResponseBuffer,
103103
) => {
104104
setSelectedKey(newKey)

redisinsight/ui/src/pages/browser/components/bulk-actions/BulkActionSummary/BulkActionSummary.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface Props {
1919
const SummaryContainer = styled(Row)`
2020
padding-top: 18px;
2121
`
22-
const SummaryValue = styled(EuiText)`
22+
const SummaryValue = styled(Text)`
2323
font-size: 18px !important;
2424
line-height: 24px;
2525
font-weight: 500 !important;
@@ -36,27 +36,21 @@ const BulkActionSummary = ({
3636
<SummaryContainer data-testid={testId} gap="xl">
3737
<FlexItem>
3838
<SummaryValue>{numberWithSpaces(processed)}</SummaryValue>
39-
<Text color="subdued" className={styles.summaryLabel}>
39+
<SummaryValue color="subdued">
4040
{type === BulkActionsType.Delete ? 'Keys' : 'Commands'} Processed
41-
</Text>
41+
</SummaryValue>
4242
</FlexItem>
4343
<FlexItem>
4444
<SummaryValue>{numberWithSpaces(succeed)}</SummaryValue>
45-
<Text color="subdued" className={styles.summaryLabel}>
46-
Success
47-
</Text>
45+
<SummaryValue color="subdued">Success</SummaryValue>
4846
</FlexItem>
4947
<FlexItem>
5048
<SummaryValue>{numberWithSpaces(failed)}</SummaryValue>
51-
<Text color="subdued" className={styles.summaryLabel}>
52-
Errors
53-
</Text>
49+
<SummaryValue color="subdued">Errors</SummaryValue>
5450
</FlexItem>
5551
<FlexItem>
5652
<SummaryValue>{millisecondsFormat(duration, 'H:mm:ss.SSS')}</SummaryValue>
57-
<Text color="subdued" className={styles.summaryLabel}>
58-
Time Taken
59-
</Text>
53+
<SummaryValue color="subdued">Time Taken</SummaryValue>
6054
</FlexItem>
6155
</SummaryContainer>
6256
)

redisinsight/ui/src/pages/browser/components/load-sample-data/LoadSampleData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const LoadSampleData = (props: Props) => {
6666
</PrimaryButton>
6767
}
6868
>
69-
<Row gap="m" responsive={false}>
69+
<Row gap="m" responsive={false} style={{ padding: 8 }}>
7070
<FlexItem>
7171
<EuiIcon type="alert" className={styles.popoverIcon} />
7272
</FlexItem>

redisinsight/ui/src/pages/browser/components/virtual-tree/components/Node/Node.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import KeyRowType from 'uiSrc/pages/browser/components/key-row-type'
1313
import { RedisResponseBuffer } from 'uiSrc/slices/interfaces'
1414
import { appContextDbConfig } from 'uiSrc/slices/app/context'
1515
import { RiTooltip } from 'uiSrc/components'
16+
import { Col, Row } from 'uiSrc/components/base/layout/flex'
1617
import { DeleteKeyPopover } from '../../../delete-key-popover/DeleteKeyPopover'
1718
import { TreeData } from '../../interfaces'
1819
import styles from './styles.module.scss'
@@ -111,8 +112,12 @@ const Node = ({
111112
}
112113

113114
const Folder = () => (
114-
<RiTooltip content={tooltipContent} position="bottom">
115-
<span className={styles.anchorTooltipNode}>
115+
<RiTooltip
116+
content={tooltipContent}
117+
position="bottom"
118+
style={{ width: '100%' }}
119+
>
120+
<Row responsive align="center" grow className={styles.anchorTooltipNode}>
116121
<div className={styles.nodeName}>
117122
<EuiIcon
118123
type={isOpen ? 'arrowDown' : 'arrowRight'}
@@ -141,7 +146,7 @@ const Node = ({
141146
{keyCount ?? ''}
142147
</div>
143148
</div>
144-
</span>
149+
</Row>
145150
</RiTooltip>
146151
)
147152

@@ -179,7 +184,9 @@ const Node = ({
179184
)
180185

181186
const Node = (
182-
<div
187+
<Row
188+
justify="between"
189+
align="center"
183190
className={cx(styles.nodeContent, 'rowKey', {
184191
[styles.nodeContentOpen]: isOpen && !isLeaf,
185192
})}
@@ -192,11 +199,11 @@ const Node = ({
192199
>
193200
{!isLeaf && <Folder />}
194201
{isLeaf && <Leaf />}
195-
</div>
202+
</Row>
196203
)
197204

198205
const tooltipContent = (
199-
<>
206+
<Col gap="m">
200207
<div className={styles.folderTooltipHeader}>
201208
<span
202209
className={styles.folderPattern}
@@ -210,7 +217,7 @@ const Node = ({
210217
)}
211218
</div>
212219
<span>{`${keyCount} key(s) (${Math.round(keyApproximate * 100) / 100}%)`}</span>
213-
</>
220+
</Col>
214221
)
215222

216223
return (

redisinsight/ui/src/pages/browser/components/virtual-tree/components/Node/styles.module.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
.anchorTooltipNode {
2-
width: 100%;
32
height: 42px;
4-
display: flex !important;
53
position: relative;
6-
align-items: center;
74
}
85

96
.nodeContainer {
@@ -19,12 +16,9 @@
1916
}
2017

2118
.nodeContent {
22-
display: flex;
23-
justify-content: space-between;
2419
cursor: pointer;
2520
padding: 8px 16px;
2621
color: var(--euiTextSubduedColor) !important;
27-
align-items: center;
2822
font:
2923
normal normal normal 13px/28px Graphik,
3024
sans-serif !important;

redisinsight/ui/src/pages/browser/modules/key-details/components/change-editor-type-button/ChangeEditorTypeButton.spec.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import { render, screen } from '@testing-library/react'
33

44
import { userEvent } from 'uiSrc/utils/test-utils'
5-
import ChangeEditorTypeButton, { ButtonMode } from './ChangeEditorTypeButton'
5+
import ChangeEditorTypeButton from './ChangeEditorTypeButton'
66

77
const mockSwitchEditorType = jest.fn()
88
let mockIsTextEditorDisabled = false
@@ -43,7 +43,11 @@ describe('ChangeEditorTypeButton', () => {
4343

4444
await userEvent.hover(button)
4545
expect(
46-
(await screen.findAllByText('This JSON is too large to edit'))[0],
46+
(
47+
await screen.findAllByText(
48+
'This JSON document is too large to view or edit in full.',
49+
)
50+
)[0],
4751
).toBeInTheDocument()
4852
})
4953

redisinsight/ui/src/pages/browser/modules/key-details/components/change-editor-type-button/ChangeEditorTypeButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ const ChangeEditorTypeButton = () => {
2626
}
2727

2828
export default ChangeEditorTypeButton
29+
30+
export class ButtonMode {}

redisinsight/ui/src/pages/browser/modules/key-details/components/no-key-selected/NoKeySelected.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,17 @@ export const NoKeySelected = (props: Props) => {
4444

4545
return (
4646
<>
47-
<RiTooltip content="Close" position="left">
48-
<IconButton
49-
icon={CancelSlimIcon}
50-
aria-label="Close panel"
51-
className={styles.closeBtn}
52-
onClick={handleClosePanel}
53-
data-testid="close-right-panel-btn"
54-
/>
55-
</RiTooltip>
47+
<div className={styles.closeRightPanel}>
48+
<RiTooltip content="Close" position="left">
49+
<IconButton
50+
icon={CancelSlimIcon}
51+
aria-label="Close panel"
52+
className={styles.closeBtn}
53+
onClick={handleClosePanel}
54+
data-testid="close-right-panel-btn"
55+
/>
56+
</RiTooltip>
57+
</div>
5658

5759
<div className={styles.placeholder}>
5860
<Text textAlign="center" color="subdued" size="s">

0 commit comments

Comments
 (0)