Add new workflow statuses: open, blocked, validate, canceled
This commit is contained in:
parent
77ed1dfd89
commit
af0e467cc1
@ -9,7 +9,7 @@ interface Task {
|
|||||||
title: string;
|
title: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
type: 'idea' | 'task' | 'bug' | 'research' | 'plan';
|
type: 'idea' | 'task' | 'bug' | 'research' | 'plan';
|
||||||
status: 'backlog' | 'in-progress' | 'review' | 'done' | 'archived';
|
status: 'open' | 'backlog' | 'blocked' | 'in-progress' | 'review' | 'validate' | 'archived' | 'canceled' | 'done';
|
||||||
priority: 'low' | 'medium' | 'high' | 'urgent';
|
priority: 'low' | 'medium' | 'high' | 'urgent';
|
||||||
projectId: string;
|
projectId: string;
|
||||||
sprintId?: string;
|
sprintId?: string;
|
||||||
|
|||||||
@ -34,24 +34,24 @@ const priorityColors: Record<Priority, string> = {
|
|||||||
urgent: "text-red-400",
|
urgent: "text-red-400",
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusColumns: TaskStatus[] = ["backlog", "in-progress", "review", "done"]
|
const allStatuses: TaskStatus[] = ["open", "backlog", "blocked", "in-progress", "review", "validate", "archived", "canceled", "done"]
|
||||||
|
|
||||||
// Sprint board columns mapped to workflow statuses
|
// Sprint board columns mapped to workflow statuses
|
||||||
const sprintColumns = [
|
const sprintColumns = [
|
||||||
{
|
{
|
||||||
key: "todo",
|
key: "todo",
|
||||||
label: "To Do",
|
label: "To Do",
|
||||||
statuses: ["backlog"] // OPEN, TO DO
|
statuses: ["open", "backlog"] // OPEN, TO DO
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "inprogress",
|
key: "inprogress",
|
||||||
label: "In Progress",
|
label: "In Progress",
|
||||||
statuses: ["in-progress", "review"] // BLOCKED, IN PROGRESS, REVIEW, VALIDATE
|
statuses: ["blocked", "in-progress", "review", "validate"] // BLOCKED, IN PROGRESS, REVIEW, VALIDATE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "done",
|
key: "done",
|
||||||
label: "Done",
|
label: "Done",
|
||||||
statuses: ["done", "archived"] // ARCHIVED, CANCELED, DONE
|
statuses: ["archived", "canceled", "done"] // ARCHIVED, CANCELED, DONE
|
||||||
},
|
},
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
@ -483,8 +483,8 @@ export default function Home() {
|
|||||||
onChange={(e) => setNewTask({ ...newTask, status: e.target.value as TaskStatus })}
|
onChange={(e) => setNewTask({ ...newTask, status: e.target.value as TaskStatus })}
|
||||||
className="w-full mt-1.5 px-3 py-2 bg-slate-800 border border-slate-700 rounded-lg text-white focus:outline-none focus:border-blue-500"
|
className="w-full mt-1.5 px-3 py-2 bg-slate-800 border border-slate-700 rounded-lg text-white focus:outline-none focus:border-blue-500"
|
||||||
>
|
>
|
||||||
{statusColumns.map((status) => (
|
{allStatuses.map((status) => (
|
||||||
<option key={status} value={status}>{status.replace("-", " ")}</option>
|
<option key={status} value={status}>{status.replace("-", " ").toUpperCase()}</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -593,21 +593,15 @@ export default function Home() {
|
|||||||
{/* Status */}
|
{/* Status */}
|
||||||
<div>
|
<div>
|
||||||
<Label className="text-slate-400">Status</Label>
|
<Label className="text-slate-400">Status</Label>
|
||||||
<div className="flex gap-2 mt-2">
|
<select
|
||||||
{statusColumns.map((status) => (
|
value={selectedTask.status}
|
||||||
<button
|
onChange={(e) => handleUpdateTaskStatus(selectedTask.id, e.target.value as TaskStatus)}
|
||||||
key={status}
|
className="w-full mt-2 px-3 py-2 bg-slate-800 border border-slate-700 rounded-lg text-white focus:outline-none focus:border-blue-500"
|
||||||
onClick={() => handleUpdateTaskStatus(selectedTask.id, status)}
|
>
|
||||||
className={`px-3 py-1.5 rounded-lg text-sm transition-colors ${
|
{allStatuses.map((status) => (
|
||||||
selectedTask.status === status
|
<option key={status} value={status}>{status.replace("-", " ").toUpperCase()}</option>
|
||||||
? "bg-blue-600 text-white"
|
|
||||||
: "bg-slate-800 text-slate-400 hover:bg-slate-700"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{status.replace("-", " ")}
|
|
||||||
</button>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Sprint */}
|
{/* Sprint */}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { create } from 'zustand'
|
|||||||
import { persist } from 'zustand/middleware'
|
import { persist } from 'zustand/middleware'
|
||||||
|
|
||||||
export type TaskType = 'idea' | 'task' | 'bug' | 'research' | 'plan'
|
export type TaskType = 'idea' | 'task' | 'bug' | 'research' | 'plan'
|
||||||
export type TaskStatus = 'backlog' | 'in-progress' | 'review' | 'done' | 'archived'
|
export type TaskStatus = 'open' | 'backlog' | 'blocked' | 'in-progress' | 'review' | 'validate' | 'archived' | 'canceled' | 'done'
|
||||||
export type Priority = 'low' | 'medium' | 'high' | 'urgent'
|
export type Priority = 'low' | 'medium' | 'high' | 'urgent'
|
||||||
export type SprintStatus = 'planning' | 'active' | 'completed'
|
export type SprintStatus = 'planning' | 'active' | 'completed'
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user