Frontend: dynamic status pipeline, categories/projects, tag+assign+reallocate UI
- Board/List/Today views now render the admin-editable status pipeline instead of a hardcoded todo/doing/done enum (StatusesContext) - Category filter chip-bar on Board and List views (ported the idea from reviewing the FD's own build, simplified to match our flat single-category model rather than his tree) - New Projects list + detail views, project create/edit modal - New Dispatch view for the 'reallocate' cap -- flat cross-user task list with an inline move action (deliberately not routed through the shared task drawer, since GET /api/tasks/:id only grants visibility to owner/assignee/tagged users, not dispatchers) - Task drawer: dynamic status pills, category/project selects, tag picker (share/watch, no cap needed), assign field (owner + assign cap), reallocate field (reallocate cap) -- all fields disabled for non-owners since the backend's single PATCH endpoint is owner-gated - Settings page: status pipeline + category management (settings cap) - Fixed missing input[type="datetime-local"]/[type="time"] styling -- the Due/Remind fields were rendering with unstyled browser defaults
This commit is contained in:
parent
d8dc4e2b81
commit
017f6dfdc1
19 changed files with 1008 additions and 71 deletions
|
|
@ -1,13 +1,12 @@
|
|||
export type Priority = 'low' | 'medium' | 'high'
|
||||
export type Status = 'todo' | 'doing' | 'done'
|
||||
// Status is now an admin-editable pipeline (see AppStatus below), not a fixed
|
||||
// enum — the string is whatever `statuses.value` the admin has configured.
|
||||
export type Status = string
|
||||
export type RecurRule = 'daily' | 'weekdays' | 'weekly' | 'monthly'
|
||||
|
||||
export const PRIORITIES: Priority[] = ['low', 'medium', 'high']
|
||||
export const PRIORITY_LABELS: Record<Priority, string> = { low: 'Low', medium: 'Medium', high: 'High' }
|
||||
|
||||
export const STATUSES: Status[] = ['todo', 'doing', 'done']
|
||||
export const STATUS_LABELS: Record<Status, string> = { todo: 'To do', doing: 'Doing', done: 'Done' }
|
||||
|
||||
export const RECUR_RULES: RecurRule[] = ['daily', 'weekdays', 'weekly', 'monthly']
|
||||
export const RECUR_LABELS: Record<RecurRule, string> = {
|
||||
daily: 'Every day',
|
||||
|
|
@ -34,10 +33,12 @@ export interface List {
|
|||
|
||||
export interface Task {
|
||||
id: number
|
||||
list_id: number
|
||||
list_id: number | null
|
||||
owner_id: string
|
||||
created_by: string
|
||||
assigned_to: string | null
|
||||
category_id: number | null
|
||||
project_id: number | null
|
||||
title: string
|
||||
notes: string | null
|
||||
status: Status
|
||||
|
|
@ -53,10 +54,57 @@ export interface Task {
|
|||
// joined / derived
|
||||
list_name?: string
|
||||
list_colour?: string
|
||||
status_label?: string
|
||||
is_done?: boolean
|
||||
is_hold?: boolean
|
||||
category_name?: string
|
||||
category_colour?: string
|
||||
project_name?: string
|
||||
project_colour?: string
|
||||
item_count?: number
|
||||
item_done?: number
|
||||
}
|
||||
|
||||
export interface AppStatus {
|
||||
id: number
|
||||
label: string
|
||||
value: string
|
||||
position: number
|
||||
is_done: boolean
|
||||
is_hold: boolean
|
||||
}
|
||||
|
||||
export interface Category {
|
||||
id: number
|
||||
name: string
|
||||
colour: string
|
||||
sort_order: number
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
id: number
|
||||
created_by: string
|
||||
name: string
|
||||
description: string | null
|
||||
colour: string
|
||||
is_archived: boolean
|
||||
sort_order: number
|
||||
created_at: string
|
||||
task_count?: number
|
||||
done_count?: number
|
||||
}
|
||||
|
||||
export interface ProjectDetail extends Project {
|
||||
tasks: Task[]
|
||||
}
|
||||
|
||||
export interface TaskTagEntry {
|
||||
user_email: string
|
||||
tagged_by: string
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export interface TaskItem {
|
||||
id: number
|
||||
task_id: number
|
||||
|
|
@ -77,6 +125,7 @@ export interface TaskComment {
|
|||
export interface TaskDetail extends Task {
|
||||
items: TaskItem[]
|
||||
comments: TaskComment[]
|
||||
tags: TaskTagEntry[]
|
||||
}
|
||||
|
||||
export interface AppConfig {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue