Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ const JSONScalar = (props: Props) => {
path = keyName.includes('"') ? `${parentPath}['${keyName}']` : `${parentPath}["${keyName}"]`
}

let changedValue = value
let val = value
if (value === null) {
changedValue = JSON.stringify(value)
val = JSON.stringify(value)
}
if (typeof value === 'string') {
changedValue = `"${value}"`
val = `"${value}"`
}

setChangedValue(changedValue)
setChangedValue(val)
setPath(path)
}, [parentPath, keyName])
}, [parentPath, keyName, value])

const validateJSONValue = (value: JSONScalarValue) => {
let error: string = ''
Expand Down Expand Up @@ -208,7 +208,7 @@ const JSONScalar = (props: Props) => {
updateLoading={false}
showPopover={(item) => setDeleting(`${item}scalar`)}
handleDeleteItem={() => handleSubmitRemoveKey(path, keyName.toString())}
/>
/>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,27 @@ const RejsonDetailsWrapper = () => {
data-testid="progress-key-json"
/>
)}
<RejsonDetails
selectedKey={selectedKey}
dbNumber={0}
dataType={type || ''}
deleteMsg=""
instanceId={123}
resultTableKeyMap={{}}
handleSubmitJsonUpdateValue={handleSubmitJsonUpdateValue}
onJSONPropertyDeleted={reportJSONPropertyDeleted}
data={data}
onJSONKeyExpandAndCollapse={reportJSONKeyExpandAndCollapse}
onJSONPropertyAdded={reportJSONPropertyAdded}
onJSONPropertyEdited={reportJSONPropertyEdited}
shouldRejsonDataBeDownloaded={!downloaded}
handleSubmitUpdateValue={handleEditValueUpdate}
handleDeleteKeyDialogOpen={() => {}}
handleOpenExpiryDialog={() => {}}
keyProperty={{}}
/>
{!(loading && data === undefined) && (
<RejsonDetails
selectedKey={selectedKey}
dbNumber={0}
dataType={type || ''}
deleteMsg=""
instanceId={123}
resultTableKeyMap={{}}
handleSubmitJsonUpdateValue={handleSubmitJsonUpdateValue}
onJSONPropertyDeleted={reportJSONPropertyDeleted}
data={data}
onJSONKeyExpandAndCollapse={reportJSONKeyExpandAndCollapse}
onJSONPropertyAdded={reportJSONPropertyAdded}
onJSONPropertyEdited={reportJSONPropertyEdited}
shouldRejsonDataBeDownloaded={!downloaded}
handleSubmitUpdateValue={handleEditValueUpdate}
handleDeleteKeyDialogOpen={() => {}}
handleOpenExpiryDialog={() => {}}
keyProperty={{}}
/>
)}
</div>
)
}
Expand Down
1 change: 0 additions & 1 deletion redisinsight/ui/src/slices/browser/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ function addTypedKey(
onSuccessAction()
}
dispatch(addKeySuccess())
dispatch<any>(fetchKeyInfo(data.keyName))
dispatch(
addMessageNotification(successMessages.ADDED_NEW_KEY(data.keyName))
)
Expand Down
5 changes: 2 additions & 3 deletions redisinsight/ui/src/slices/browser/rejson.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import { cloneDeep } from 'lodash'
import axios, { CancelTokenSource } from 'axios'
import * as jsonpath from 'jsonpath'

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

import { InitialStateRejson } from '../interfaces'
import { refreshKeyInfoAction } from './keys'
import { InitialStateRejson } from '../interfaces'
import { addErrorNotification, addMessageNotification } from '../app/notifications'
import { AppDispatch, RootState } from '../store'

Expand All @@ -30,7 +29,7 @@ export const initialState: InitialStateRejson = {
error: '',
data: {
downloaded: false,
data: null,
data: undefined,
type: '',
},
}
Expand Down
Loading