* I've successfully implemented task templates for vibe-kanban with the following features: - Created a new `task_templates` table with fields for: - `id` (UUID primary key) - `project_id` (nullable for global templates) - `title` (default task title) - `description` (default task description) - `template_name` (display name for the template) - Timestamps for tracking creation/updates - Created `TaskTemplate` model with full CRUD operations - Added REST API endpoints: - `GET /api/templates` - List all templates - `GET /api/templates/global` - List only global templates - `GET /api/projects/:project_id/templates` - List templates for a project (includes global) - `GET /api/templates/:id` - Get specific template - `POST /api/templates` - Create template - `PUT /api/templates/:id` - Update template - `DELETE /api/templates/:id` - Delete template 1. **Task Creation Dialog**: - Added template selector dropdown when creating new tasks - Templates are fetched based on project context - Selecting a template pre-fills title and description fields - User can edit pre-filled values before creating the task 2. **Global Settings**: - Added "Task Templates" section to manage global templates - Full CRUD interface with table view - Create/Edit dialog for template management 3. **Project Settings**: - Modified project form to use tabs when editing - Added "Task Templates" tab for project-specific templates - Same management interface as global settings - **Scope Management**: Templates can be global (available to all projects) or project-specific - **User Experience**: Template selection is optional and doesn't interfere with normal task creation - **Data Validation**: Unique template names within same scope (global or per-project) - **UI Polish**: Clean interface with loading states, error handling, and confirmation dialogs The implementation allows users to create reusable task templates that streamline the task creation process by pre-filling common values while still allowing full editing before submission. * improve styling * address review comments * fix unqiue contraint on tempaltes * distinguish between local and global templates in UI * keyboard shortcuts for task creation * add dropdown on project page to select templates * update types * add default global task templates * Add task templates from kanban (#219) * Create project templates from kanban * Fixes * remove duplicate --------- Co-authored-by: Louis Knight-Webb <louis@bloop.ai>
25 lines
1.0 KiB
SQL
25 lines
1.0 KiB
SQL
-- Add task templates tables
|
|
CREATE TABLE task_templates (
|
|
id BLOB PRIMARY KEY,
|
|
project_id BLOB, -- NULL for global templates
|
|
title TEXT NOT NULL,
|
|
description TEXT,
|
|
template_name TEXT NOT NULL, -- Display name for the template
|
|
created_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
|
|
updated_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
|
|
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
|
|
);
|
|
|
|
-- Add index for faster queries
|
|
CREATE INDEX idx_task_templates_project_id ON task_templates(project_id);
|
|
|
|
-- Add unique constraints to prevent duplicate template names within same scope
|
|
-- For project-specific templates: unique within each project
|
|
CREATE UNIQUE INDEX idx_task_templates_unique_name_project
|
|
ON task_templates(project_id, template_name)
|
|
WHERE project_id IS NOT NULL;
|
|
|
|
-- For global templates: unique across all global templates
|
|
CREATE UNIQUE INDEX idx_task_templates_unique_name_global
|
|
ON task_templates(template_name)
|
|
WHERE project_id IS NULL; |