From 96e4cd397888e3fd35dca277f98e3b33700b0153 Mon Sep 17 00:00:00 2001 From: himanshudube97 Date: Fri, 29 Nov 2024 02:07:43 +0530 Subject: [PATCH 1/2] added the ssl connection switch --- src/components/ConfigInput/ConfigInput.tsx | 40 ++++++++++++++++++- .../Destinations/DestinationForm.tsx | 7 +++- src/components/Destinations/Destinations.tsx | 1 + 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/components/ConfigInput/ConfigInput.tsx b/src/components/ConfigInput/ConfigInput.tsx index ad155dbb..79d2a0c4 100644 --- a/src/components/ConfigInput/ConfigInput.tsx +++ b/src/components/ConfigInput/ConfigInput.tsx @@ -1,4 +1,12 @@ -import { Autocomplete, Box, IconButton, InputAdornment } from '@mui/material'; +import { + Autocomplete, + Box, + FormControlLabel, + IconButton, + InputAdornment, + InputLabel, + Switch, +} from '@mui/material'; import React, { useEffect, useState } from 'react'; import MultiTagInput from '../MultiTagInput'; import { Controller } from 'react-hook-form'; @@ -256,6 +264,36 @@ export const ConfigInput = ({ specs, control, setFormValue, entity }: ConfigInpu /> + ) : spec.type === 'boolean' ? ( + + ( + <> + {`${spec.title}${spec.required ? '*' : ''}`} + } + control={ + { + onChange(event.target.checked); + }} + /> + } + /> + + )} + /> + + ) : ( '' ); diff --git a/src/components/Destinations/DestinationForm.tsx b/src/components/Destinations/DestinationForm.tsx index 80df4b61..a519159e 100644 --- a/src/components/Destinations/DestinationForm.tsx +++ b/src/components/Destinations/DestinationForm.tsx @@ -145,8 +145,13 @@ const DestinationForm = ({ showForm, setShowForm, warehouse, mutate }: Destinati setValue ); } + //removing unwanted boolean fields + const unwantedBooleanFieldsOrder = [11, 12]; + const filteredSpecsConfigFields = specsConfigFields.filter( + (item: any) => !unwantedBooleanFieldsOrder.includes(item.order) + ); - setDestinationDefSpecs(specsConfigFields); + setDestinationDefSpecs(filteredSpecsConfigFields); } catch (err: any) { console.error(err); errorToast(err.message, [], globalContext); diff --git a/src/components/Destinations/Destinations.tsx b/src/components/Destinations/Destinations.tsx index 93c70a82..c18d1f7d 100644 --- a/src/components/Destinations/Destinations.tsx +++ b/src/components/Destinations/Destinations.tsx @@ -109,6 +109,7 @@ export const Destinations = () => { wtype: w_house.wtype, icon: w_house.airbyte_destination.icon, connectionConfiguration: w_house.airbyte_destination.connectionConfiguration, + ssl: w_house.ssl, } as Warehouse); } }, [data]); From 9d0c582d54cfd5cc7355610d8185568a925e4f21 Mon Sep 17 00:00:00 2001 From: himanshudube97 Date: Thu, 5 Dec 2024 02:25:50 +0530 Subject: [PATCH 2/2] fixed the destination form --- src/components/ConfigInput/ConfigInput.tsx | 11 +++++++++-- src/components/Destinations/DestinationForm.tsx | 7 +------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/ConfigInput/ConfigInput.tsx b/src/components/ConfigInput/ConfigInput.tsx index 79d2a0c4..8dd1ed63 100644 --- a/src/components/ConfigInput/ConfigInput.tsx +++ b/src/components/ConfigInput/ConfigInput.tsx @@ -273,10 +273,17 @@ export const ConfigInput = ({ specs, control, setFormValue, entity }: ConfigInpu <> {`${spec.title}${spec.required ? '*' : ''}`} } control={ diff --git a/src/components/Destinations/DestinationForm.tsx b/src/components/Destinations/DestinationForm.tsx index a519159e..80df4b61 100644 --- a/src/components/Destinations/DestinationForm.tsx +++ b/src/components/Destinations/DestinationForm.tsx @@ -145,13 +145,8 @@ const DestinationForm = ({ showForm, setShowForm, warehouse, mutate }: Destinati setValue ); } - //removing unwanted boolean fields - const unwantedBooleanFieldsOrder = [11, 12]; - const filteredSpecsConfigFields = specsConfigFields.filter( - (item: any) => !unwantedBooleanFieldsOrder.includes(item.order) - ); - setDestinationDefSpecs(filteredSpecsConfigFields); + setDestinationDefSpecs(specsConfigFields); } catch (err: any) { console.error(err); errorToast(err.message, [], globalContext);