Skip to content

Commit bd82e32

Browse files
committed
[dashboard] Nudge users toward pay-as-you-go in workspace class preferences
1 parent b05ba0d commit bd82e32

File tree

2 files changed

+41
-27
lines changed

2 files changed

+41
-27
lines changed

components/dashboard/src/projects/ProjectSettings.tsx

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import PillLabel from "../components/PillLabel";
1515
import { ProjectContext } from "./project-context";
1616
import SelectWorkspaceClass from "../settings/selectClass";
1717
import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode";
18+
import Alert from "../components/Alert";
1819

1920
export function getProjectSettingsMenu(project?: Project, team?: Team) {
2021
const teamOrUserSlug = !!team ? "t/" + team.slug : "projects";
@@ -156,13 +157,32 @@ export default function () {
156157
</div>
157158
</div>
158159
</div>
159-
{BillingMode.canSetWorkspaceClass(teamBillingMode) && (
160-
<SelectWorkspaceClass
161-
workspaceClass={project.settings?.workspaceClasses?.regular}
162-
enabled={BillingMode.canSetWorkspaceClass(teamBillingMode)}
163-
setWorkspaceClass={setWorkspaceClass}
164-
/>
165-
)}
160+
<div>
161+
<h3 className="mt-12">Workspaces</h3>
162+
<p className="text-base text-gray-500 dark:text-gray-400">
163+
Choose the workspace machine type for your workspaces.
164+
</p>
165+
{BillingMode.canSetWorkspaceClass(teamBillingMode) ? (
166+
<SelectWorkspaceClass
167+
workspaceClass={project.settings?.workspaceClasses?.regular}
168+
enabled={BillingMode.canSetWorkspaceClass(teamBillingMode)}
169+
setWorkspaceClass={setWorkspaceClass}
170+
/>
171+
) : (
172+
<Alert type="message" className="mb-4">
173+
To access{" "}
174+
<a className="gp-link" href="https://www.gitpod.io/docs/configure/workspaces/workspace-classes">
175+
large workspaces
176+
</a>{" "}
177+
and{" "}
178+
<a className="gp-link" href="https://www.gitpod.io/docs/configure/billing/pay-as-you-go">
179+
pay-as-you-go
180+
</a>
181+
, first cancel your existing plan. Existing plans will keep working until the end of March,
182+
2023.
183+
</Alert>
184+
)}
185+
</div>
166186
</ProjectSettingsPage>
167187
);
168188
}

components/dashboard/src/settings/selectClass.tsx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,20 @@ export default function SelectWorkspaceClass(props: SelectWorkspaceClassProps) {
4848
return <div></div>;
4949
} else {
5050
return (
51-
<div>
52-
<h3 className="mt-12">Workspaces</h3>
53-
<p className="text-base text-gray-500 dark:text-gray-400">
54-
Choose the workspace machine type for your workspaces.
55-
</p>
56-
<div className="mt-4 space-x-3 flex">
57-
{supportedClasses.map((c) => {
58-
return (
59-
<WorkspaceClass
60-
additionalStyles="w-80 h-32"
61-
selected={workspaceClass === c.id}
62-
onClick={() => actuallySetWorkspaceClass(c.id)}
63-
category={c.category}
64-
friendlyName={c.displayName}
65-
description={c.description}
66-
powerUps={c.powerups}
67-
/>
68-
);
69-
})}
70-
</div>
51+
<div className="mt-4 space-x-3 flex">
52+
{supportedClasses.map((c) => {
53+
return (
54+
<WorkspaceClass
55+
additionalStyles="w-80 h-32"
56+
selected={workspaceClass === c.id}
57+
onClick={() => actuallySetWorkspaceClass(c.id)}
58+
category={c.category}
59+
friendlyName={c.displayName}
60+
description={c.description}
61+
powerUps={c.powerups}
62+
/>
63+
);
64+
})}
7165
</div>
7266
);
7367
}

0 commit comments

Comments
 (0)