From e0e551f10145f9772eb391e11d43b7b1b5e3cf3a Mon Sep 17 00:00:00 2001 From: Roman Sergeenko Date: Tue, 10 Dec 2024 17:10:33 +0100 Subject: [PATCH] #RI-6417 - fix values for the form --- redisinsight/ui/src/pages/home/HomePage.tsx | 5 ++--- .../components/database-panel-dialog/DatabasePanelDialog.tsx | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/redisinsight/ui/src/pages/home/HomePage.tsx b/redisinsight/ui/src/pages/home/HomePage.tsx index 3ed9e4cc79..2bd6150ad4 100644 --- a/redisinsight/ui/src/pages/home/HomePage.tsx +++ b/redisinsight/ui/src/pages/home/HomePage.tsx @@ -32,7 +32,7 @@ import { import { sendEventTelemetry, sendPageViewTelemetry, TelemetryEvent, TelemetryPageView } from 'uiSrc/telemetry' import { appRedirectionSelector, setUrlHandlingInitialState } from 'uiSrc/slices/app/url-handling' import { UrlHandlingActions } from 'uiSrc/slices/interfaces/urlHandling' -import { AddDbType, CREATE_CLOUD_DB_ID } from 'uiSrc/pages/home/constants' +import { CREATE_CLOUD_DB_ID } from 'uiSrc/pages/home/constants' import { appFeatureFlagsFeaturesSelector } from 'uiSrc/slices/app/features' import DatabasesList from './components/database-list-component' @@ -174,7 +174,7 @@ const HomePage = () => { }) } - const handleAddInstance = (addDbType = AddDbType.manual) => { + const handleAddInstance = () => { setOpenDialog(OpenDialogName.AddDatabase) dispatch(setEditedInstance(null)) } @@ -212,7 +212,6 @@ const HomePage = () => { - initialValues?: Nullable> editedInstance: Nullable onClose: () => void onDbEdited?: () => void @@ -40,10 +39,9 @@ const DatabasePanelDialog = (props: Props) => { const { editMode, onClose, - initialValues: initialValuesProp, } = props - const [initialValues, setInitialValues] = useState(initialValuesProp) + const [initialValues, setInitialValues] = useState(null) const [connectionType, setConnectionType] = useState>(null) const [modalHeader, setModalHeader] = useState>(null) @@ -72,6 +70,7 @@ const DatabasePanelDialog = (props: Props) => { useEffect(() => { if (action === UrlHandlingActions.Connect) { setConnectionType(AddDbType.manual) + setInitialValues(dbConnection) } }, [action, dbConnection])