diff --git a/artifacts/api-server/src/routes/quickEntry.ts b/artifacts/api-server/src/routes/quickEntry.ts index 5e64a89..9257bde 100644 --- a/artifacts/api-server/src/routes/quickEntry.ts +++ b/artifacts/api-server/src/routes/quickEntry.ts @@ -15,7 +15,7 @@ router.post("/quick-entry", async (req, res): Promise => { return; } - const { projectId, hours, collaborator } = parsed.data; + const { projectId, hours, collaborator, description } = parsed.data; const rawDate = parsed.data.date; const dateStr = rawDate instanceof Date ? rawDate.toISOString().split("T")[0] @@ -87,14 +87,14 @@ router.post("/quick-entry", async (req, res): Promise => { } else { [entry] = await db .update(timeEntriesTable) - .set({ hours }) + .set({ hours, description: description ?? existing.description }) .where(eq(timeEntriesTable.id, existing.id)) .returning(); } } else if (hours > 0) { [entry] = await db .insert(timeEntriesTable) - .values({ timesheetLineId: line.id, date: dateStr, hours }) + .values({ timesheetLineId: line.id, date: dateStr, hours, description: description ?? null }) .returning(); } else { entry = { id: 0, timesheetLineId: line.id, date: dateStr, hours: 0 }; diff --git a/artifacts/cra-app/src/components/layout/layout.tsx b/artifacts/cra-app/src/components/layout/layout.tsx index aa42483..31f2c2e 100644 --- a/artifacts/cra-app/src/components/layout/layout.tsx +++ b/artifacts/cra-app/src/components/layout/layout.tsx @@ -1,17 +1,13 @@ import { AppSidebar } from "./sidebar"; -import { QuickEntryButton } from "@/components/quick-entry"; export function AppLayout({ children }: { children: React.ReactNode }) { return (
-
+
{children}
-
- -
); diff --git a/artifacts/cra-app/src/components/layout/sidebar.tsx b/artifacts/cra-app/src/components/layout/sidebar.tsx index 21c4484..e4654fa 100644 --- a/artifacts/cra-app/src/components/layout/sidebar.tsx +++ b/artifacts/cra-app/src/components/layout/sidebar.tsx @@ -1,6 +1,7 @@ import { Link, useLocation } from "wouter"; -import { LayoutDashboard, Clock, FolderKanban, Settings } from "lucide-react"; +import { LayoutDashboard, Clock, FolderKanban, Zap } from "lucide-react"; import { cn } from "@/lib/utils"; +import { QuickEntryButton } from "@/components/quick-entry"; const navItems = [ { @@ -51,6 +52,10 @@ export function AppSidebar() { ); })} + +
+ +
diff --git a/artifacts/cra-app/src/components/quick-entry.tsx b/artifacts/cra-app/src/components/quick-entry.tsx index 2be13f0..5b5d6e1 100644 --- a/artifacts/cra-app/src/components/quick-entry.tsx +++ b/artifacts/cra-app/src/components/quick-entry.tsx @@ -25,6 +25,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { Textarea } from "@/components/ui/textarea"; import { useToast } from "@/hooks/use-toast"; import { Zap, Clock, Check } from "lucide-react"; import { format } from "date-fns"; @@ -38,14 +39,14 @@ export function QuickEntryButton() { return ( <> - + ); @@ -61,6 +62,7 @@ function QuickEntryDialog({ const [projectId, setProjectId] = useState(""); const [date, setDate] = useState(format(new Date(), "yyyy-MM-dd")); const [hours, setHours] = useState(1); + const [description, setDescription] = useState(""); const [success, setSuccess] = useState(false); const [lastEntry, setLastEntry] = useState<{ projectName: string; @@ -92,6 +94,7 @@ function QuickEntryDialog({ date, hours, collaborator: COLLABORATOR, + description: description.trim() || undefined, }, }, { @@ -133,6 +136,7 @@ function QuickEntryDialog({ setSuccess(false); setProjectId(""); setHours(1); + setDescription(""); setDate(format(new Date(), "yyyy-MM-dd")); onOpenChange(false); }; @@ -141,6 +145,7 @@ function QuickEntryDialog({ setSuccess(false); setProjectId(""); setHours(1); + setDescription(""); }; const activeProjects = projects?.filter((p) => p.isActive) ?? []; @@ -258,9 +263,22 @@ function QuickEntryDialog({
+
+ +