From 6a4b85dc838eb5f921de7016159495ec5a8410fd Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 11 Dec 2023 12:54:36 +0530 Subject: [PATCH 01/11] feat: default id for connector label --- src/screens/HyperSwitch/APIUtils/APIUtils.res | 14 ++- .../Connectors/ConnectorAccountDetails.res | 2 +- .../ConnectorAccountDetailsHelper.res | 118 +++++++++++++++++- 3 files changed, 127 insertions(+), 7 deletions(-) diff --git a/src/screens/HyperSwitch/APIUtils/APIUtils.res b/src/screens/HyperSwitch/APIUtils/APIUtils.res index 9f16ed28c..f8215bd24 100644 --- a/src/screens/HyperSwitch/APIUtils/APIUtils.res +++ b/src/screens/HyperSwitch/APIUtils/APIUtils.res @@ -257,11 +257,15 @@ let handleLogout = async ( ) => Promise.t, ~setAuthStatus, ) => { - let logoutUrl = getURL(~entityName=USERS, ~methodType=Post, ~userType=#SIGNOUT, ()) - let _ = await fetchApi(logoutUrl, ~method_=Fetch.Post, ()) - setAuthStatus(HyperSwitchAuthTypes.LoggedOut) - LocalStorage.clear() - RescriptReactRouter.push("/register") + try { + let logoutUrl = getURL(~entityName=USERS, ~methodType=Post, ~userType=#SIGNOUT, ()) + let _ = await fetchApi(logoutUrl, ~method_=Fetch.Post, ()) + setAuthStatus(HyperSwitchAuthTypes.LoggedOut) + LocalStorage.clear() + RescriptReactRouter.push("/register") + } catch { + | _ => () + } } let responseHandler = async ( diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res index 05be61eba..7520cb6e1 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res @@ -92,7 +92,7 @@ module BusinessProfileRender = { />
- {"Manage your list of business units"->React.string} + {"Manage your list of profiles."->React.string} { diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 9bbb1c54e..171910730 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -1,3 +1,5 @@ +external formEventToStr: ReactEvent.Form.t => string = "%identity" +external strToFormEvent: Js.String.t => ReactEvent.Form.t = "%identity" let metaDataInputKeysToIgnore = ["google_pay", "apple_pay", "zen_apple_pay"] let getCurrencyOption: CurrencyUtils.currencyCode => SelectBox.dropdownOption = currencyType => { @@ -56,6 +58,63 @@ let inputField = ( (), ) +let inputFieldForConnectorLabel = ( + ~name, + ~field, + ~label, + ~connector: ConnectorTypes.connectorName, + ~getPlaceholder, + ~checkRequiredFields, + ~disabled, +) => { + open MerchantAccountUtils + let businessProfiles = HyperswitchAtom.businessProfilesAtom->Recoil.useRecoilValueFromAtom + let defaultBusinessProfile = businessProfiles->getValueFromBusinessProfile + let arrayOfBusinessProfile = businessProfiles->getArrayOfBusinessProfile + let connectorName = connector->ConnectorUtils.getConnectorNameString + let profileId = + ReactFinalForm.useField(`profile_id`).input.value->LogicUtils.getStringFromJson("") + let profileName = ( + arrayOfBusinessProfile + ->Js.Array2.find((ele: HSwitchSettingTypes.profileEntity) => ele.profile_id === profileId) + ->Belt.Option.getWithDefault(defaultBusinessProfile) + ).profile_name + let connectorLabelOnChange = ReactFinalForm.useField(`connector_label`).input.onChange + + React.useEffect1(() => { + connectorLabelOnChange(`${connectorName}_${profileName}`->strToFormEvent) + None + }, [profileName]) + + FormRenderer.makeFieldInfo( + ~label, + ~isRequired=switch checkRequiredFields { + | Some(fun) => fun(connector, field) + | None => true + }, + ~name, + ~customInput=(~input, ~placeholder as _) => + InputFields.textInput( + ~input={ + ...input, + value: input.value, + onChange: { + ev => { + input.onChange(ev) + } + }, + }, + ~isDisabled=disabled, + ~placeholder=switch getPlaceholder { + | Some(fun) => fun(connector, field, label) + | None => `Enter ${label->LogicUtils.snakeToTitle}` + }, + (), + ), + (), + ) +} + module ErrorValidation = { @react.component let make = (~fieldName, ~validate) => { @@ -142,6 +201,63 @@ module RenderConnectorInputFields = { } } +module RenderConnectorLabel = { + open ConnectorTypes + @react.component + let make = ( + ~connector: connectorName, + ~selectedConnector, + ~details, + ~name, + ~keysToIgnore: array=[], + ~checkRequiredFields=?, + ~getPlaceholder=?, + ~isLabelNested=true, + ~disabled=false, + ) => { + open ConnectorUtils + open LogicUtils + let featureFlagDetails = + HyperswitchAtom.featureFlagAtom + ->Recoil.useRecoilValueFromAtom + ->LogicUtils.safeParse + ->FeatureFlagUtils.featureFlagType + let keys = + details->Js.Dict.keys->Js.Array2.filter(ele => !Js.Array2.includes(keysToIgnore, ele)) + keys + ->Array.mapWithIndex((field, index) => { + let label = details->getString(field, "") + let formName = isLabelNested ? `${name}.${field}` : name + Js.String2.length > 0}> +
string_of_int}> + + +
+
+ }) + ->React.array + } +} + module CurrencyAuthKey = { @react.component let make = (~dict, ~connector, ~selectedConnector: ConnectorTypes.integrationFields) => { @@ -205,7 +321,7 @@ module ConnectorConfigurationFields = { selectedConnector /> }} - Date: Mon, 11 Dec 2023 13:26:12 +0530 Subject: [PATCH 02/11] fix: APIUtils file removal --- src/screens/HyperSwitch/APIUtils/APIUtils.res | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/screens/HyperSwitch/APIUtils/APIUtils.res b/src/screens/HyperSwitch/APIUtils/APIUtils.res index f8215bd24..9f16ed28c 100644 --- a/src/screens/HyperSwitch/APIUtils/APIUtils.res +++ b/src/screens/HyperSwitch/APIUtils/APIUtils.res @@ -257,15 +257,11 @@ let handleLogout = async ( ) => Promise.t, ~setAuthStatus, ) => { - try { - let logoutUrl = getURL(~entityName=USERS, ~methodType=Post, ~userType=#SIGNOUT, ()) - let _ = await fetchApi(logoutUrl, ~method_=Fetch.Post, ()) - setAuthStatus(HyperSwitchAuthTypes.LoggedOut) - LocalStorage.clear() - RescriptReactRouter.push("/register") - } catch { - | _ => () - } + let logoutUrl = getURL(~entityName=USERS, ~methodType=Post, ~userType=#SIGNOUT, ()) + let _ = await fetchApi(logoutUrl, ~method_=Fetch.Post, ()) + setAuthStatus(HyperSwitchAuthTypes.LoggedOut) + LocalStorage.clear() + RescriptReactRouter.push("/register") } let responseHandler = async ( From bb6f2129a02d4b93d495e7e06b6b4affcc71bf99 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 11 Dec 2023 13:32:42 +0530 Subject: [PATCH 03/11] fix: label added as a key --- .../Connectors/ConnectorAccountDetailsHelper.res | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 171910730..7013ae3ad 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -163,11 +163,11 @@ module RenderConnectorInputFields = { let keys = details->Js.Dict.keys->Js.Array2.filter(ele => !Js.Array2.includes(keysToIgnore, ele)) keys - ->Array.mapWithIndex((field, index) => { + ->Array.map(field => { let label = details->getString(field, "") let formName = isLabelNested ? `${name}.${field}` : name Js.String2.length > 0}> -
string_of_int}> +
Js.Dict.keys->Js.Array2.filter(ele => !Js.Array2.includes(keysToIgnore, ele)) keys - ->Array.mapWithIndex((field, index) => { + ->Array.map(field => { let label = details->getString(field, "") let formName = isLabelNested ? `${name}.${field}` : name Js.String2.length > 0}> -
string_of_int}> +
Date: Mon, 11 Dec 2023 15:06:25 +0530 Subject: [PATCH 04/11] feat: Description Added for Connector Label --- public/hyperswitch/icons/solid.svg | 18 ++++++++++++------ src/components/tooltip/ToolTip.res | 2 +- .../ConnectorAccountDetailsHelper.res | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/public/hyperswitch/icons/solid.svg b/public/hyperswitch/icons/solid.svg index 6920b90d2..2b94683ec 100644 --- a/public/hyperswitch/icons/solid.svg +++ b/public/hyperswitch/icons/solid.svg @@ -4116,7 +4116,8 @@ License) + fill="#354052" + > + + + + - + - =?, ~customStyle="", diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 7013ae3ad..462554a9f 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -93,6 +93,8 @@ let inputFieldForConnectorLabel = ( | None => true }, ~name, + ~description="This is an unique label you can generate and pass in order to identify this connector account on your Hyperswitch dashboard and reports. Eg: if your profile label is 'default', connector label can be 'stripe_default'", + ~toolTipPosition=Right, ~customInput=(~input, ~placeholder as _) => InputFields.textInput( ~input={ From a1b26b10c01aed5907d941128b4b4aee1a72118c Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 11 Dec 2023 15:41:36 +0530 Subject: [PATCH 05/11] fix: ConnectorLabel Initial Values added undefined --- .../HyperSwitch/Connectors/ConnectorAccountDetails.res | 6 +++++- .../Connectors/ConnectorAccountDetailsHelper.res | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res index 7520cb6e1..4e30b85de 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res @@ -279,12 +279,16 @@ let make = ( let (showModal, setShowModal) = React.useState(_ => false) let updatedInitialVal = React.useMemo1(() => { + let initialValuesToDict = initialValues->LogicUtils.getDictFromJsonObject + initialValuesToDict->Js.Dict.set( + "connector_label", + `${connector}_${activeBusinessProfile.profile_name}`->Js.Json.string, + ) if ( connector ->getConnectorNameTypeFromString ->checkIsDummyConnector(featureFlagDetails.testProcessors) && !isUpdateFlow ) { - let initialValuesToDict = initialValues->LogicUtils.getDictFromJsonObject let apiKeyDict = [("api_key", "test_key"->Js.Json.string)]->Js.Dict.fromArray initialValuesToDict->Js.Dict.set("connector_account_details", apiKeyDict->Js.Json.object_) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 462554a9f..91de59ed2 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -84,7 +84,7 @@ let inputFieldForConnectorLabel = ( React.useEffect1(() => { connectorLabelOnChange(`${connectorName}_${profileName}`->strToFormEvent) None - }, [profileName]) + }, [profileId]) FormRenderer.makeFieldInfo( ~label, From 1e14e92a3e03ce23e6ba378a208b296f293f3e4b Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 11 Dec 2023 16:56:18 +0530 Subject: [PATCH 06/11] fix: onChange move from ConnectorLabel to ProfileId change --- .../Connectors/ConnectorAccountDetails.res | 22 ++++++++++++++----- .../ConnectorAccountDetailsHelper.res | 19 ---------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res index 4e30b85de..94db59847 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res @@ -1,5 +1,6 @@ external formEventToBool: ReactEvent.Form.t => bool = "%identity" external formEventToStr: ReactEvent.Form.t => string = "%identity" +external strToFormEvent: Js.String.t => ReactEvent.Form.t = "%identity" let connectorsWithIntegrationSteps: array = [ ADYEN, @@ -33,8 +34,9 @@ module BusinessProfileRender = { let hyperswitchMixPanel = HSMixPanel.useSendEvent() let {setDashboardPageState} = React.useContext(GlobalProvider.defaultContext) let businessProfiles = Recoil.useRecoilValueFromAtom(HyperswitchAtom.businessProfilesAtom) - let arrayOfBusinessProfile = businessProfiles->MerchantAccountUtils.getArrayOfBusinessProfile + let defaultBusinessProfile = businessProfiles->MerchantAccountUtils.getValueFromBusinessProfile + let connectorLabelOnChange = ReactFinalForm.useField(`connector_label`).input.onChange let (showModalFromOtherScreen, setShowModalFromOtherScreen) = React.useState(_ => false) @@ -67,6 +69,14 @@ module BusinessProfileRender = { ...input, onChange: { ev => { + let profileName = ( + arrayOfBusinessProfile + ->Js.Array2.find((ele: HSwitchSettingTypes.profileEntity) => + ele.profile_id === ev->formEventToStr + ) + ->Belt.Option.getWithDefault(defaultBusinessProfile) + ).profile_name + connectorLabelOnChange(`${selectedConnector}_${profileName}`->strToFormEvent) input.onChange(ev) mixpanelEventWrapper( ~url, @@ -280,10 +290,12 @@ let make = ( let updatedInitialVal = React.useMemo1(() => { let initialValuesToDict = initialValues->LogicUtils.getDictFromJsonObject - initialValuesToDict->Js.Dict.set( - "connector_label", - `${connector}_${activeBusinessProfile.profile_name}`->Js.Json.string, - ) + if !isUpdateFlow { + initialValuesToDict->Js.Dict.set( + "connector_label", + `${connector}_${activeBusinessProfile.profile_name}`->Js.Json.string, + ) + } if ( connector ->getConnectorNameTypeFromString diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 91de59ed2..1543bd51e 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -67,25 +67,6 @@ let inputFieldForConnectorLabel = ( ~checkRequiredFields, ~disabled, ) => { - open MerchantAccountUtils - let businessProfiles = HyperswitchAtom.businessProfilesAtom->Recoil.useRecoilValueFromAtom - let defaultBusinessProfile = businessProfiles->getValueFromBusinessProfile - let arrayOfBusinessProfile = businessProfiles->getArrayOfBusinessProfile - let connectorName = connector->ConnectorUtils.getConnectorNameString - let profileId = - ReactFinalForm.useField(`profile_id`).input.value->LogicUtils.getStringFromJson("") - let profileName = ( - arrayOfBusinessProfile - ->Js.Array2.find((ele: HSwitchSettingTypes.profileEntity) => ele.profile_id === profileId) - ->Belt.Option.getWithDefault(defaultBusinessProfile) - ).profile_name - let connectorLabelOnChange = ReactFinalForm.useField(`connector_label`).input.onChange - - React.useEffect1(() => { - connectorLabelOnChange(`${connectorName}_${profileName}`->strToFormEvent) - None - }, [profileId]) - FormRenderer.makeFieldInfo( ~label, ~isRequired=switch checkRequiredFields { From 9cc341b6391215a1648a8f408754c9ea46333dad Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 11 Dec 2023 16:59:49 +0530 Subject: [PATCH 07/11] fix: build fix --- .../Connectors/ConnectorAccountDetailsHelper.res | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index b1eb2e2ab..276e2187f 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -196,11 +196,7 @@ module RenderConnectorLabel = { ) => { open ConnectorUtils open LogicUtils - let featureFlagDetails = - HyperswitchAtom.featureFlagAtom - ->Recoil.useRecoilValueFromAtom - ->LogicUtils.safeParse - ->FeatureFlagUtils.featureFlagType + let featureFlagDetails = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let keys = details->Js.Dict.keys->Js.Array2.filter(ele => !Js.Array2.includes(keysToIgnore, ele)) keys From 0c80946e2e3d17d6e20eaf5ad5a1583022343a93 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 11 Dec 2023 17:13:58 +0530 Subject: [PATCH 08/11] fix: Connector Label label Added in LoadedTable for ConnectorList --- src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res b/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res index 21a26b2a2..aeb416188 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res @@ -185,7 +185,7 @@ let getHeading = colType => { | ProfileName => Table.makeHeaderInfo(~key="profile_name", ~title="Profile Name", ~showSort=false, ()) | ConnectorLabel => - Table.makeHeaderInfo(~key="connector_label", ~title="Label", ~showSort=false, ()) + Table.makeHeaderInfo(~key="connector_label", ~title="Connector Label", ~showSort=false, ()) | PaymentMethods => Table.makeHeaderInfo(~key="payment_methods", ~title="Payment Methods", ~showSort=false, ()) } From 154054d6a9130c5c584ab3d0a14c404e03d48bba Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Mon, 11 Dec 2023 20:09:59 +0530 Subject: [PATCH 09/11] refactor: removed unnecessary code --- .../HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 276e2187f..d0ac9c000 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -1,5 +1,3 @@ -external formEventToStr: ReactEvent.Form.t => string = "%identity" -external strToFormEvent: Js.String.t => ReactEvent.Form.t = "%identity" let metaDataInputKeysToIgnore = ["google_pay", "apple_pay", "zen_apple_pay"] let getCurrencyOption: CurrencyUtils.currencyCode => SelectBox.dropdownOption = currencyType => { From 9e681320f9a84f03751345a08b2863e67989233d Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Tue, 12 Dec 2023 12:45:03 +0530 Subject: [PATCH 10/11] refactor: Comments Addressed --- .../ConnectorAccountDetailsHelper.res | 48 +++---------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index d0ac9c000..93c63749e 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -39,11 +39,15 @@ let inputField = ( ~getPlaceholder, ~checkRequiredFields, ~disabled, + ~description="", + ~toolTipPosition: ToolTip.toolTipPosition=ToolTip.Right, (), ) => FormRenderer.makeFieldInfo( ~label, ~name, + ~description, + ~toolTipPosition, ~customInput=InputFields.textInput(~isDisabled=disabled, ()), ~placeholder=switch getPlaceholder { | Some(fun) => fun(connector, field, label) @@ -56,46 +60,6 @@ let inputField = ( (), ) -let inputFieldForConnectorLabel = ( - ~name, - ~field, - ~label, - ~connector: ConnectorTypes.connectorName, - ~getPlaceholder, - ~checkRequiredFields, - ~disabled, -) => { - FormRenderer.makeFieldInfo( - ~label, - ~isRequired=switch checkRequiredFields { - | Some(fun) => fun(connector, field) - | None => true - }, - ~name, - ~description="This is an unique label you can generate and pass in order to identify this connector account on your Hyperswitch dashboard and reports. Eg: if your profile label is 'default', connector label can be 'stripe_default'", - ~toolTipPosition=Right, - ~customInput=(~input, ~placeholder as _) => - InputFields.textInput( - ~input={ - ...input, - value: input.value, - onChange: { - ev => { - input.onChange(ev) - } - }, - }, - ~isDisabled=disabled, - ~placeholder=switch getPlaceholder { - | Some(fun) => fun(connector, field, label) - | None => `Enter ${label->LogicUtils.snakeToTitle}` - }, - (), - ), - (), - ) -} - module ErrorValidation = { @react.component let make = (~fieldName, ~validate) => { @@ -205,7 +169,7 @@ module RenderConnectorLabel = {
Date: Tue, 12 Dec 2023 14:25:28 +0530 Subject: [PATCH 11/11] fix: comments addressed --- .../ConnectorAccountDetailsHelper.res | 60 ++----------------- 1 file changed, 4 insertions(+), 56 deletions(-) diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res index 93c63749e..d5684ede0 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetailsHelper.res @@ -97,6 +97,7 @@ module RenderConnectorInputFields = { ~getPlaceholder=?, ~isLabelNested=true, ~disabled=false, + ~description="", ) => { let featureFlagDetails = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom open ConnectorUtils @@ -122,6 +123,7 @@ module RenderConnectorInputFields = { ~checkRequiredFields, ~getPlaceholder, ~disabled, + ~description, (), ) }} @@ -142,61 +144,6 @@ module RenderConnectorInputFields = { } } -module RenderConnectorLabel = { - open ConnectorTypes - @react.component - let make = ( - ~connector: connectorName, - ~selectedConnector, - ~details, - ~name, - ~keysToIgnore: array=[], - ~checkRequiredFields=?, - ~getPlaceholder=?, - ~isLabelNested=true, - ~disabled=false, - ) => { - open ConnectorUtils - open LogicUtils - let featureFlagDetails = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom - let keys = - details->Js.Dict.keys->Js.Array2.filter(ele => !Js.Array2.includes(keysToIgnore, ele)) - keys - ->Array.map(field => { - let label = details->getString(field, "") - let formName = isLabelNested ? `${name}.${field}` : name - Js.String2.length > 0}> -
- - -
-
- }) - ->React.array - } -} - module CurrencyAuthKey = { @react.component let make = (~dict, ~connector, ~selectedConnector: ConnectorTypes.integrationFields) => { @@ -260,7 +207,7 @@ module ConnectorConfigurationFields = { selectedConnector /> }} -