From fd585ab587e3af81bbf331c8290f61df2685759b Mon Sep 17 00:00:00 2001 From: xyfer17 Date: Sat, 26 Oct 2024 22:34:19 +0530 Subject: [PATCH 01/48] fix(CE): form-data loss on navigation --- ui/src/components/ExitModal/ExitModal.tsx | 9 ++- .../JSONSchemaForm/JSONSchemaForm.tsx | 37 ++++++++++- ui/src/stores/useConnectorFormStore.ts | 61 +++++++++++++++++++ .../ConnectorConfigForm.tsx | 2 + .../EditDestinations/EditDestinations.tsx | 1 + .../Sources/EditSource/EditSource.tsx | 1 + 6 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 ui/src/stores/useConnectorFormStore.ts diff --git a/ui/src/components/ExitModal/ExitModal.tsx b/ui/src/components/ExitModal/ExitModal.tsx index 1b756eee..31ae93d1 100644 --- a/ui/src/components/ExitModal/ExitModal.tsx +++ b/ui/src/components/ExitModal/ExitModal.tsx @@ -14,11 +14,18 @@ import { } from '@chakra-ui/react'; import { useNavigate } from 'react-router-dom'; import ExitWarningImage from '@/assets/images/ExitWarning.png'; +import useConnectorFormStore from '@/stores/useConnectorFormStore'; const ExitModal = (): JSX.Element => { const { isOpen, onOpen, onClose } = useDisclosure(); + const { resetAllFormData } = useConnectorFormStore(); const navigate = useNavigate(); + const handleSetupExit = () => { + resetAllFormData(); + navigate('*'); + }; + return ( <>