From d326e80082a3002842f571e5971ebc14e9ce2930 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Thu, 23 Apr 2026 10:01:54 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20FE-User:=20t=C3=A1ch=20T=E1=BB=95ng?= =?UTF-8?q?=20quan=20th=C3=A0nh=20/dashboard=20ri=C3=AAng=20(fix=20bug=20t?= =?UTF-8?q?r=C3=B9ng=20/inbox)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: Layout resolvePath map "Dashboard" key → "/inbox" cũ (coi inbox là home), khiến menu "Tổng quan" và "Hộp thư" cùng navigate về /inbox → user thấy interface giống nhau, không phân biệt được. Fix: - Tạo UserDashboardPage.tsx — overview cá nhân: * Greeting với fullName * 5-card "Của tôi" row (HĐ đang soạn / Chờ tôi duyệt / Sắp quá hạn / Đã quá hạn / Tổng giá trị nháp) — dùng /api/reports/my-dashboard có sẵn * Card click navigate vào page tương ứng (/my-contracts hoặc /inbox) * Section HĐ gần đây — list 5 row với click → /my-contracts?id=X - App.tsx: thêm route /dashboard + redirect "/" sang /dashboard - Layout.tsx: Dashboard → /dashboard, logo link cũng chuyển về /dashboard Build: tsc + vite pass (439ms) Co-Authored-By: Claude Opus 4.7 (1M context) --- fe-user/src/App.tsx | 4 +- fe-user/src/components/Layout.tsx | 4 +- fe-user/src/pages/UserDashboardPage.tsx | 203 ++++++++++++++++++++++++ 3 files changed, 208 insertions(+), 3 deletions(-) create mode 100644 fe-user/src/pages/UserDashboardPage.tsx diff --git a/fe-user/src/App.tsx b/fe-user/src/App.tsx index 8999b3c..40d268d 100644 --- a/fe-user/src/App.tsx +++ b/fe-user/src/App.tsx @@ -4,6 +4,7 @@ import { AuthProvider } from '@/contexts/AuthContext' import { ProtectedRoute } from '@/components/ProtectedRoute' import { Layout } from '@/components/Layout' import { LoginPage } from '@/pages/LoginPage' +import { UserDashboardPage } from '@/pages/UserDashboardPage' import { InboxPage } from '@/pages/InboxPage' import { ContractCreatePage } from '@/pages/contracts/ContractCreatePage' import { ContractDetailPage } from '@/pages/contracts/ContractDetailPage' @@ -22,11 +23,12 @@ function App() { } > + } /> } /> } /> } /> } /> - } /> + } /> = { - Dashboard: '/inbox', // user home = inbox + Dashboard: '/dashboard', // Tổng quan riêng — KHÔNG trùng /inbox (Hộp thư) Contracts: '/my-contracts', } if (staticMap[key]) return staticMap[key] @@ -228,7 +228,7 @@ export function Layout() {