= "%identity"
-external asJson: 'a => ReactEvent.Form.t = "%identity"
module RadioSection = {
open ConnectorTypes
@@ -26,7 +25,7 @@ module RadioSection = {
| ActionType => paymentMethodTypeInfo.action = option
}
- setConfigJson(frmConfigs->asJson)
+ setConfigJson(frmConfigs->Identity.anyTypeToReactEvent)
}
@@ -147,7 +146,7 @@ module CheckBoxRenderer = {
_ => {
frmConfigInfo.payment_methods = []
setIsOpen(_ => !isOpen)
- setConfigJson(frmConfigs->asJson)
+ setConfigJson(frmConfigs->Identity.anyTypeToReactEvent)
}
},
},
@@ -166,7 +165,7 @@ module CheckBoxRenderer = {
switch connectorPaymentMethods {
| Some(paymentMethods) => {
frmConfigInfo.payment_methods = paymentMethods->generateFRMPaymentMethodsConfig
- setConfigJson(frmConfigs->asJson)
+ setConfigJson(frmConfigs->Identity.anyTypeToReactEvent)
}
| _ => ()
}
@@ -176,7 +175,7 @@ module CheckBoxRenderer = {
showConfitmation()
} else {
frmConfigInfo.payment_methods = []
- setConfigJson(frmConfigs->asJson)
+ setConfigJson(frmConfigs->Identity.anyTypeToReactEvent)
setIsOpen(_ => !isOpen)
}
}
@@ -188,7 +187,7 @@ module CheckBoxRenderer = {
switch connectorPaymentMethods {
| Some(paymentMethods) => {
frmConfigInfo.payment_methods = paymentMethods->generateFRMPaymentMethodsConfig
- setConfigJson(frmConfigs->asJson)
+ setConfigJson(frmConfigs->Identity.anyTypeToReactEvent)
}
| _ => ()
}
@@ -298,7 +297,7 @@ module PaymentMethodsRenderer = {
})
setConnectorConfig(_ => connectorsConfig)
- setConfigJson(updateFRMConfig->asJson)
+ setConfigJson(updateFRMConfig->Identity.anyTypeToReactEvent)
setPageState(_ => Success)
} catch {
| _ => setPageState(_ => Error("Failed to fetch"))
diff --git a/src/screens/HyperSwitch/Home/HomeUtils.res b/src/screens/HyperSwitch/Home/HomeUtils.res
index e5f9b2d7b..39ec58d1c 100644
--- a/src/screens/HyperSwitch/Home/HomeUtils.res
+++ b/src/screens/HyperSwitch/Home/HomeUtils.res
@@ -1,4 +1,3 @@
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
open CardUtils
open PageUtils
open HSwitchUtils
diff --git a/src/screens/HyperSwitch/RoutingRevamp/AddRuleGateway.res b/src/screens/HyperSwitch/RoutingRevamp/AddRuleGateway.res
index 63effeb51..ea50ce0f3 100644
--- a/src/screens/HyperSwitch/RoutingRevamp/AddRuleGateway.res
+++ b/src/screens/HyperSwitch/RoutingRevamp/AddRuleGateway.res
@@ -1,7 +1,5 @@
external arrToReactEvent: array => ReactEvent.Form.t = "%identity"
-external toReactEvent: 'a => ReactEvent.Form.t = "%identity"
external formEventToStrArr: ReactEvent.Form.t => array = "%identity"
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
external toJson: 'a => Js.Json.t = "%identity"
external anyToEnum: 'a => AdvancedRoutingTypes.connectorSelectionData = "%identity"
@@ -22,7 +20,7 @@ let make = (~id, ~gatewayOptions, ~isFirst=false, ~isExpanded=false) => {
} else {
"priority"
}
- gateWaysType.onChange(typeString->toReactEvent)
+ gateWaysType.onChange(typeString->Identity.anyTypeToReactEvent)
None
}, [isDistributeInput.value])
@@ -42,7 +40,7 @@ let make = (~id, ~gatewayOptions, ~isFirst=false, ~isExpanded=false) => {
let newSelectedOptions = ev->formEventToStrArr
if newSelectedOptions->Js.Array2.length === 0 {
- gateWaysInput.onChange([]->toReactEvent)
+ gateWaysInput.onChange([]->Identity.anyTypeToReactEvent)
} else {
let gatewaysArr = newSelectedOptions->Js.Array2.map(item => {
open AdvancedRoutingTypes
@@ -67,7 +65,7 @@ let make = (~id, ~gatewayOptions, ~isFirst=false, ~isExpanded=false) => {
}->toJson
}
})
- gateWaysInput.onChange(gatewaysArr->toReactEvent)
+ gateWaysInput.onChange(gatewaysArr->Identity.anyTypeToReactEvent)
}
},
onFocus: _ev => (),
@@ -106,7 +104,7 @@ let make = (~id, ~gatewayOptions, ~isFirst=false, ~isExpanded=false) => {
| VolumeObject(obj) => obj.connector->toJson
}
})
- gateWaysInput.onChange(gatewaysArr->toReactEvent)
+ gateWaysInput.onChange(gatewaysArr->Identity.anyTypeToReactEvent)
}
let updatePercentage = (item: AdvancedRoutingTypes.connectorSelectionData, value) => {
@@ -134,7 +132,7 @@ let make = (~id, ~gatewayOptions, ~isFirst=false, ~isExpanded=false) => {
}->toJson
}
})
- gateWaysInput.onChange(newList->toReactEvent)
+ gateWaysInput.onChange(newList->Identity.anyTypeToReactEvent)
}
}
@@ -145,7 +143,7 @@ let make = (~id, ~gatewayOptions, ~isFirst=false, ~isExpanded=false) => {
AdvancedRoutingUtils.getConnectorStringFromConnectorSelectionData(i).merchant_connector_id
)
->Array.filterWithIndex((_, i) => i !== index)
- ->toReactEvent,
+ ->Identity.anyTypeToReactEvent,
)
}
@@ -234,7 +232,7 @@ let make = (~id, ~gatewayOptions, ~isFirst=false, ~isExpanded=false) => {
{
- isDistributeInput.onChange(v->toReactEvent)
+ isDistributeInput.onChange(v->Identity.anyTypeToReactEvent)
onClickDistribute(v)
}}
isDisabled=false
diff --git a/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res b/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res
index 28e1d3092..2b5db95f3 100644
--- a/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res
+++ b/src/screens/HyperSwitch/RoutingRevamp/AdvancedRoutingUIUtils.res
@@ -3,9 +3,7 @@ open AdvancedRoutingUtils
open FormRenderer
external arrToFormEvent: array<'a> => ReactEvent.Form.t = "%identity"
-external toForm: 'a => ReactEvent.Form.t = "%identity"
external strToFormEvent: Js.String.t => ReactEvent.Form.t = "%identity"
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
external formEventToStrArr: ReactEvent.Form.t => array = "%identity"
module LogicalOps = {
@@ -55,8 +53,8 @@ module OperatorInp = {
name: "string",
onBlur: _ev => (),
onChange: ev => {
- let value = ev->formEventToStr
- operator.onChange(value->toForm)
+ let value = ev->Identity.formReactEventToString
+ operator.onChange(value->Identity.anyTypeToReactEvent)
},
onFocus: _ev => (),
value: operator.value,
@@ -74,7 +72,7 @@ module OperatorInp = {
setOpVals(_ => operatorVals)
if operator.value->Js.Json.decodeString->Belt.Option.isNone {
- operator.onChange(operatorVals[0]->toForm)
+ operator.onChange(operatorVals[0]->Identity.anyTypeToReactEvent)
}
None
}, (field.value, valInp.value))
@@ -139,7 +137,7 @@ module ValueInp = {
| NOT_CONTAINS => "enum_variant_array"
| _ => "number"
}
- }->toForm,
+ }->Identity.anyTypeToReactEvent,
)
None
}, [valueField.value])
@@ -149,7 +147,7 @@ module ValueInp = {
onBlur: _ev => (),
onChange: ev => {
let value = ev->formEventToStrArr
- valueField.onChange(value->toForm)
+ valueField.onChange(value->Identity.anyTypeToReactEvent)
},
onFocus: _ev => (),
value: valueField.value,
@@ -209,12 +207,12 @@ module MetadataInp = {
})
let finalVal = Js.Array2.joinWith(arrStr, ",")->Js.Json.string
- valueField.onChange(finalVal->toForm)
+ valueField.onChange(finalVal->Identity.anyTypeToReactEvent)
},
onChange: ev => {
let target = ReactEvent.Form.target(ev)
let value = target["value"]
- valueField.onChange(value->toForm)
+ valueField.onChange(value->Identity.anyTypeToReactEvent)
},
onFocus: _ev => (),
value: valueField.value,
@@ -295,11 +293,11 @@ module FieldInp = {
name: "string",
onBlur: _ev => (),
onChange: ev => {
- let value = ev->formEventToStr
+ let value = ev->Identity.formReactEventToString
onChangeMethod(value)
- field.onChange(value->toForm)
- op.onChange(""->toForm)
- val.onChange(""->toForm)
+ field.onChange(value->Identity.anyTypeToReactEvent)
+ op.onChange(""->Identity.anyTypeToReactEvent)
+ val.onChange(""->Identity.anyTypeToReactEvent)
},
onFocus: _ev => (),
value: field.value,
diff --git a/src/screens/HyperSwitch/RoutingRevamp/BasicDetailsForm.res b/src/screens/HyperSwitch/RoutingRevamp/BasicDetailsForm.res
index 647bc5b71..ab7949efb 100644
--- a/src/screens/HyperSwitch/RoutingRevamp/BasicDetailsForm.res
+++ b/src/screens/HyperSwitch/RoutingRevamp/BasicDetailsForm.res
@@ -2,9 +2,6 @@ open FormRenderer
open LogicUtils
open AdvancedRoutingTypes
-external fromFormEvent: ReactEvent.Form.t => 'a = "%identity"
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
-
let configurationNameInput = makeFieldInfo(
~label="Configuration Name",
~name="name",
@@ -43,7 +40,7 @@ module BusinessProfileInp = {
value: profile->Js.Json.string,
onChange: {
ev => {
- setProfile(_ => ev->formEventToStr)
+ setProfile(_ => ev->Identity.formReactEventToString)
input.onChange(ev)
}
},
diff --git a/src/screens/HyperSwitch/SDKPayment/SDKPage.res b/src/screens/HyperSwitch/SDKPayment/SDKPage.res
index 2e37537e2..fe9300e49 100644
--- a/src/screens/HyperSwitch/SDKPayment/SDKPage.res
+++ b/src/screens/HyperSwitch/SDKPayment/SDKPage.res
@@ -1,6 +1,5 @@
let h3Leading2Style = HSwitchUtils.getTextClass(~textVariant=H3, ~h3TextVariant=Leading_2, ())
external toJson: 'a => Js.Json.t = "%identity"
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
external strToFormEvent: Js.String.t => ReactEvent.Form.t = "%identity"
module SDKConfiguarationFields = {
@@ -55,7 +54,8 @@ module SDKConfiguarationFields = {
value: (initialValues.amount / 100)->string_of_int->Js.Json.string,
onChange: {
ev => {
- let eventValueToInt = ev->formEventToStr->LogicUtils.getIntFromString(0)
+ let eventValueToInt =
+ ev->Identity.formReactEventToString->LogicUtils.getIntFromString(0)
let valInCents = (eventValueToInt * 100)->string_of_int->strToFormEvent
input.onChange(valInCents)
}
diff --git a/src/screens/HyperSwitch/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res b/src/screens/HyperSwitch/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res
index e54d0211f..d07bd6a18 100644
--- a/src/screens/HyperSwitch/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res
+++ b/src/screens/HyperSwitch/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res
@@ -1,4 +1,3 @@
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
open UserOnboardingTypes
open UserOnboardingUtils
@@ -284,7 +283,7 @@ module BackendFrontendPlatformLangDropDown = {
name: "Platform Selecr",
onBlur: _ev => (),
onChange: ev => {
- let val = ev->formEventToStr->getPlatform
+ let val = ev->Identity.formReactEventToString->getPlatform
setPlatform(_ => val)
hyperswitchMixPanel(~pageName=urlHead, ~contextName, ~actionName={(val :> string)}, ())
},
@@ -300,7 +299,7 @@ module BackendFrontendPlatformLangDropDown = {
name: "BackEnd",
onBlur: _ev => (),
onChange: ev => {
- let val = ev->formEventToStr->getLangauge
+ let val = ev->Identity.formReactEventToString->getLangauge
setBackEndLang(_ => val)
hyperswitchMixPanel(~pageName=urlHead, ~contextName, ~actionName={(val :> string)}, ())
},
@@ -312,7 +311,7 @@ module BackendFrontendPlatformLangDropDown = {
name: "FrontEnd",
onBlur: _ev => (),
onChange: ev => {
- let val = ev->formEventToStr->getLangauge
+ let val = ev->Identity.formReactEventToString->getLangauge
setFrontEndLang(_ => val)
hyperswitchMixPanel(~pageName=urlHead, ~contextName, ~actionName={(val :> string)}, ())
},
diff --git a/src/screens/analyticsScreens/AnalyticsCommonComponents.res b/src/screens/analyticsScreens/AnalyticsCommonComponents.res
index bde445c44..8e20b3751 100644
--- a/src/screens/analyticsScreens/AnalyticsCommonComponents.res
+++ b/src/screens/analyticsScreens/AnalyticsCommonComponents.res
@@ -1,11 +1,10 @@
external toString: option => string = "%identity"
external convertToStrDict: 't => Js.Json.t = "%identity"
-external evToString: ReactEvent.Form.t => string = "%identity"
external objToJson: {..} => Js.Json.t = "%identity"
external toJson: exn => Js.Json.t = "%identity"
external toRespJson: Fetch.Response.t => Js.Json.t = "%identity"
@get external keyCode: 'a => int = "keyCode"
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
+
type window
@val external window: window = "window"
@scope("window") @val external parent: window = "parent"
@@ -348,7 +347,7 @@ module AnalyticsSaveViewNew = {
name: "savedView",
onBlur: _ev => (),
onChange: ev => {
- let appliedVal = ev->formEventToStr
+ let appliedVal = ev->Identity.formReactEventToString
if appliedVal === "baseView" {
updateExistingKeys(defaultSearchDict)
setAppliedSaveView(_ => SaveViewEntity.defaultSaveView)
@@ -1305,7 +1304,7 @@ module SankeyWithDropDown = {
onBlur: _ev => (),
onChange: ev => {
setSankeyCardinality(_ => {
- ev->formEventToStr->Belt.Int.fromString->Belt.Option.getWithDefault(5)
+ ev->Identity.formReactEventToString->Belt.Int.fromString->Belt.Option.getWithDefault(5)
})
},
onFocus: _ev => (),
@@ -1651,7 +1650,7 @@ module ErrorOnCellClick = {
let modalInput: ReactFinalForm.fieldRenderPropsInput = {
name: "modalInput",
onBlur: _ev => (),
- onChange: ev => renderModalChart(ev->evToString),
+ onChange: ev => renderModalChart(ev->Identity.formReactEventToString),
onFocus: _ev => (),
value: ""->Js.Json.string,
checked: true,
diff --git a/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res b/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res
index 7a102d294..5de1d1904 100644
--- a/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res
+++ b/src/screens/login/HSwitchLoginFlow/HyperSwitchAuthUtils.res
@@ -1,5 +1,4 @@
open HyperSwitchAuthTypes
-external formEventToStr: ReactEvent.Form.t => string = "%identity"
module TermsAndCondition = {
@react.component