diff --git a/public/hyperswitch/icons/solid.svg b/public/hyperswitch/icons/solid.svg index 7c73d26b4..74489e91d 100644 --- a/public/hyperswitch/icons/solid.svg +++ b/public/hyperswitch/icons/solid.svg @@ -4754,6 +4754,14 @@ License) d="M298.028 214.267L285.793 96H328c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24H56C42.745 0 32 10.745 32 24v48c0 13.255 10.745 24 24 24h42.207L85.972 214.267C37.465 236.82 0 277.261 0 328c0 13.255 10.745 24 24 24h136v104.007c0 1.242.289 2.467.845 3.578l24 48c2.941 5.882 11.364 5.893 14.311 0l24-48a8.008 8.008 0 0 0 .845-3.578V352h136c13.255 0 24-10.745 24-24-.001-51.183-37.983-91.42-85.973-113.733z" > + + + + =?, ~customStyle="", diff --git a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res index 52b924357..1e98197ca 100644 --- a/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res +++ b/src/screens/HyperSwitch/Connectors/ConnectorAccountDetails.res @@ -30,8 +30,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) @@ -64,6 +65,16 @@ module BusinessProfileRender = { ...input, onChange: { ev => { + let profileName = ( + arrayOfBusinessProfile + ->Js.Array2.find((ele: HSwitchSettingTypes.profileEntity) => + ele.profile_id === ev->Identity.formReactEventToString + ) + ->Belt.Option.getWithDefault(defaultBusinessProfile) + ).profile_name + connectorLabelOnChange( + `${selectedConnector}_${profileName}`->Identity.stringToFormReactEvent, + ) input.onChange(ev) mixpanelEventWrapper( ~url, @@ -89,7 +100,7 @@ module BusinessProfileRender = { />
- {"Manage your list of business units"->React.string} + {"Manage your list of profiles."->React.string} { @@ -272,12 +283,18 @@ let make = ( let (showModal, setShowModal) = React.useState(_ => false) let updatedInitialVal = React.useMemo1(() => { + let initialValuesToDict = initialValues->LogicUtils.getDictFromJsonObject + if !isUpdateFlow { + 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 d334e81cb..d5684ede0 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) @@ -93,6 +97,7 @@ module RenderConnectorInputFields = { ~getPlaceholder=?, ~isLabelNested=true, ~disabled=false, + ~description="", ) => { let featureFlagDetails = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom open ConnectorUtils @@ -100,11 +105,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}> +
{ | 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, ()) }