feat(P7.1-P7.2): remove task_type='task' from frontend — type union, create forms, defaults changed to issue

This commit is contained in:
zhi
2026-03-17 16:05:32 +00:00
parent 208538f930
commit d399668932
3 changed files with 5 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ import type { Milestone, Project, Task } from '@/types'
const TASK_TYPES = [ const TASK_TYPES = [
{ value: 'story', label: 'Story', subtypes: ['improvement', 'refactor'] }, // P9.6: 'feature' removed — must come from propose accept { value: 'story', label: 'Story', subtypes: ['improvement', 'refactor'] }, // P9.6: 'feature' removed — must come from propose accept
{ value: 'issue', label: 'Issue', subtypes: ['infrastructure', 'performance', 'regression', 'security', 'user_experience', 'defect'] }, { value: 'issue', label: 'Issue', subtypes: ['infrastructure', 'performance', 'regression', 'security', 'user_experience', 'defect'] },
{ value: 'task', label: 'Task', subtypes: ['defect'] }, // P7.1: 'task' type removed — defect subtype migrated to issue/defect
{ value: 'test', label: 'Test', subtypes: ['regression', 'security', 'smoke', 'stress'] }, { value: 'test', label: 'Test', subtypes: ['regression', 'security', 'smoke', 'stress'] },
{ value: 'maintenance', label: 'Maintenance', subtypes: ['deploy'] }, // P9.6: 'release' removed — controlled via milestone flow { value: 'maintenance', label: 'Maintenance', subtypes: ['deploy'] }, // P9.6: 'release' removed — controlled via milestone flow
{ value: 'research', label: 'Research', subtypes: [] }, { value: 'research', label: 'Research', subtypes: [] },
@@ -42,7 +42,7 @@ const makeInitialForm = (projectId = 0, milestoneId = 0): FormState => ({
description: '', description: '',
project_id: projectId, project_id: projectId,
milestone_id: milestoneId, milestone_id: milestoneId,
task_type: 'task', task_type: 'issue', // P7.1: default changed from 'task' to 'issue'
task_subtype: '', task_subtype: '',
priority: 'medium', priority: 'medium',
tags: '', tags: '',

View File

@@ -6,7 +6,7 @@ import type { Project, Milestone } from '@/types'
const TASK_TYPES = [ const TASK_TYPES = [
{ value: 'story', label: 'Story', subtypes: ['improvement', 'refactor'] }, // P9.6: 'feature' removed — must come from propose accept { value: 'story', label: 'Story', subtypes: ['improvement', 'refactor'] }, // P9.6: 'feature' removed — must come from propose accept
{ value: 'issue', label: 'Issue', subtypes: ['infrastructure', 'performance', 'regression', 'security', 'user_experience', 'defect'] }, { value: 'issue', label: 'Issue', subtypes: ['infrastructure', 'performance', 'regression', 'security', 'user_experience', 'defect'] },
{ value: 'task', label: 'Task', subtypes: ['defect'] }, // P7.1: 'task' type removed — defect subtype migrated to issue/defect
{ value: 'test', label: 'Test', subtypes: ['regression', 'security', 'smoke', 'stress'] }, { value: 'test', label: 'Test', subtypes: ['regression', 'security', 'smoke', 'stress'] },
{ value: 'maintenance', label: 'Maintenance', subtypes: ['deploy'] }, // P9.6: 'release' removed — controlled via milestone flow { value: 'maintenance', label: 'Maintenance', subtypes: ['deploy'] }, // P9.6: 'release' removed — controlled via milestone flow
{ value: 'research', label: 'Research', subtypes: [] }, { value: 'research', label: 'Research', subtypes: [] },
@@ -19,7 +19,7 @@ export default function CreateTaskPage() {
const [projects, setProjects] = useState<Project[]>([]) const [projects, setProjects] = useState<Project[]>([])
const [milestones, setMilestones] = useState<Milestone[]>([]) const [milestones, setMilestones] = useState<Milestone[]>([])
const [form, setForm] = useState({ const [form, setForm] = useState({
title: '', description: '', project_id: 0, milestone_id: 0, task_type: 'task', title: '', description: '', project_id: 0, milestone_id: 0, task_type: 'issue', // P7.1: default changed from 'task' to 'issue'
task_subtype: '', priority: 'medium', tags: '', reporter_id: 1, task_subtype: '', priority: 'medium', tags: '', reporter_id: 1,
}) })

View File

@@ -33,7 +33,7 @@ export interface Task {
id: number id: number
title: string title: string
description: string | null description: string | null
task_type: 'issue' | 'maintenance' | 'research' | 'review' | 'story' | 'test' | 'resolution' | 'task' task_type: 'issue' | 'maintenance' | 'research' | 'review' | 'story' | 'test' | 'resolution' // P7.1: 'task' removed
task_subtype: string | null task_subtype: string | null
status: 'open' | 'pending' | 'undergoing' | 'completed' | 'closed' status: 'open' | 'pending' | 'undergoing' | 'completed' | 'closed'
priority: 'low' | 'medium' | 'high' | 'critical' priority: 'low' | 'medium' | 'high' | 'critical'