Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch-control-center i…
Browse files Browse the repository at this point in the history
…nto feat/paypal-changes
  • Loading branch information
Riddhiagrawal001 committed Jan 24, 2024
2 parents 58839b4 + ad2ffb9 commit 1a26c78
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hooks/AuthHooks.res
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ let getHeaders = (~uri, ~headers, ()) => {
let res = switch hyperSwitchToken {
| Some(token) => {
headers->Dict.set("authorization", `Bearer ${token}`)
headers->Dict.set("api-key", `hyperswitch`)
headers->Dict.set("Content-Type", `application/json`)
headers
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ let make = (~connectProcessorValue: connectProcessor) => {
}
}

React.useEffect1(() => {
if choiceState === #NotSelected {
setButtonState(_ => Button.Disabled)
} else {
setButtonState(_ => Button.Normal)
}
None
}, [choiceState])

React.useEffect1(() => {
if smartRoutingChoiceState === #NotSelected {
setButtonState(_ => Button.Disabled)
} else {
setButtonState(_ => Button.Normal)
}
None
}, [smartRoutingChoiceState])

React.useEffect2(() => {
setInitialValues(prevJson => {
let prevJsonDict = prevJson->LogicUtils.getDictFromJsonObject
Expand Down Expand Up @@ -185,6 +203,8 @@ let make = (~connectProcessorValue: connectProcessor) => {
listChoices={connectorChoiceArray}
nextButton={<Button
buttonType=Primary
showBtnTextToolTip={buttonState === Button.Disabled}
tooltipText="Please select one of the choices"
text="Proceed"
onClick={_ => {
mixpanelEvent(~eventName=`quickstart_landing`, ())
Expand Down Expand Up @@ -249,6 +269,8 @@ let make = (~connectProcessorValue: connectProcessor) => {
listChoices={getSmartRoutingConfigurationText}
nextButton={<Button
buttonType=Primary
showBtnTextToolTip={buttonState === Button.Disabled}
tooltipText="Please select one of the choices"
text="Proceed"
onClick={_ => {
mixpanelEvent(~eventName=`quickstart_configure_smart_routing`, ())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ let make = (
}
}

React.useEffect1(() => {
if choiceStateForTestConnector === #NotSelected {
setButtonState(_ => Button.Disabled)
} else {
setButtonState(_ => Button.Normal)
}
None
}, [choiceStateForTestConnector])

React.useEffect1(() => {
let defaultJsonOnNewConnector =
[("profile_id", activeBusinessProfile.profile_id->Js.Json.string)]
Expand Down Expand Up @@ -144,6 +153,8 @@ let make = (
buttonType=Primary
text="Proceed"
buttonState
showBtnTextToolTip={buttonState === Button.Disabled}
tooltipText="Please select one of the choices"
onClick={_ => {
handleConnectorSubmit()
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ module SelectProcessor = {
| UnknownConnector(_) => Button.Disabled
| _ => Button.Normal
}}
showBtnTextToolTip={switch selectedConnector {
| UnknownConnector(_) => true
| _ => false
}}
tooltipText={switch selectedConnector {
| UnknownConnector(_) => "Please select one of the processor"
| _ => ""
}}
text="Proceed"
onClick={_ => {
setConnectorConfigureState(_ => Select_configuration_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ let make = (~integrateAppValue: integrateApp) => {
setQuickStartPageState(_ => GoLive(LANDING))
}

React.useEffect1(() => {
if choiceState === #NotSelected {
setButtonState(_ => Button.Disabled)
} else {
setButtonState(_ => Button.Normal)
}
None
}, [choiceState])

<>
{switch integrateAppValue {
| LANDING =>
Expand Down Expand Up @@ -94,6 +103,8 @@ let make = (~integrateAppValue: integrateApp) => {
buttonType=Primary
text="Proceed"
buttonState
showBtnTextToolTip={buttonState === Button.Disabled}
tooltipText="Please select one of the choices"
onClick={_ => {
mixpanelEvent(~eventName=`quickstart_integration_landing_option`, ())
handleIntegration()->ignore
Expand Down

0 comments on commit 1a26c78

Please sign in to comment.