mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: implement deprecated flag for templates to prevent new workspaces (#10745)
* feat: implement deprecated flag for templates to prevent new workspaces * Add deprecated filter to template fetching * Add deprecated to template table * Add deprecated notice to template page * Add ui to deprecate a template
This commit is contained in:
@@ -34,6 +34,17 @@ WHERE
|
||||
id = ANY(@ids)
|
||||
ELSE true
|
||||
END
|
||||
-- Filter by deprecated
|
||||
AND CASE
|
||||
WHEN sqlc.narg('deprecated') :: boolean IS NOT NULL THEN
|
||||
CASE
|
||||
WHEN sqlc.narg('deprecated') :: boolean THEN
|
||||
deprecated != ''
|
||||
ELSE
|
||||
deprecated = ''
|
||||
END
|
||||
ELSE true
|
||||
END
|
||||
-- Authorize Filter clause will be injected below in GetAuthorizedTemplates
|
||||
-- @authorize_filter
|
||||
ORDER BY (name, id) ASC
|
||||
@@ -174,7 +185,8 @@ FROM build_times
|
||||
UPDATE
|
||||
templates
|
||||
SET
|
||||
require_active_version = $2
|
||||
require_active_version = $2,
|
||||
deprecated = $3
|
||||
WHERE
|
||||
id = $1
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user