From 89673d2a028000374a9840b55fb4cb4093635e2e Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Sun, 11 Dec 2022 15:32:41 +0000 Subject: [PATCH] [dashboard] allow setting ws class for prebuilds --- .../src/projects/ProjectSettings.tsx | 42 ++++++++++++++++++- components/gitpod-protocol/src/protocol.ts | 4 +- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/components/dashboard/src/projects/ProjectSettings.tsx b/components/dashboard/src/projects/ProjectSettings.tsx index d7b9bd643c0109..a4db5f58804ed3 100644 --- a/components/dashboard/src/projects/ProjectSettings.tsx +++ b/components/dashboard/src/projects/ProjectSettings.tsx @@ -76,13 +76,53 @@ export default function () { return value; } const before = project.settings?.workspaceClasses?.regular; - updateProjectSettings({ workspaceClasses: { prebuild: value, regular: value } }); + updateProjectSettings({ workspaceClasses: { ...project.settings?.workspaceClasses, regular: value } }); + return before; + }; + + const setWorkspaceClassForPrebuild = async (value: string) => { + if (!project) { + return value; + } + const before = project.settings?.workspaceClasses?.prebuild; + updateProjectSettings({ workspaceClasses: { ...project.settings?.workspaceClasses, prebuild: value } }); return before; }; return (

Prebuilds

+

+ Choose the workspace machine type for your prebuilds. +

+ {BillingMode.canSetWorkspaceClass(billingMode) ? ( + + ) : ( + +
+ + To access{" "} + + large workspaces + {" "} + and{" "} + + pay-as-you-go + + , first cancel your existing plan. + + + + +
+
+ )} Enable Incremental Prebuilds } desc={ diff --git a/components/gitpod-protocol/src/protocol.ts b/components/gitpod-protocol/src/protocol.ts index fd06b191da7f61..f8548a969c0929 100644 --- a/components/gitpod-protocol/src/protocol.ts +++ b/components/gitpod-protocol/src/protocol.ts @@ -255,8 +255,8 @@ export type IDESettings = { }; export interface WorkspaceClasses { - regular: string; - prebuild: string; + regular?: string; + prebuild?: string; } export interface UserPlatform {