diff --git a/CHANGELOG.md b/CHANGELOG.md index e2dd8b736..2fd77e9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. See [conven - - - +## 2024.02.29.0 + +### Bug Fixes + +- Clear recoil ([#461](https://github.com/juspay/hyperswitch-control-center/pull/461)) ([`8865a76`](https://github.com/juspay/hyperswitch-control-center/commit/8865a76b8ef9fb83ce63ff02bc557e4b56e6f0d1)) +- Connector type change ([#462](https://github.com/juspay/hyperswitch-control-center/pull/462)) ([`c31de0f`](https://github.com/juspay/hyperswitch-control-center/commit/c31de0f25840e0e930eb80b658f89c564246c424)) + +### Refactors + +- Business recoil value from string to typed ([#458](https://github.com/juspay/hyperswitch-control-center/pull/458)) ([`16655fb`](https://github.com/juspay/hyperswitch-control-center/commit/16655fbcd59fdf27f3e6c07c2cc49c9b3c99b8f1)) + +**Full Changelog:** [`2024.02.28.0...2024.02.29.0`](https://github.com/juspay/hyperswitch-control-center/compare/2024.02.28.0...2024.02.29.0) + +- - - + ## 2024.02.28.0 ### Features diff --git a/src/screens/Connectors/ConnectorAccountDetails.res b/src/screens/Connectors/ConnectorAccountDetails.res index 01daf89f8..db87bcf25 100644 --- a/src/screens/Connectors/ConnectorAccountDetails.res +++ b/src/screens/Connectors/ConnectorAccountDetails.res @@ -64,7 +64,13 @@ let make = (~setCurrentStep, ~setInitialValues, ~initialValues, ~isUpdateFlow, ~ // TODO: Refactor for generic case if !isUpdateFlow { - if connectorTypeFromName === Processors(PAYPAL) && featureFlagDetails.paypalAutomaticFlow { + if ( + switch connectorTypeFromName { + | Processors(PAYPAL) => true + | _ => false + } && + featureFlagDetails.paypalAutomaticFlow + ) { initialValuesToDict->Dict.set( "connector_label", initialValues diff --git a/src/screens/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/Connectors/ConnectorAccountDetailsHelper.res index 07c5f3171..bfec705e5 100644 --- a/src/screens/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/Connectors/ConnectorAccountDetailsHelper.res @@ -288,9 +288,11 @@ module ConnectorConfigurationFields = { ~connectorLabelDetailField, ) => {
- {if connector === Processors(CASHTOCODE) { + {switch connector { + | Processors(CASHTOCODE) => - } else { + + | _ =>
- + true + | _ => false + }}>

diff --git a/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res b/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res index 197becf00..698e9c338 100644 --- a/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res +++ b/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res @@ -61,9 +61,14 @@ module CardRenderer = { let methodVariant = method.payment_method_type->getPaymentMethodTypeFromString if ( (methodVariant === GooglePay || methodVariant === ApplePay) && - (connector->getConnectorNameTypeFromString() !== Processors(TRUSTPAY) && - connector->getConnectorNameTypeFromString() !== Processors(AIRWALLEX) && - connector->getConnectorNameTypeFromString() !== Processors(STRIPE_TEST)) + { + switch connector->getConnectorNameTypeFromString() { + | Processors(TRUSTPAY) => false + | Processors(AIRWALLEX) => false + | Processors(STRIPE_TEST) => false + | _ => true + } + } ) { setShowWalletConfigurationModal(_ => !showWalletConfigurationModal) setSelectedWallet(_ => method) @@ -140,7 +145,12 @@ module CardRenderer = {

getPaymentMethodFromString === Wallet && - connector->getConnectorNameTypeFromString() === Processors(ZEN)}> + { + switch connector->getConnectorNameTypeFromString() { + | Processors(ZEN) => true + | _ => false + } + }}>
{"Zen doesn't support Googlepay and Applepay in sandbox."->React.string} diff --git a/src/screens/Connectors/ConnectorUtils.res b/src/screens/Connectors/ConnectorUtils.res index 633ab3bc0..e3df65c48 100644 --- a/src/screens/Connectors/ConnectorUtils.res +++ b/src/screens/Connectors/ConnectorUtils.res @@ -855,26 +855,28 @@ let validateConnectorRequiredFields = ( ) => { open LogicUtils let newDict = getDictFromJsonObject(errors) - if connector === Processors(CASHTOCODE) { - let dict = connectorAccountFields->getAuthKeyMapFromConnectorAccountFields + switch connector { + | Processors(CASHTOCODE) => { + let dict = connectorAccountFields->getAuthKeyMapFromConnectorAccountFields - let indexLength = dict->Dict.keysToArray->Array.length - let vector = Js.Vector.make(indexLength, false) + let indexLength = dict->Dict.keysToArray->Array.length + let vector = Js.Vector.make(indexLength, false) - dict - ->Dict.keysToArray - ->Array.forEachWithIndex((country, index) => { - let res = checkCashtoCodeInnerField(valuesFlattenJson, dict, country) + dict + ->Dict.keysToArray + ->Array.forEachWithIndex((country, index) => { + let res = checkCashtoCodeInnerField(valuesFlattenJson, dict, country) - vector->Js.Vector.set(index, res) - }) + vector->Js.Vector.set(index, res) + }) - let _ = Js.Vector.filterInPlace((. val) => val == true, vector) + let _ = Js.Vector.filterInPlace((. val) => val == true, vector) - if vector->Js.Vector.length === 0 { - Dict.set(newDict, "Currency", `Please enter currency`->JSON.Encode.string) + if vector->Js.Vector.length === 0 { + Dict.set(newDict, "Currency", `Please enter currency`->JSON.Encode.string) + } } - } else { + | _ => connectorAccountFields ->Dict.keysToArray ->Array.forEach(value => { diff --git a/src/screens/Sidebar/Sidebar.res b/src/screens/Sidebar/Sidebar.res index 826c5d28b..52860641d 100644 --- a/src/screens/Sidebar/Sidebar.res +++ b/src/screens/Sidebar/Sidebar.res @@ -98,7 +98,6 @@ module SidebarItem = { let tabLinklement = switch tabInfo { | Link(tabOption) => { - Js.log("options") let {name, icon, link, access} = tabOption let redirectionLink = `${link}${getSearchParamByLink(link)}` diff --git a/src/screens/StripePlusPaypal/StripePlusPaypalUIUtils.res b/src/screens/StripePlusPaypal/StripePlusPaypalUIUtils.res index ed5dd2466..3177a1e98 100644 --- a/src/screens/StripePlusPaypal/StripePlusPaypalUIUtils.res +++ b/src/screens/StripePlusPaypal/StripePlusPaypalUIUtils.res @@ -61,11 +61,14 @@ module SelectPaymentMethods = { enumRecoilUpdateArr->Array.push((body, #SecondProcessorConnected)) } - if selectedConnector === Processors(STRIPE) { - enumRecoilUpdateArr->Array.push((body, #StripeConnected)) - } else if selectedConnector === Processors(PAYPAL) { - enumRecoilUpdateArr->Array.push((body, #PaypalConnected)) + { + switch selectedConnector { + | Processors(STRIPE) => enumRecoilUpdateArr->Array.push((body, #StripeConnected)) + | Processors(PAYPAL) => enumRecoilUpdateArr->Array.push((body, #PaypalConnected)) + | _ => () + } } + let _ = updateEnumInRecoil(enumRecoilUpdateArr) } catch { | _ => setButtonState(_ => Button.Normal)