feat: add PriorityBadge component and integrate into TaskRow
- Implemented PriorityBadge component to display task priority with icons. - Created TaskRow component to represent individual tasks with metadata. - Added breadcrumb navigation for task hierarchy. - Enhanced checkbox component to support indeterminate state. - Introduced InputGroup for better input handling in task search. - Updated tasks route to utilize new components and improve UI. - Added empty state representation for task list.
This commit is contained in:
@@ -230,13 +230,37 @@ const tasksRouter = router({
|
||||
.all();
|
||||
}),
|
||||
|
||||
listAssignees: publicProcedure.query(() => {
|
||||
const rows = getDb()
|
||||
.select({ assignee: tasks.assignee })
|
||||
.from(tasks)
|
||||
.all();
|
||||
const names = new Set<string>();
|
||||
for (const row of rows) {
|
||||
if (!row.assignee) continue;
|
||||
try {
|
||||
const parsed = JSON.parse(row.assignee) as unknown;
|
||||
if (Array.isArray(parsed)) {
|
||||
for (const n of parsed) {
|
||||
if (typeof n === 'string' && n) names.add(n);
|
||||
}
|
||||
} else {
|
||||
names.add(row.assignee);
|
||||
}
|
||||
} catch {
|
||||
names.add(row.assignee);
|
||||
}
|
||||
}
|
||||
return [...names].sort();
|
||||
}),
|
||||
|
||||
create: publicProcedure
|
||||
.input(z.object({
|
||||
title: z.string(),
|
||||
description: z.string().optional(),
|
||||
status: z.string().optional(),
|
||||
priority: z.string().optional(),
|
||||
assignee: z.string().optional(),
|
||||
assignees: z.array(z.string()).optional(),
|
||||
dueDate: z.number().optional(),
|
||||
projectId: z.string().optional(),
|
||||
}))
|
||||
@@ -249,7 +273,7 @@ const tasksRouter = router({
|
||||
description: input.description ?? null,
|
||||
status: input.status ?? 'todo',
|
||||
priority: input.priority ?? 'medium',
|
||||
assignee: input.assignee ?? null,
|
||||
assignee: input.assignees?.length ? JSON.stringify(input.assignees) : null,
|
||||
dueDate: input.dueDate ?? null,
|
||||
projectId: input.projectId ?? null,
|
||||
createdAt: now,
|
||||
@@ -264,7 +288,7 @@ const tasksRouter = router({
|
||||
description: z.string().optional(),
|
||||
status: z.string().optional(),
|
||||
priority: z.string().optional(),
|
||||
assignee: z.string().optional(),
|
||||
assignees: z.array(z.string()).optional(),
|
||||
dueDate: z.number().optional(),
|
||||
projectId: z.string().optional(),
|
||||
}))
|
||||
@@ -282,7 +306,7 @@ const tasksRouter = router({
|
||||
if (input.description !== undefined) set.description = input.description;
|
||||
if (input.status !== undefined) set.status = input.status;
|
||||
if (input.priority !== undefined) set.priority = input.priority;
|
||||
if (input.assignee !== undefined) set.assignee = input.assignee;
|
||||
if (input.assignees !== undefined) set.assignee = input.assignees.length ? JSON.stringify(input.assignees) : null;
|
||||
if (input.dueDate !== undefined) set.dueDate = input.dueDate;
|
||||
if (input.projectId !== undefined) set.projectId = input.projectId;
|
||||
if (Object.keys(set).length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user