Skip to content

Commit 5767a82

Browse files
authored
Merge pull request #692 from RedisInsight/feature/bugfix
#RI-2965, #RI-2966
2 parents 8a8d0dd + 8c55fe0 commit 5767a82

File tree

6 files changed

+184
-186
lines changed

6 files changed

+184
-186
lines changed

redisinsight/ui/src/pages/browser/components/rejson-details/JSONScalar/JSONScalar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ const JSONScalar = (props: Props) => {
5858
path = keyName.includes('"') ? `${parentPath}['${keyName}']` : `${parentPath}["${keyName}"]`
5959
}
6060

61-
let changedValue = value
61+
let val = value
6262
if (value === null) {
63-
changedValue = JSON.stringify(value)
63+
val = JSON.stringify(value)
6464
}
6565
if (typeof value === 'string') {
66-
changedValue = `"${value}"`
66+
val = `"${value}"`
6767
}
6868

69-
setChangedValue(changedValue)
69+
setChangedValue(val)
7070
setPath(path)
71-
}, [parentPath, keyName])
71+
}, [parentPath, keyName, value])
7272

7373
const validateJSONValue = (value: JSONScalarValue) => {
7474
let error: string = ''
@@ -208,7 +208,7 @@ const JSONScalar = (props: Props) => {
208208
updateLoading={false}
209209
showPopover={(item) => setDeleting(`${item}scalar`)}
210210
handleDeleteItem={() => handleSubmitRemoveKey(path, keyName.toString())}
211-
/>
211+
/>
212212
</div>
213213
</div>
214214
</div>

redisinsight/ui/src/pages/browser/components/rejson-details/RejsonDetailsWrapper.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,27 @@ const RejsonDetailsWrapper = () => {
7676
data-testid="progress-key-json"
7777
/>
7878
)}
79-
<RejsonDetails
80-
selectedKey={selectedKey}
81-
dbNumber={0}
82-
dataType={type || ''}
83-
deleteMsg=""
84-
instanceId={123}
85-
resultTableKeyMap={{}}
86-
handleSubmitJsonUpdateValue={handleSubmitJsonUpdateValue}
87-
onJSONPropertyDeleted={reportJSONPropertyDeleted}
88-
data={data}
89-
onJSONKeyExpandAndCollapse={reportJSONKeyExpandAndCollapse}
90-
onJSONPropertyAdded={reportJSONPropertyAdded}
91-
onJSONPropertyEdited={reportJSONPropertyEdited}
92-
shouldRejsonDataBeDownloaded={!downloaded}
93-
handleSubmitUpdateValue={handleEditValueUpdate}
94-
handleDeleteKeyDialogOpen={() => {}}
95-
handleOpenExpiryDialog={() => {}}
96-
keyProperty={{}}
97-
/>
79+
{!(loading && data === undefined) && (
80+
<RejsonDetails
81+
selectedKey={selectedKey}
82+
dbNumber={0}
83+
dataType={type || ''}
84+
deleteMsg=""
85+
instanceId={123}
86+
resultTableKeyMap={{}}
87+
handleSubmitJsonUpdateValue={handleSubmitJsonUpdateValue}
88+
onJSONPropertyDeleted={reportJSONPropertyDeleted}
89+
data={data}
90+
onJSONKeyExpandAndCollapse={reportJSONKeyExpandAndCollapse}
91+
onJSONPropertyAdded={reportJSONPropertyAdded}
92+
onJSONPropertyEdited={reportJSONPropertyEdited}
93+
shouldRejsonDataBeDownloaded={!downloaded}
94+
handleSubmitUpdateValue={handleEditValueUpdate}
95+
handleDeleteKeyDialogOpen={() => {}}
96+
handleOpenExpiryDialog={() => {}}
97+
keyProperty={{}}
98+
/>
99+
)}
98100
</div>
99101
)
100102
}

redisinsight/ui/src/slices/browser/keys.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ function addTypedKey(
612612
onSuccessAction()
613613
}
614614
dispatch(addKeySuccess())
615-
dispatch<any>(fetchKeyInfo(data.keyName))
616615
dispatch(
617616
addMessageNotification(successMessages.ADDED_NEW_KEY(data.keyName))
618617
)

redisinsight/ui/src/slices/browser/rejson.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
2-
import { cloneDeep } from 'lodash'
32
import axios, { CancelTokenSource } from 'axios'
43
import * as jsonpath from 'jsonpath'
54

@@ -20,8 +19,8 @@ import {
2019
RemoveRejsonRlResponse,
2120
} from 'apiSrc/modules/browser/dto/rejson-rl.dto'
2221

23-
import { InitialStateRejson } from '../interfaces'
2422
import { refreshKeyInfoAction } from './keys'
23+
import { InitialStateRejson } from '../interfaces'
2524
import { addErrorNotification, addMessageNotification } from '../app/notifications'
2625
import { AppDispatch, RootState } from '../store'
2726

@@ -30,7 +29,7 @@ export const initialState: InitialStateRejson = {
3029
error: '',
3130
data: {
3231
downloaded: false,
33-
data: null,
32+
data: undefined,
3433
type: '',
3534
},
3635
}

0 commit comments

Comments
 (0)