mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-16 14:49:09 +02:00
Add priority field (urgent/high/medium/low/none) to projects, matching the existing issue priority system. Includes database migration, API support for create/update/list filtering, and UI for the create dialog, project list table, and project detail page.
40 lines
1.9 KiB
TypeScript
40 lines
1.9 KiB
TypeScript
import type { ProjectStatus, ProjectPriority } from "../types";
|
|
|
|
export const PROJECT_STATUS_ORDER: ProjectStatus[] = [
|
|
"planned",
|
|
"in_progress",
|
|
"paused",
|
|
"completed",
|
|
"cancelled",
|
|
];
|
|
|
|
export const PROJECT_STATUS_CONFIG: Record<
|
|
ProjectStatus,
|
|
{ label: string; color: string; dotColor: string; badgeBg: string; badgeText: string }
|
|
> = {
|
|
planned: { label: "Planned", color: "text-muted-foreground", dotColor: "bg-muted-foreground", badgeBg: "bg-muted", badgeText: "text-muted-foreground" },
|
|
in_progress: { label: "In Progress", color: "text-warning", dotColor: "bg-warning", badgeBg: "bg-warning", badgeText: "text-white" },
|
|
paused: { label: "Paused", color: "text-muted-foreground", dotColor: "bg-muted-foreground", badgeBg: "bg-muted", badgeText: "text-muted-foreground" },
|
|
completed: { label: "Completed", color: "text-info", dotColor: "bg-info", badgeBg: "bg-info", badgeText: "text-white" },
|
|
cancelled: { label: "Cancelled", color: "text-destructive", dotColor: "bg-destructive", badgeBg: "bg-muted", badgeText: "text-muted-foreground" },
|
|
};
|
|
|
|
export const PROJECT_PRIORITY_ORDER: ProjectPriority[] = [
|
|
"urgent",
|
|
"high",
|
|
"medium",
|
|
"low",
|
|
"none",
|
|
];
|
|
|
|
export const PROJECT_PRIORITY_CONFIG: Record<
|
|
ProjectPriority,
|
|
{ label: string; bars: number; color: string; badgeBg: string; badgeText: string }
|
|
> = {
|
|
urgent: { label: "Urgent", bars: 4, color: "text-destructive", badgeBg: "bg-priority", badgeText: "text-white" },
|
|
high: { label: "High", bars: 3, color: "text-warning", badgeBg: "bg-priority/80", badgeText: "text-white" },
|
|
medium: { label: "Medium", bars: 2, color: "text-warning", badgeBg: "bg-priority/15", badgeText: "text-priority" },
|
|
low: { label: "Low", bars: 1, color: "text-info", badgeBg: "bg-priority/10", badgeText: "text-priority" },
|
|
none: { label: "No priority", bars: 0, color: "text-muted-foreground", badgeBg: "bg-muted", badgeText: "text-muted-foreground" },
|
|
};
|