From 8f7b74571ae8868d52b3b93eb11d07a1b2788f02 Mon Sep 17 00:00:00 2001 From: Riddhi Agrawal Date: Fri, 8 Dec 2023 16:07:54 +0530 Subject: [PATCH 1/4] fix: Added configure return url after business profile --- .../BusinessMapping/BusinessMappingUtils.res | 2 +- .../BusinessMapping/BusinessProfile.res | 67 ++++++++++++++++--- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res index 6a21fd6cd..6d2cdafd2 100644 --- a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res +++ b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessMappingUtils.res @@ -17,7 +17,7 @@ let labelField = FormRenderer.makeFieldInfo( (), ) -type modalState = Loading | Edit +type modalState = Loading | Edit | Successful let validateEmptyValue = (key, errors) => { switch key { diff --git a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res index 4cea24ef1..0e4bd91ab 100644 --- a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res +++ b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res @@ -1,9 +1,21 @@ module AddEntryBtn = { @react.component - let make = (~onSubmit, ~modalState, ~showModal, ~setShowModal, ~list, ~isFromSettings=true) => { + let make = ( + ~onSubmit, + ~modalState, + ~showModal, + ~setShowModal, + ~list, + ~isFromSettings=true, + ~updatedProfileId, + ~setModalState, + ) => { open HSwitchUtils open BusinessMappingUtils - let initialValues = [("profile_name", "Default"->Js.Json.string)]->Js.Dict.fromArray + let initialValues = + [ + ("profile_name", `default${list->Js.Array2.length->string_of_int}`->Js.Json.string), + ]->Js.Dict.fromArray let modalBody =
{switch modalState { @@ -37,9 +49,31 @@ module AddEntryBtn = {
+ | Successful => +
+

+ {"Business profile successfully created! Set up the return URL and webhooks for the newly created business profile."->React.string} +

+
}} + let modalHeaderText = switch modalState { + | Edit | Loading => "Add Business Profile Name" + | Successful => "Configure webhooks and return url" + } +
@@ -146,6 +195,8 @@ let make = ( showModal={showModalFromOtherScreen} setShowModal={setShowModalFromOtherScreen} list={businessProfileValues} + updatedProfileId + setModalState /> From 635015696558940b38c433adea01284bb13163ea Mon Sep 17 00:00:00 2001 From: Riddhi Agrawal Date: Mon, 11 Dec 2023 14:55:29 +0530 Subject: [PATCH 2/4] fix: copy changes --- config/FeatureFlag.json | 2 +- .../Settings/BusinessMapping/BusinessProfile.res | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/FeatureFlag.json b/config/FeatureFlag.json index 9d6e08029..deaef522e 100644 --- a/config/FeatureFlag.json +++ b/config/FeatureFlag.json @@ -16,7 +16,7 @@ "feedback": false, "verify_connector": false, "mixpanel": false, - "business_profile": false, + "business_profile": true, "generate_report": false, "forgot_password": false, "oss_build": true diff --git a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res index 0e4bd91ab..1adacb366 100644 --- a/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res +++ b/src/screens/HyperSwitch/Settings/BusinessMapping/BusinessProfile.res @@ -50,12 +50,12 @@ module AddEntryBtn = { | Successful => -
+

- {"Business profile successfully created! Set up the return URL and webhooks for the newly created business profile."->React.string} + {"Business Profile successfully created! Set up your payments settings like webhooks, return url for your new profile before trying a payment."->React.string}

}} @@ -155,11 +167,16 @@ let make = (
-
+
+ Js.Array2.length > 1}> + + Date: Mon, 11 Dec 2023 15:19:28 +0530 Subject: [PATCH 4/4] fix: reverted code for testing --- config/FeatureFlag.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/FeatureFlag.json b/config/FeatureFlag.json index deaef522e..9d6e08029 100644 --- a/config/FeatureFlag.json +++ b/config/FeatureFlag.json @@ -16,7 +16,7 @@ "feedback": false, "verify_connector": false, "mixpanel": false, - "business_profile": true, + "business_profile": false, "generate_report": false, "forgot_password": false, "oss_build": true