-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fetch workspace classes from server #11571
Conversation
bef547a
to
8c45531
Compare
8c45531
to
29778a5
Compare
const [workspaceClass, setWorkspaceClass] = useState<string>( | ||
user?.additionalData?.workspaceClasses?.regular || "g1-standard", | ||
); | ||
const [workspaceClass, setWorkspaceClass] = useState<string>(user?.additionalData?.workspaceClasses?.regular || ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: On first load I was confused because no class was selected.
It would make sense to highlight the one with isDefault: true
, though. Maybe by moving the WorkspacClasses
code into gitpod-protocol
, und re-using it here...? 🤔 Or we introduce an explicit API method: getDefaultWorkspaceClass
🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ This can easily be a follow-up issue. 🧘
const actuallySetWorkspaceClass = async (value: string) => { | ||
const additionalData = user?.additionalData || {}; | ||
const prevWorkspaceClass = additionalData?.workspaceClasses?.regular || "g1-standard"; | ||
const prevWorkspaceClass = additionalData?.workspaceClasses?.regular || ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that is only because I edited the configmap to better illustrate what it would look like. The installer only installs the Default workspace class as Tarun has posted below.
description="Up to 8 vCPU, 16GB memory, 50GB disk" | ||
powerUps={2} | ||
/> | ||
{supportedClasses.map((c) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Now it becomes apparent that this config is far to hidden. But now we have everything in place to maybe show it on /workspaces
/ the "open workspace modal" / somewhere else for visible? 😇
☁️ Clearly out-of-scope here, just wanted to raise in this context.
/cc @gtsiolis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, tested and works - really cool! 🚀
/hold This one might be worth addressing in here or shortly after, leaving it up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome Work.
From a default install of self-hosted
, I see the following
Shouldn't this class be selected by default? It could be confusing for users otherwise 🤔 Also, selecting it manually does not change anything as we would expect.
(@geropl also seems to have commented about the same. 👍🏼 )
cd35c29
to
15875d2
Compare
@Pothulapati Now the default class is selected if no class has been selected yet. I could not reproduce that selecting the workspace class does not do anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Source the workspace classes that should be displayed in the settings dialog from the server instead of hard coding them.
Related Issue(s)
Fixes ##11583
How to test
Release Notes
Werft options: