Skip to content

Commit 7987354

Browse files
committed
#RI-5265 - fix performance issues
1 parent 6a510a3 commit 7987354

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

redisinsight/ui/src/pages/browser/BrowserPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const BrowserPage = () => {
189189
}))
190190
}
191191

192-
const selectKey = ({ rowData }: { rowData: any }) => {
192+
const selectKey = useCallback(({ rowData }: { rowData: any }) => {
193193
if (!isEqualBuffers(rowData.name, selectedKeyRef.current)) {
194194
dispatch(toggleBrowserFullScreen(false))
195195

@@ -198,7 +198,7 @@ const BrowserPage = () => {
198198
closeRightPanels()
199199
prevSelectedType.current = rowData.type
200200
}
201-
}
201+
}, [])
202202

203203
const closePanel = () => {
204204
dispatch(toggleBrowserFullScreen(true))

redisinsight/ui/src/pages/browser/components/no-keys-found/NoKeysFound.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from 'react'
2-
import { EuiIcon, EuiTitle, EuiText, EuiSpacer, EuiButton } from '@elastic/eui'
2+
import { EuiTitle, EuiText, EuiSpacer, EuiButton, EuiImage } from '@elastic/eui'
33
import { useDispatch } from 'react-redux'
44

55
import { setBulkActionType } from 'uiSrc/slices/browser/bulkActions'
@@ -29,10 +29,10 @@ const NoKeysFound = (props: Props) => {
2929

3030
return (
3131
<div className={styles.container} data-testid="no-result-found-msg">
32-
<EuiIcon
32+
<EuiImage
3333
className={styles.img}
34-
type={theme === Theme.Dark ? TelescopeDark : TelescopeLight}
35-
size="original"
34+
src={theme === Theme.Dark ? TelescopeDark : TelescopeLight}
35+
alt="no results image"
3636
/>
3737
<EuiSpacer size="l" />
3838
<EuiText>No Keys Found</EuiText>

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
TreeWalkerValue,
77
FixedSizeTree as Tree,
88
} from 'react-vtree'
9-
import { EuiIcon, EuiLoadingSpinner, EuiProgress } from '@elastic/eui'
9+
import { EuiIcon, EuiImage, EuiLoadingSpinner, EuiProgress } from '@elastic/eui'
1010
import { useDispatch } from 'react-redux'
1111

1212
import { bufferToString, Maybe, Nullable } from 'uiSrc/utils'
@@ -275,7 +275,15 @@ const VirtualTree = (props: Props) => {
275275
<div className={styles.loadingContainer} style={{ width, height }} data-testid="virtual-tree-spinner">
276276
<div className={styles.loadingBody}>
277277
<EuiLoadingSpinner size="xl" className={styles.loadingSpinner} />
278-
<EuiIcon type={loadingIcon || 'empty'} className={styles.loadingIcon} />
278+
{loadingIcon ? (
279+
<EuiImage
280+
className={styles.loadingIcon}
281+
src={loadingIcon}
282+
alt="loading"
283+
/>
284+
) : (
285+
<EuiIcon type="empty" className={styles.loadingIcon} />
286+
)}
279287
</div>
280288
</div>
281289
)}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131

3232
.loadingIcon {
33-
position: absolute;
33+
position: absolute !important;
3434
width: 28px !important;
3535
height: 28px !important;
3636
top: 12px;

0 commit comments

Comments
 (0)