Skip to content

Commit

Permalink
fix: quick start default selection issue (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja authored Jan 24, 2024
1 parent 91f98c4 commit 0ce1d05
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
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 0ce1d05

Please sign in to comment.