From ea89138e717c3076603a8c982e185c443efdf2d9 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 05:22:52 +0200 Subject: [PATCH] feat(project-detail-page): Project-Detail: zeigt Customer + alle TimeEntries des Projek [tsc:ok] --- .phase5-state.json | 5 +- GENERATION_LOG.md | 10 ++++ apps/web/src/pages/ProjectDetail.tsx | 88 ++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 apps/web/src/pages/ProjectDetail.tsx diff --git a/.phase5-state.json b/.phase5-state.json index 0bb1f23..93c434d 100644 --- a/.phase5-state.json +++ b/.phase5-state.json @@ -1,7 +1,8 @@ { "completed_features": [ - "dark-mode-toggle" + "dark-mode-toggle", + "customer-detail-page" ], - "current_feature": "customer-detail-page", + "current_feature": "project-detail-page", "started_at": "2026-05-23T05:20:11.407108" } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 871efa1..f000128 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -561,3 +561,13 @@ undefined - `05:22:17` **INFO** wrote 5138 chars in 39.8s (attempt 1) - `05:22:17` **INFO** Running tsc --noEmit on api… - `05:22:18` **INFO** tsc clean ✓ +- `05:22:18` **INFO** Committed feature customer-detail-page +- `05:22:19` **INFO** Pushed: rc=0 + +## Phase-3 Feature: project-detail-page (2026-05-23 05:22:19) + +- `05:22:19` **INFO** Description: Project-Detail: zeigt Customer + alle TimeEntries des Projekts +- `05:22:19` **INFO** Generating apps/web/src/pages/ProjectDetail.tsx (ProjectDetail-Page. Header: name + linked customer. Section: TimeEntri…) +- `05:22:50` **INFO** wrote 3762 chars in 31.4s (attempt 1) +- `05:22:50` **INFO** Running tsc --noEmit on api… +- `05:22:52` **INFO** tsc clean ✓ diff --git a/apps/web/src/pages/ProjectDetail.tsx b/apps/web/src/pages/ProjectDetail.tsx new file mode 100644 index 0000000..c38565e --- /dev/null +++ b/apps/web/src/pages/ProjectDetail.tsx @@ -0,0 +1,88 @@ +import { useQuery } from "@tanstack/react-query" +import { useParams, Link } from "@tanstack/react-router" +import { api } from "../lib/api" + +export default function ProjectDetail() { + const { projectId } = useParams({ strict: false }) + + const { data: project, isLoading: projectLoading, isError: projectError } = useQuery({ + queryKey: ["project", projectId], + queryFn: () => api.getProject(projectId!), + enabled: !!projectId, + }) + + const { data: entries, isLoading: entriesLoading } = useQuery({ + queryKey: ["timeEntries", projectId], + queryFn: () => api.listTimeEntries({ projectId: projectId! }), + enabled: !!projectId, + }) + + if (projectLoading || entriesLoading) { + return
Loading project details...
+ } + + if (projectError || !project) { + return
Project not found or error loading data.
+ } + + const totalHours = entries?.reduce((sum: number, entry: any) => sum + (entry.hours || 0), 0) || 0 + + return ( +
+
+
+ + ← Back to Projects + +

{project.name}

+

+ Customer: {project.customer?.name || "Unknown"} +

+
+
+ Total Hours + {totalHours.toFixed(2)}h +
+
+ +
+
+

Time Entries

+
+ +
+ + + + + + + + + + {entries && entries.length > 0 ? ( + entries.map((entry: any) => ( + + + + + + )) + ) : ( + + + + )} + +
DateDescriptionHours
+ {new Date(entry.date).toLocaleDateString()} + {entry.description} + {entry.hours}h +
+ No time entries recorded for this project yet. +
+
+
+
+ ) +} \ No newline at end of file