Skip to content

Commit 0db4087

Browse files
#RI-5030-5031 (#2683)
1 parent 22491aa commit 0db4087

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/form-components/SSHDetails.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,15 @@ const SSHDetails = (props: Props) => {
197197
>
198198
<EuiFlexItem className={flexItemClassName}>
199199
<EuiFormRow label="Private Key*">
200-
<EuiFieldPassword
201-
type="password"
200+
<EuiTextArea
202201
name="sshPrivateKey"
203202
id="sshPrivateKey"
204203
data-testid="sshPrivateKey"
205204
fullWidth
206205
className="passwordField"
207206
maxLength={50_000}
208207
placeholder="Enter SSH Private Key in PEM format"
209-
value={formik.values.sshPrivateKey === true ? SECURITY_FIELD : formik.values.sshPrivateKey ?? ''}
208+
value={formik.values.sshPrivateKey === true ? SECURITY_FIELD : formik?.values?.sshPrivateKey?.replace(/./g, '*') ?? ''}
210209
onChange={formik.handleChange}
211210
onFocus={() => {
212211
if (formik.values.sshPrivateKey === true) {

redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceFormWrapper.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,10 @@ const InstanceFormWrapper = (props: Props) => {
456456
database.sentinelMaster.password = sentinelMasterPassword
457457
}
458458

459+
const payload = getFormUpdates(database, omit(editedInstance, ['id']))
459460
if (isCloneMode) {
460-
// name need for success message
461-
const payload = getFormUpdates(database, omit(editedInstance, ['id', 'name']))
462461
handleCloneDatabase(payload)
463462
} else {
464-
const payload = getFormUpdates(database, omit(editedInstance, 'id'))
465463
handleEditDatabase(payload)
466464
}
467465
}

redisinsight/ui/src/pages/instance/InstancePage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { EuiResizableContainer } from '@elastic/eui'
22
import React, { useCallback, useEffect, useState } from 'react'
33
import { useDispatch, useSelector } from 'react-redux'
4-
import { useHistory, useParams } from 'react-router-dom'
4+
import { useParams } from 'react-router-dom'
55
import cx from 'classnames'
66

77
import { setInitialAnalyticsSettings } from 'uiSrc/slices/analytics/settings'
@@ -66,7 +66,6 @@ const InstancePage = ({ routes = [] }: Props) => {
6666
const [isShouldChildrenRerender, setIsShouldChildrenRerender] = useState(false)
6767

6868
const dispatch = useDispatch()
69-
const history = useHistory()
7069
const { instanceId: connectionInstanceId } = useParams<{ instanceId: string }>()
7170
const { isShowCli, isShowHelper } = useSelector(cliSettingsSelector)
7271
const { data: modulesData } = useSelector(instancesSelector)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ export function updateInstanceAction({ id, ...payload }: Instance, onSuccess?: (
483483
}
484484

485485
// Asynchronous thunk action
486-
export function cloneInstanceAction({ id, name, ...payload }: Partial<Instance>, onSuccess?: (id?: string) => void) {
486+
export function cloneInstanceAction({ id, ...payload }: Partial<Instance>, onSuccess?: (id?: string) => void) {
487487
return async (dispatch: AppDispatch) => {
488488
dispatch(defaultInstanceChanging())
489489

@@ -494,7 +494,7 @@ export function cloneInstanceAction({ id, name, ...payload }: Partial<Instance>,
494494
dispatch(defaultInstanceChangingSuccess())
495495
dispatch<any>(fetchInstancesAction())
496496

497-
dispatch(addMessageNotification(successMessages.ADDED_NEW_INSTANCE(name ?? '')))
497+
dispatch(addMessageNotification(successMessages.ADDED_NEW_INSTANCE(payload.name ?? '')))
498498
onSuccess?.(id)
499499
}
500500
} catch (_err) {

redisinsight/ui/src/utils/tests/comparisons/diff.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('getDiffKeysOfObjectValues', () => {
1818

1919
const getFormUpdatesTests: any[] = [
2020
[{ name: 'name' }, { name: 'name' }, {}],
21-
[{ name: '' }, { name: 'name' }, { name: '' }],
21+
[{ name: '' }, { name: 'name' }, { name: null }],
2222
[{ name: 'name' }, { name: '' }, { name: 'name' }],
2323
[{ name: 'name', port: 123 }, { name: '', port: 123 }, { name: 'name' }],
2424
[{ name: 'name', port: 123 }, { name: '', port: 1 }, { name: 'name', port: 123 }],

0 commit comments

Comments
 (0)