From 8f7b74571ae8868d52b3b93eb11d07a1b2788f02 Mon Sep 17 00:00:00 2001 From: Riddhi Agrawal Date: Fri, 8 Dec 2023 16:07:54 +0530 Subject: [PATCH] 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 />