Skip to content

Commit 9174dec

Browse files
authored
Merge pull request #1451 from RedisInsight/fe/bugfix/pika_db
fix pika db black screen
2 parents bbcaee8 + 9ac8c98 commit 9174dec

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

redisinsight/ui/src/pages/databaseAnalysis/components/top-keys/Table.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
PropertySort
88
} from '@elastic/eui'
99
import cx from 'classnames'
10-
import { isNull } from 'lodash'
10+
import { isNil } from 'lodash'
1111
import React, { useState } from 'react'
1212
import { useDispatch, useSelector } from 'react-redux'
1313
import { useHistory, useParams } from 'react-router-dom'
@@ -138,6 +138,13 @@ const Table = (props: Props) => {
138138
sortable: true,
139139
align: 'left',
140140
render: (value: number, { name }) => {
141+
if (isNil(value)) {
142+
return (
143+
<EuiTextColor color="subdued" style={{ maxWidth: '100%' }} data-testid={`ttl-empty-${value}`}>
144+
-
145+
</EuiTextColor>
146+
)
147+
}
141148
if (value === -1) {
142149
return (
143150
<EuiTextColor color="subdued" data-testid={`ttl-no-limit-${name}`}>
@@ -174,6 +181,13 @@ const Table = (props: Props) => {
174181
sortable: true,
175182
align: 'right',
176183
render: (value: number, { type }) => {
184+
if (isNil(value)) {
185+
return (
186+
<EuiTextColor color="subdued" style={{ maxWidth: '100%' }} data-testid={`size-empty-${value}`}>
187+
-
188+
</EuiTextColor>
189+
)
190+
}
177191
const [number, size] = formatBytes(value, 3, true)
178192
const isHighlight = isBigKey(type, HighlightType.Memory, value)
179193
return (
@@ -207,7 +221,7 @@ const Table = (props: Props) => {
207221
sortable: ({ length }) => length ?? -1,
208222
align: 'right',
209223
render: (value: number, { name, type }) => {
210-
if (isNull(value)) {
224+
if (isNil(value)) {
211225
return (
212226
<EuiTextColor color="subdued" style={{ maxWidth: '100%' }} data-testid={`length-empty-${name}`}>
213227
-

redisinsight/ui/src/pages/databaseAnalysis/components/top-namespace/Table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const NameSpacesTable = (props: Props) => {
6666
dispatch(setBrowserTreeDelimiter(delimiter))
6767
dispatch(setFilter(filter))
6868
dispatch(setSearchMatch(`${nsp}${delimiter}*`, SearchMode.Pattern))
69-
dispatch(resetKeysData())
69+
dispatch(resetKeysData(SearchMode.Pattern))
7070
dispatch(fetchKeys(
7171
SearchMode.Pattern,
7272
'0',

redisinsight/ui/src/slices/instances/instances.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ const instancesSlice = createSlice({
126126
getDatabaseConfigInfoSuccess: (state, { payload }) => {
127127
state.loading = false
128128
state.instanceOverview = {
129-
version: state.instanceOverview.version,
130-
...payload
129+
...payload,
130+
version: payload?.version || state.instanceOverview.version || '',
131131
}
132132
},
133133
getDatabaseConfigInfoFailure: (state, { payload }) => {

redisinsight/ui/src/utils/comparisons/compareVersions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const isVersionHigherOrEquals = (sourceVersion: string, comparableVersion: string) => {
1+
export const isVersionHigherOrEquals = (sourceVersion: string = '', comparableVersion: string = '') => {
22
const sourceVersionArray = sourceVersion.split('.')
33
const comparableVersionArray = comparableVersion.split('.')
44

0 commit comments

Comments
 (0)