Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Add template type management#52

Merged
5000user5000 merged 3 commits into
devfrom
feature/template-type-management
May 28, 2026
Merged

Add template type management#52
5000user5000 merged 3 commits into
devfrom
feature/template-type-management

Conversation

@5000user5000
Copy link
Copy Markdown
Owner

@5000user5000 5000user5000 commented May 28, 2026

Summary

  • Add update/delete support for template types on the backend
  • Add a Template Library management modal for creating, editing, and deleting template types
  • Prevent deletion of template types that are already used by templates
  • Add frontend and backend coverage for template type management flows

Details

  • Generates template type code from the entered name during creation
  • Keeps template type code immutable after creation
  • Ensures both code and name remain unique
  • Adds a frontend suffix fallback for generated codes when an old renamed type still owns the base code
  • Allows editing name and description
  • Allows hard delete only for unused template types
  • Disables delete actions in the UI when a type has existing template usage
  • Wires template type create/update/delete handlers through PrototypeUI
  • Stabilizes AuthProvider tests around async auth state updates

Tests

  • cd frontend && npm run test
  • cd backend && mvn verify

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cloud-native Ready Ready Preview, Comment May 28, 2026 6:21am

@5000user5000
Copy link
Copy Markdown
Owner Author

關於 change request:

  • 修改 template 本身的名稱/內容/刪除 template:應該走 change request。因為 template 是實際會影響配置輸出、版本歷史、專案 scope 的資源。這個之前完成了
  • 新增 template type:不用走 change request,直接 writer/admin 操作即可。它只是建立分類,還不影響任何既有 template。
  • 編輯 template type 的 name/description:不用走 change request,因為這是 metadata/display 層級,不改實際 config。
  • 刪除 unused template type:不用走 change request,因為沒有任何 template 使用它。
  • 刪除 used template type 或修改 code:不要做成一般操作。現在禁止是對的;如果未來真的要支援,應該做 migration/admin-only flow,不建議走一般 CR。

簡而言之,目前編輯 template type 的功能不需要過 CR, 直接修改

@5000user5000
Copy link
Copy Markdown
Owner Author

5000user5000 commented May 28, 2026

新增 Manage Types 到 template page

image

可以新增 template types 或是編譯現有的 type 名稱和描述, 刪除只能用於沒被使用的 type
image

@5000user5000 5000user5000 merged commit d2ac11f into dev May 28, 2026
4 checks passed
@5000user5000 5000user5000 deleted the feature/template-type-management branch May 28, 2026 06:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant