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

Redirect to oboarding page #6251

Merged
merged 1 commit into from
Oct 1, 2021
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
8 changes: 4 additions & 4 deletions airbyte-webapp/src/packages/cloud/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ const MainRoutes: React.FC<{ currentWorkspaceId: string }> = ({
useGetWorkspace(currentWorkspaceId);
const { countNewSourceVersion, countNewDestinationVersion } = useConnector();
const { workspace } = useWorkspace();
const mainRedirect = workspace.displaySetupWizard
? Routes.Onboarding
: Routes.Connections;

const pageConfig = useMemo<PageConfig>(
() => ({
Expand Down Expand Up @@ -153,10 +156,7 @@ const MainRoutes: React.FC<{ currentWorkspaceId: string }> = ({
<OnboardingPage />
</Route>
)}
<Route exact path={Routes.Root}>
<SourcesPage />
</Route>
<Redirect to={Routes.Connections} />
<Redirect to={mainRedirect} />
</Switch>
);
};
Expand Down
18 changes: 8 additions & 10 deletions airbyte-webapp/src/packages/cloud/views/layout/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ const SideBar: React.FC = () => {
return (
<Bar>
<div>
<Link to={Routes.Root}>
<Link
to={
workspace.displaySetupWizard
? Routes.Onboarding
: Routes.Connections
}
>
<img src="/simpleLogo.svg" alt="logo" height={33} width={33} />
</Link>
<WorkspacePopout>
Expand Down Expand Up @@ -158,15 +164,7 @@ const SideBar: React.FC = () => {
</MenuItem>
</li>
<li>
<MenuItem
to={Routes.Root}
exact
activeClassName="active"
isActive={(_, location) =>
location.pathname === Routes.Root ||
location.pathname.startsWith(Routes.Source)
}
>
<MenuItem to={Routes.Source} activeClassName="active">
<Source />
<Text>
<FormattedMessage id="sidebar.sources" />
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/pages/OnboardingPage/OnboardingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const OnboardingPage: React.FC = () => {
const onSync = () => syncConnection(connections[0]);
const onCloseOnboarding = () => {
finishOnboarding();
push(Routes.Root);
push(Routes.Connections);
};

return (
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SourcesPage: React.FC = () => {
<SourceItemPage />
</ErrorBoundary>
</Route>
<Route path={Routes.Root} exact>
<Route path={Routes.Source} exact>
<AllSourcesPage />
</Route>
<Redirect to={Routes.Root} />
Expand Down
7 changes: 5 additions & 2 deletions airbyte-webapp/src/pages/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export enum Routes {

const MainViewRoutes = () => {
const { workspace } = useWorkspace();
const mainRedirect = workspace.displaySetupWizard
? Routes.Onboarding
: Routes.Connections;

return (
<MainView>
Expand All @@ -67,10 +70,10 @@ const MainViewRoutes = () => {
<OnboardingPage />
</Route>
)}
<Route exact path={Routes.Root}>
<Route exact path={Routes.Source}>
<SourcesPage />
</Route>
<Redirect to={Routes.Root} />
<Redirect to={mainRedirect} />
</Switch>
</Suspense>
</MainView>
Expand Down
18 changes: 8 additions & 10 deletions airbyte-webapp/src/views/layout/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ const SideBar: React.FC = () => {
return (
<Bar>
<div>
<Link to={Routes.Root}>
<Link
to={
workspace.displaySetupWizard
? Routes.Onboarding
: Routes.Connections
}
>
<img src="/simpleLogo.svg" alt="logo" height={33} width={33} />
</Link>
<Menu>
Expand All @@ -133,15 +139,7 @@ const SideBar: React.FC = () => {
</MenuItem>
</li>
<li>
<MenuItem
to={Routes.Root}
exact
activeClassName="active"
isActive={(_, location) =>
location.pathname === Routes.Root ||
location.pathname.startsWith(Routes.Source)
}
>
<MenuItem to={Routes.Source} activeClassName="active">
<Source />
<Text>
<FormattedMessage id="sidebar.sources" />
Expand Down