Skip to content

Commit 25f89de

Browse files
committed
Stubbing out placeholder for new onboarding flow
1 parent f64024b commit 25f89de

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

components/dashboard/src/app/AppRoutes.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { StartWorkspaceModalContext } from "../workspaces/start-workspace-modal-
4545
import { OrgRequiredRoute } from "./OrgRequiredRoute";
4646
import { WebsocketClients } from "./WebsocketClients";
4747
import { StartWorkspaceOptions } from "../start/start-workspace-options";
48+
import { useFeatureFlags } from "../contexts/FeatureFlagContext";
4849

4950
const Setup = React.lazy(() => import(/* webpackPrefetch: true */ "../Setup"));
5051
const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ "../workspaces/Workspaces"));
@@ -88,6 +89,7 @@ const ProjectsSearch = React.lazy(() => import(/* webpackPrefetch: true */ "../a
8889
const TeamsSearch = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/TeamsSearch"));
8990
const License = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/License"));
9091
const Usage = React.lazy(() => import(/* webpackPrefetch: true */ "../Usage"));
92+
const UserOnboarding = React.lazy(() => import(/* webpackPrefetch: true */ "../onboarding/UserOnboarding"));
9193

9294
type AppRoutesProps = {
9395
user: User;
@@ -99,6 +101,7 @@ export const AppRoutes: FunctionComponent<AppRoutesProps> = ({ user, teams }) =>
99101
const [isWhatsNewShown, setWhatsNewShown] = useState(shouldSeeWhatsNew(user));
100102
const newCreateWsPage = useNewCreateWorkspacePage();
101103
const location = useLocation();
104+
const { newSignupFlow } = useFeatureFlags();
102105

103106
// Prefix with `/#referrer` will specify an IDE for workspace
104107
// We don't need to show IDE preference in this case
@@ -120,12 +123,18 @@ export const AppRoutes: FunctionComponent<AppRoutesProps> = ({ user, teams }) =>
120123
return <WhatsNew onClose={() => setWhatsNewShown(false)} />;
121124
}
122125

126+
// Placeholder for new signup flow
127+
if (newSignupFlow && User.isOnboardingUser(user)) {
128+
return <UserOnboarding user={user} />;
129+
}
130+
123131
// TODO: Try and encapsulate this in a route for "/" (check for hash in route component, render or redirect accordingly)
124132
const isCreation = location.pathname === "/" && hash !== "";
125133
if (isCreation) {
126134
if (showUserIdePreference) {
127135
return (
128136
<StartPage phase={StartPhase.Checking}>
137+
{/* TODO: ensure we don't show this after new onboarding flow */}
129138
<SelectIDEModal location="workspace_start" onClose={() => setShowUserIdePreference(false)} />
130139
</StartPage>
131140
);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright (c) 2023 Gitpod GmbH. All rights reserved.
3+
* Licensed under the GNU Affero General Public License (AGPL).
4+
* See License.AGPL.txt in the project root for license information.
5+
*/
6+
7+
import { User } from "@gitpod/gitpod-protocol";
8+
import { FunctionComponent } from "react";
9+
10+
type Props = {
11+
user: User;
12+
};
13+
const UserOnboarding: FunctionComponent<Props> = ({ user }) => {
14+
// Placeholder UI to start stubbing out new flow
15+
return (
16+
<div className="container">
17+
<h1>Welcome</h1>
18+
19+
<p>Help us get to know you a bit better</p>
20+
</div>
21+
);
22+
};
23+
export default UserOnboarding;

components/dashboard/src/workspaces/Workspaces.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { EmptyWorkspacesContent } from "./EmptyWorkspacesContent";
1919
import { WorkspacesSearchBar } from "./WorkspacesSearchBar";
2020
import { hoursBefore, isDateSmallerOrEqual } from "@gitpod/gitpod-protocol/lib/util/timeutil";
2121
import { useDeleteInactiveWorkspacesMutation } from "../data/workspaces/delete-inactive-workspaces-mutation";
22+
import { useFeatureFlags } from "../contexts/FeatureFlagContext";
2223

2324
const WorkspacesPage: FunctionComponent = () => {
2425
const user = useCurrentUser();
@@ -29,6 +30,7 @@ const WorkspacesPage: FunctionComponent = () => {
2930
const { data, isLoading } = useListWorkspacesQuery({ limit });
3031
const isOnboardingUser = useMemo(() => user && User.isOnboardingUser(user), [user]);
3132
const deleteInactiveWorkspaces = useDeleteInactiveWorkspacesMutation();
33+
const { newSignupFlow } = useFeatureFlags();
3234

3335
// Sort workspaces into active/inactive groups
3436
const { activeWorkspaces, inactiveWorkspaces } = useMemo(() => {
@@ -94,12 +96,9 @@ const WorkspacesPage: FunctionComponent = () => {
9496
/>
9597
)}
9698

97-
{isOnboardingUser ? (
98-
<SelectIDEModal location={"workspace_list"} />
99-
) : (
100-
// modal hides itself
101-
<ProfileState.NudgeForProfileUpdateModal />
102-
)}
99+
{isOnboardingUser && !newSignupFlow && <SelectIDEModal location={"workspace_list"} />}
100+
101+
{!isOnboardingUser && !newSignupFlow && <ProfileState.NudgeForProfileUpdateModal />}
103102

104103
{!isLoading &&
105104
(activeWorkspaces.length > 0 || inactiveWorkspaces.length > 0 || searchTerm ? (

0 commit comments

Comments
 (0)