Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: quick start default selection issue #287

Merged
merged 5 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading