From dc0677c99d9f37439eccc481a2368f8f5815676c Mon Sep 17 00:00:00 2001 From: Zalenski Egor <63463140+zalenskiSofteq@users.noreply.github.com> Date: Thu, 20 Apr 2023 18:29:54 +0800 Subject: [PATCH 1/2] #RI-4119 - SNI not saved for connections --- .../AddInstanceForm/InstanceForm/InstanceForm.tsx | 3 ++- .../home/components/AddInstanceForm/InstanceFormWrapper.tsx | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/InstanceForm.tsx b/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/InstanceForm.tsx index 2d669a8d2a..6484a77900 100644 --- a/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/InstanceForm.tsx +++ b/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/InstanceForm.tsx @@ -128,7 +128,7 @@ const AddStandaloneForm = (props: Props) => { provider, ssh, sshPassType = SshPassType.Password, - sshOptions + sshOptions, }, initialValues: initialValuesProp, width, @@ -162,6 +162,7 @@ const AddStandaloneForm = (props: Props) => { showDb: !!db, showCompressor: compressor !== NONE, sni: !!servername, + servername, newCaCert: '', newCaCertName: '', selectedCaCertName, diff --git a/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceFormWrapper.tsx b/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceFormWrapper.tsx index 22eb04e73f..1889fc8b11 100644 --- a/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceFormWrapper.tsx +++ b/redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceFormWrapper.tsx @@ -68,6 +68,7 @@ const getInitialValues = (editedInstance: Nullable) => ({ : (editedInstance ? '' : undefined), tls: !!editedInstance?.tls ?? false, ssh: !!editedInstance?.ssh ?? false, + servername: editedInstance?.tlsServername, sshPassType: editedInstance?.sshOptions ? (editedInstance.sshOptions.privateKey ? SshPassType.PrivateKey : SshPassType.Password) : SshPassType.Password @@ -87,7 +88,7 @@ const InstanceFormWrapper = (props: Props) => { const [initialValues, setInitialValues] = useState(getInitialValues(editedInstance)) const [isCloneMode, setIsCloneMode] = useState(false) - const { host, port, name, username, password, timeout, tls, ssh, sshPassType } = initialValues + const { host, port, name, username, password, timeout, tls, ssh, sshPassType, servername } = initialValues const { loadingChanging: loadingStandalone } = useSelector(instancesSelector) const { loading: loadingSentinel } = useSelector(sentinelSelector) @@ -541,7 +542,8 @@ const InstanceFormWrapper = (props: Props) => { sentinelMasterUsername, sentinelMasterPassword, ssh, - sshPassType + sshPassType, + servername, } const getSubmitButtonText = () => { From edb07d0fae64b28d26c5300eca27aeb29f842c91 Mon Sep 17 00:00:00 2001 From: Zalenski Egor <63463140+zalenskiSofteq@users.noreply.github.com> Date: Thu, 20 Apr 2023 18:48:23 +0800 Subject: [PATCH 2/2] #RI-4119 - fix tests --- .../ui/src/pages/browser/components/key-list/KeyList.spec.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redisinsight/ui/src/pages/browser/components/key-list/KeyList.spec.tsx b/redisinsight/ui/src/pages/browser/components/key-list/KeyList.spec.tsx index c09cfc41ce..598131120b 100644 --- a/redisinsight/ui/src/pages/browser/components/key-list/KeyList.spec.tsx +++ b/redisinsight/ui/src/pages/browser/components/key-list/KeyList.spec.tsx @@ -3,7 +3,7 @@ import { cloneDeep } from 'lodash' import { fireEvent } from '@testing-library/react' import { cleanup, mockedStore, render, waitFor, screen, clearStoreActions } from 'uiSrc/utils/test-utils' import { KeysStoreData, KeyViewType, SearchMode } from 'uiSrc/slices/interfaces/keys' -import { deleteSelectedKey, keysSelector, setLastBatchKeys } from 'uiSrc/slices/browser/keys' +import { deleteKey, keysSelector, setLastBatchKeys } from 'uiSrc/slices/browser/keys' import { apiService } from 'uiSrc/services' import KeyList from './KeyList' @@ -196,7 +196,7 @@ describe('KeyList', () => { fireEvent.click(screen.getByTestId('submit-delete-key')) const expectedActions = [ - deleteSelectedKey() + deleteKey() ] expect(clearStoreActions(store.getActions().slice(-1))).toEqual(clearStoreActions(expectedActions)) })