-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃獰馃И馃悰 Fix redirection in signup source selector experiment #19382
馃獰馃И馃悰 Fix redirection in signup source selector experiment #19382
Conversation
{...(isSignupSourceSelectorExperiment && | ||
sourceDefinitionId && { | ||
state: { sourceDefinitionId }, | ||
to: `/${RoutePaths.Workspaces}/${workspaces[0].workspaceId}/${RoutePaths.Connections}/${RoutePaths.ConnectionNew}`, | ||
})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be cleaned up to make it easier to follow the logic? A better way might be to set up the props before the render. For example:
let navigateProps: NavigateProps = { replace: true }
if (somecondition) {
navigateProps = {
...navigateProps,
state: { sourceDefintionId },
to: `...`
}
} else {
navigateProps.to = `...`
}
return <Navigate {...navigateProps} />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we keep it separate is that the experiments are meant to be removed completely potentially when they are not successful, so the code is tried to be highlighted separately. Leti, treat this as a 馃Ч that needs to be cleaned up if we keep this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM. Have seen it in action via zoom
Demo: https://www.loom.com/share/fabca04e7b024e16b0f714b22bef3f52
What
Fixed a bug introduced in signup source selector experiment where the user was being redirected every time to /connections/new-connection