mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): exclude workspace schedule settings for prebuilt workspaces (#18826)
## Description This PR updates the UI to avoid rendering workspace schedule settings (autostop, autostart, etc.) for prebuilt workspaces. Instead, it displays an informational message with a link to the relevant documentation. ## Changes * Introduce `IsPrebuild` parameter to `convertWorkspace` to indicate whether the workspace is a prebuild. * Prevent the Workspace Schedule settings form from rendering in the UI for prebuilt workspaces. * Display an info alert with a link to documentation when viewing a prebuilt workspace. <img width="2980" height="864" alt="Screenshot 2025-07-10 at 13 16 13" src="https://github.com/user-attachments/assets/5f831c21-50bb-4e05-beea-dbeb930ddff8" /> Relates with: https://github.com/coder/coder/pull/18762 --------- Co-authored-by: BrunoQuaresma <bruno_nonato_quaresma@hotmail.com>
This commit is contained in:
co-authored by
BrunoQuaresma
parent
e4d3453e2b
commit
dad033ee3d
@@ -66,6 +66,12 @@ type Workspace struct {
|
||||
AllowRenames bool `json:"allow_renames"`
|
||||
Favorite bool `json:"favorite"`
|
||||
NextStartAt *time.Time `json:"next_start_at" format:"date-time"`
|
||||
// IsPrebuild indicates whether the workspace is a prebuilt workspace.
|
||||
// Prebuilt workspaces are owned by the prebuilds system user and have specific behavior,
|
||||
// such as being managed differently from regular workspaces.
|
||||
// Once a prebuilt workspace is claimed by a user, it transitions to a regular workspace,
|
||||
// and IsPrebuild returns false.
|
||||
IsPrebuild bool `json:"is_prebuild"`
|
||||
}
|
||||
|
||||
func (w Workspace) FullName() string {
|
||||
|
||||
Reference in New Issue
Block a user