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
Generated
+4
@@ -17653,6 +17653,10 @@ const docTemplate = `{
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"is_prebuild": {
|
||||
"description": "IsPrebuild indicates whether the workspace is a prebuilt workspace.\nPrebuilt workspaces are owned by the prebuilds system user and have specific behavior,\nsuch as being managed differently from regular workspaces.\nOnce a prebuilt workspace is claimed by a user, it transitions to a regular workspace,\nand IsPrebuild returns false.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"last_used_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
|
||||
Generated
+4
@@ -16116,6 +16116,10 @@
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"is_prebuild": {
|
||||
"description": "IsPrebuild indicates whether the workspace is a prebuilt workspace.\nPrebuilt workspaces are owned by the prebuilds system user and have specific behavior,\nsuch as being managed differently from regular workspaces.\nOnce a prebuilt workspace is claimed by a user, it transitions to a regular workspace,\nand IsPrebuild returns false.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"last_used_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
|
||||
@@ -2231,6 +2231,7 @@ func convertWorkspace(
|
||||
if latestAppStatus.ID == uuid.Nil {
|
||||
appStatus = nil
|
||||
}
|
||||
|
||||
return codersdk.Workspace{
|
||||
ID: workspace.ID,
|
||||
CreatedAt: workspace.CreatedAt,
|
||||
@@ -2265,6 +2266,7 @@ func convertWorkspace(
|
||||
AllowRenames: allowRenames,
|
||||
Favorite: requesterFavorite,
|
||||
NextStartAt: nextStartAt,
|
||||
IsPrebuild: workspace.IsPrebuild(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user