Skip to content

Commit 56898dc

Browse files
authored
Merge pull request #2875 from RedisInsight/fe/bugfix/RI-5265-performance-issues
#RI-5265 - fix performance issues
2 parents b883b2a + af5e374 commit 56898dc

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
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/key-tree/KeyTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,4 @@ const KeyTree = forwardRef((props: Props, ref) => {
212212
)
213213
})
214214

215-
export default KeyTree
215+
export default React.memo(KeyTree)

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'
@@ -276,7 +276,15 @@ const VirtualTree = (props: Props) => {
276276
<div className={styles.loadingContainer} style={{ width, height }} data-testid="virtual-tree-spinner">
277277
<div className={styles.loadingBody}>
278278
<EuiLoadingSpinner size="xl" className={styles.loadingSpinner} />
279-
<EuiIcon type={loadingIcon || 'empty'} className={styles.loadingIcon} />
279+
{loadingIcon ? (
280+
<EuiImage
281+
className={styles.loadingIcon}
282+
src={loadingIcon}
283+
alt="loading"
284+
/>
285+
) : (
286+
<EuiIcon type="empty" className={styles.loadingIcon} />
287+
)}
280288
</div>
281289
</div>
282290
)}

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)