From 12424bfb5793a5d4d8e8eb773f8dc010e61be597 Mon Sep 17 00:00:00 2001 From: tuanOts Date: Sat, 31 May 2025 16:08:04 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Enhance=20Project=20Tracker=20Statu?= =?UTF-8?q?s=20Display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🎨 Features Added: - Beautiful color-coded status display with icons - 5 status types: Planning, Completed, Pending, In Progress, On Hold - Modern rounded design with background colors and borders - Icon integration for better visual identification - Enhanced filter dropdown with status icons - Improved pagination spacing and layout 🔧 Technical Improvements: - Replaced simple Tag with custom styled status component - Added getStatusConfig function for flexible status management - Updated status rendering with proper color schemes - Consistent styling across light/dark themes - Better UX with professional appearance 📋 Status Color Scheme: - Planning: Blue (#1890ff) with 📋 icon - Completed: Green (#52c41a) with ✅ icon - Pending: Orange (#faad14) with ⏳ icon - In Progress: Purple (#722ed1) with 🚀 icon - On Hold: Red (#f5222d) with ⏸️ icon --- .../projects/projecttracker.jsx | 341 +++++------------- 1 file changed, 93 insertions(+), 248 deletions(-) diff --git a/src/feature-module/projects/projecttracker.jsx b/src/feature-module/projects/projecttracker.jsx index b910bea..ca7f52e 100644 --- a/src/feature-module/projects/projecttracker.jsx +++ b/src/feature-module/projects/projecttracker.jsx @@ -72,7 +72,7 @@ const ProjectTracker = () => { progress: project.progressPercentage, deadline: dayjs(project.endDate).format('DD MMM YYYY'), status: formatStatus(project.status), - statusColor: getStatusColor(project.status), + statusConfig: getStatusConfig(project.status), priority: project.priority, starred: false, budget: `$${project.budget.toLocaleString()}`, @@ -124,15 +124,48 @@ const ProjectTracker = () => { return colorMap[categoryName] || 'blue'; }; - const getStatusColor = (status) => { - const colorMap = { - 'planning': 'default', - 'in-progress': 'warning', - 'review': 'processing', - 'completed': 'success', - 'on-hold': 'error' + const getStatusConfig = (status) => { + const statusLower = (status || 'planning').toLowerCase().replace(/\s+/g, '').replace(/-/g, ''); + + const statusConfigs = { + 'planning': { + color: '#1890ff', + backgroundColor: 'rgba(24, 144, 255, 0.1)', + borderColor: '#1890ff', + textColor: '#1890ff', + icon: '📋' + }, + 'completed': { + color: '#52c41a', + backgroundColor: 'rgba(82, 196, 26, 0.1)', + borderColor: '#52c41a', + textColor: '#52c41a', + icon: '✅' + }, + 'pending': { + color: '#faad14', + backgroundColor: 'rgba(250, 173, 20, 0.1)', + borderColor: '#faad14', + textColor: '#faad14', + icon: '⏳' + }, + 'inprogress': { + color: '#722ed1', + backgroundColor: 'rgba(114, 46, 209, 0.1)', + borderColor: '#722ed1', + textColor: '#722ed1', + icon: '🚀' + }, + 'onhold': { + color: '#f5222d', + backgroundColor: 'rgba(245, 34, 45, 0.1)', + borderColor: '#f5222d', + textColor: '#f5222d', + icon: '⏸️' + } }; - return colorMap[status] || 'default'; + + return statusConfigs[statusLower] || statusConfigs['planning']; }; const formatStatus = (status) => { @@ -253,7 +286,7 @@ const ProjectTracker = () => { ) }, { - title: 'Progress', + title: 'Tiến độ', dataIndex: 'progress', key: 'progress', render: (progress) => ( @@ -279,22 +312,33 @@ const ProjectTracker = () => { ) }, { - title: 'Status', + title: 'Trạng thái', dataIndex: 'status', key: 'status', - render: (status, record) => ( - - {status} - - ) + render: (status, record) => { + const config = record.statusConfig || getStatusConfig(status); + return ( +
+ {config.icon} + {status} +
+ ); + } }, { title: 'Budget', @@ -363,7 +407,7 @@ const ProjectTracker = () => { Project Lists - +
@@ -412,10 +456,11 @@ const ProjectTracker = () => { style={{ width: 140, height: 42 }} > - - - - + + + + +