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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃獰馃И馃悰 Fix redirection in signup source selector experiment #19382

Merged
merged 1 commit into from
Nov 15, 2022
Merged
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
9 changes: 5 additions & 4 deletions airbyte-webapp/src/packages/cloud/views/DefaultView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ export const DefaultView: React.FC = () => {
}
replace
// exp-signup-selected-source-definition
{...(isSignupSourceSelectorExperiment && {
state: { sourceDefinitionId },
to: `/${RoutePaths.Workspaces}/${workspaces[0].workspaceId}/${RoutePaths.Connections}/${RoutePaths.ConnectionNew}`,
})}
{...(isSignupSourceSelectorExperiment &&
sourceDefinitionId && {
state: { sourceDefinitionId },
to: `/${RoutePaths.Workspaces}/${workspaces[0].workspaceId}/${RoutePaths.Connections}/${RoutePaths.ConnectionNew}`,
})}
Comment on lines +31 to +35
Copy link
Contributor

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} />

Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course!

/>
);
};