diff --git a/components/dashboard/src/service/service-mock.ts b/components/dashboard/src/service/service-mock.ts index ac7841ed8c1639..22d395d16c5705 100644 --- a/components/dashboard/src/service/service-mock.ts +++ b/components/dashboard/src/service/service-mock.ts @@ -218,6 +218,7 @@ const gitpodServiceMock = createServiceMock({ displayName: "Standard", description: "Up to 4 vCPU, 8GB memory, 30GB disk", powerups: 1, + isDefault: true, }, { id: "g1-large", @@ -225,6 +226,7 @@ const gitpodServiceMock = createServiceMock({ displayName: "Large", description: "Up to 8 vCPU, 16GB memory, 50GB disk", powerups: 2, + isDefault: false, }, ]; }, diff --git a/components/dashboard/src/settings/selectClass.tsx b/components/dashboard/src/settings/selectClass.tsx index dd67bac8692609..5bc5988a78525d 100644 --- a/components/dashboard/src/settings/selectClass.tsx +++ b/components/dashboard/src/settings/selectClass.tsx @@ -43,10 +43,14 @@ export default function SelectWorkspaceClass(props: SelectWorkspaceClassProps) { const fetchClasses = async () => { const classes = await getGitpodService().server.getSupportedWorkspaceClasses(); setSupportedClasses(classes); + + if (!workspaceClass) { + setWorkspaceClass(supportedClasses.find((c) => c.isDefault)?.id || ""); + } }; fetchClasses().catch(console.error); - }, []); + }); if (!props.enabled) { return
; diff --git a/components/gitpod-protocol/src/workspace-class.ts b/components/gitpod-protocol/src/workspace-class.ts index 68bca3ec8a79b8..3128db9da1060b 100644 --- a/components/gitpod-protocol/src/workspace-class.ts +++ b/components/gitpod-protocol/src/workspace-class.ts @@ -10,4 +10,5 @@ export interface SupportedWorkspaceClass { displayName: string; description: string; powerups: number; + isDefault: boolean; } diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index ce6a49726cd6b8..04822579a69804 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -3052,6 +3052,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { displayName: c.displayName, description: c.description, powerups: c.powerups, + isDefault: c.isDefault, })); return classes;