+
{switch url.path {
| list{"home"} =>
diff --git a/src/screens/HyperSwitch/APIUtils/APIUtils.res b/src/screens/HyperSwitch/APIUtils/APIUtils.res
index 2d47f74cb..d1a054d73 100644
--- a/src/screens/HyperSwitch/APIUtils/APIUtils.res
+++ b/src/screens/HyperSwitch/APIUtils/APIUtils.res
@@ -234,7 +234,7 @@ let getURL = (
let sessionExpired = ref(false)
let handleLogout = async (
- ~fetchApi: (
+ ~fetchApi as _: (
Js.String2.t,
~bodyStr: string=?,
~headers: Js.Dict.t=?,
@@ -248,10 +248,12 @@ let handleLogout = async (
unit,
) => Promise.t,
~setAuthStatus,
+ ~setIsSidebarExpanded,
) => {
- let logoutUrl = getURL(~entityName=USERS, ~methodType=Post, ~userType=#SIGNOUT, ())
- let _ = await fetchApi(logoutUrl, ~method_=Fetch.Post, ())
+ // let logoutUrl = getURL(~entityName=USERS, ~methodType=Post, ~userType=#SIGNOUT, ())
+ // let _ = await fetchApi(logoutUrl, ~method_=Fetch.Post, ())
setAuthStatus(HyperSwitchAuthTypes.LoggedOut)
+ setIsSidebarExpanded(_ => false)
LocalStorage.clear()
RescriptReactRouter.push("/register")
}
@@ -376,6 +378,7 @@ let useGetMethod = (~showErrorToast=true, ()) => {
let showToast = ToastState.useShowToast()
let showPopUp = PopUpState.useShowPopUp()
let (_authStatus, setAuthStatus) = React.useContext(AuthInfoProvider.authStatusContext)
+ let {setIsSidebarExpanded} = React.useContext(SidebarProvider.defaultContext)
let isPlayground = HSLocalStorage.getIsPlaygroundFromLocalStorage()
let url = RescriptReactRouter.useUrl()
let urlPath = url.path->Belt.List.toArray->Js.Array2.joinWith("_")
@@ -393,7 +396,7 @@ let useGetMethod = (~showErrorToast=true, ()) => {
_ => {
hyperswitchMixPanel(~eventName=Some(`${urlPath}_tryplayground_register`), ())
hyperswitchMixPanel(~eventName=Some(`global_tryplayground_register`), ())
- let _ = handleLogout(~fetchApi, ~setAuthStatus)
+ let _ = handleLogout(~fetchApi, ~setAuthStatus, ~setIsSidebarExpanded)
}
},
},
@@ -440,6 +443,7 @@ let useUpdateMethod = (~showErrorToast=true, ()) => {
let isPlayground = HSLocalStorage.getIsPlaygroundFromLocalStorage()
let url = RescriptReactRouter.useUrl()
let urlPath = url.path->Belt.List.toArray->Js.Array2.joinWith("_")
+ let {setIsSidebarExpanded} = React.useContext(SidebarProvider.defaultContext)
let popUpCallBack = () =>
showPopUp({
@@ -454,7 +458,7 @@ let useUpdateMethod = (~showErrorToast=true, ()) => {
_ => {
hyperswitchMixPanel(~eventName=Some(`${urlPath}_tryplayground_register`), ())
hyperswitchMixPanel(~eventName=Some(`global_tryplayground_register`), ())
- let _ = handleLogout(~fetchApi, ~setAuthStatus)
+ let _ = handleLogout(~fetchApi, ~setAuthStatus, ~setIsSidebarExpanded)
}
},
},
diff --git a/src/screens/HyperSwitch/Connectors/ConnectPayPalFlow/ConnectPayPal.res b/src/screens/HyperSwitch/Connectors/ConnectPayPalFlow/ConnectPayPal.res
index eec2742ee..2b8750a9b 100644
--- a/src/screens/HyperSwitch/Connectors/ConnectPayPalFlow/ConnectPayPal.res
+++ b/src/screens/HyperSwitch/Connectors/ConnectPayPalFlow/ConnectPayPal.res
@@ -474,7 +474,7 @@ let make = (
-
- = [
+ ADYEN,
+ CHECKOUT,
+ STRIPE,
+ PAYPAL,
+]
+
let getCurrencyOption: CurrencyUtils.currencyCode => SelectBox.dropdownOption = currencyType => {
open CurrencyUtils
{
@@ -330,7 +337,7 @@ module BusinessProfileRender = {
}
}
-module VerifyConnectoModal = {
+module VerifyConnectorModal = {
@react.component
let make = (
~showVerifyModal,
@@ -408,13 +415,6 @@ module VerifyConnectoModal = {
}
}
-let connectorsWithIntegrationSteps: array = [
- ADYEN,
- CHECKOUT,
- STRIPE,
- PAYPAL,
-]
-
// Wraps the component with Connector Icon + ConnectorName + InetgrationSteps
module ConnectorHeaderWrapper = {
@react.component
diff --git a/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res b/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res
index 6c6670bad..1e910e50e 100644
--- a/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res
+++ b/src/screens/HyperSwitch/Connectors/ConnectorTableUtils.res
@@ -1,7 +1,15 @@
open ConnectorTypes
type colType =
- Name | TestMode | Status | Actions | ProfileId | ProfileName | ConnectorLabel | PaymentMethods
+ | Name
+ | TestMode
+ | Status
+ | Disabled
+ | Actions
+ | ProfileId
+ | ProfileName
+ | ConnectorLabel
+ | PaymentMethods
let defaultColumns = [
Name,
@@ -9,6 +17,7 @@ let defaultColumns = [
ProfileName,
ConnectorLabel,
Status,
+ Disabled,
TestMode,
Actions,
PaymentMethods,
@@ -152,7 +161,8 @@ let getHeading = colType => {
switch colType {
| Name => Table.makeHeaderInfo(~key="connector_name", ~title="Processor", ~showSort=false, ())
| TestMode => Table.makeHeaderInfo(~key="test_mode", ~title="Test Mode", ~showSort=false, ())
- | Status => Table.makeHeaderInfo(~key="disabled", ~title="Status", ~showSort=false, ())
+ | Status => Table.makeHeaderInfo(~key="status", ~title="Status", ~showSort=false, ())
+ | Disabled => Table.makeHeaderInfo(~key="disabled", ~title="Disabled", ~showSort=false, ())
| Actions => Table.makeHeaderInfo(~key="actions", ~title="", ~showSort=false, ())
| ProfileId => Table.makeHeaderInfo(~key="profile_id", ~title="Profile Id", ~showSort=false, ())
| ProfileName =>
@@ -168,10 +178,11 @@ let getCell = (connector: connectorPayload, colType): Table.cell => {
switch colType {
| Name => Text(connector.connector_name->LogicUtils.getTitle)
| TestMode => Text(connector.test_mode ? "True" : "False")
+ | Disabled => Text(connector.disabled ? "True" : "False")
| Status =>
Label({
- title: (connector.disabled ? "Disabled" : "Enabled")->Js.String2.toUpperCase,
- color: connector.disabled ? LabelRed : LabelGreen,
+ title: connector.status->Js.String2.toUpperCase,
+ color: connector.status === "inactive" ? LabelRed : LabelGreen,
})
| ProfileId => Text(connector.profile_id)
| ProfileName =>
diff --git a/src/screens/HyperSwitch/Home/HomeUtils.res b/src/screens/HyperSwitch/Home/HomeUtils.res
index cf816991c..7eda29b8c 100644
--- a/src/screens/HyperSwitch/Home/HomeUtils.res
+++ b/src/screens/HyperSwitch/Home/HomeUtils.res
@@ -169,6 +169,7 @@ module CheckoutCard = {
let showPopUp = PopUpState.useShowPopUp()
let hyperswitchMixPanel = HSMixPanel.useSendEvent()
let (_authStatus, setAuthStatus) = React.useContext(AuthInfoProvider.authStatusContext)
+ let {setIsSidebarExpanded} = React.useContext(SidebarProvider.defaultContext)
let isPlayground = HSLocalStorage.getIsPlaygroundFromLocalStorage()
let isConfigureConnector = ListHooks.useListCount(~entityName=CONNECTOR) > 0
let urlPath = url.path->Belt.List.toArray->Js.Array2.joinWith("_")
@@ -187,7 +188,7 @@ module CheckoutCard = {
_ => {
hyperswitchMixPanel(~eventName=Some(`${urlPath}_tryplayground_register`), ())
hyperswitchMixPanel(~eventName=Some(`global_tryplayground_register`), ())
- let _ = APIUtils.handleLogout(~fetchApi, ~setAuthStatus)
+ let _ = APIUtils.handleLogout(~fetchApi, ~setAuthStatus, ~setIsSidebarExpanded)
}
},
},
diff --git a/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res b/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res
index 31f8ce1d6..0a4f96c16 100644
--- a/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res
+++ b/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res
@@ -283,11 +283,40 @@ let metaInput = (id, keyType) =>
module FieldInp = {
@react.component
- let make = (~ops, ~prefix, ~onChangeMethod) => {
+ let make = (~methodKeys, ~prefix, ~onChangeMethod) => {
let field = ReactFinalForm.useField(`${prefix}.lhs`).input
let op = ReactFinalForm.useField(`${prefix}.comparison`).input
let val = ReactFinalForm.useField(`${prefix}.value.value`).input
+ let convertedValue = React.useMemo0(() => {
+ let keyDescriptionMapper = Window.getDescriptionCategory()->MapTypes.changeType
+ keyDescriptionMapper->LogicUtils.convertMapObjectToDict
+ })
+
+ let options = React.useMemo0(() =>
+ convertedValue->Js.Dict.keys->Js.Array2.reduce((acc, ele) => {
+ open LogicUtils
+ convertedValue
+ ->getArrayFromDict(ele, [])
+ ->Js.Array2.forEach(
+ value => {
+ let dictValue = value->LogicUtils.getDictFromJsonObject
+ let kindValue = dictValue->getString("kind", "")
+ if methodKeys->Js.Array2.includes(kindValue) {
+ let generatedSelectBoxOptionType: SelectBox.dropdownOption = {
+ label: kindValue,
+ value: kindValue,
+ description: dictValue->getString("description", ""),
+ optGroup: ele,
+ }
+ acc->Js.Array2.push(generatedSelectBoxOptionType)->ignore
+ }
+ },
+ )
+ acc
+ }, [])
+ )
+
let input: ReactFinalForm.fieldRenderPropsInput = {
name: "string",
onBlur: _ev => (),
@@ -303,10 +332,6 @@ module FieldInp = {
checked: true,
}
- let options = ops->Js.Array2.map((op): SelectBox.dropdownOption => {
- {value: op, label: op}
- })
-
@@ -358,7 +383,7 @@ module RuleFieldBase = {
-
+
diff --git a/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res b/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res
index 53a8e51a1..7b0ef1482 100644
--- a/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res
+++ b/src/screens/HyperSwitch/SelfServe/HSwitchProdOnboarding/SetupConnectorCredentials.res
@@ -80,7 +80,7 @@ module ConnectorDetailsForm = {
/>
>
}}
- {
{getComponentToRender()}