From 256f1eb3a987cd0313e63227ad8f011c6f4190b5 Mon Sep 17 00:00:00 2001 From: chamikaJ Date: Tue, 22 Jul 2025 12:46:09 +0530 Subject: [PATCH] feat(task-list): enhance empty state display in task list component - Added EmptyListPlaceholder component to visually represent the empty state in the task list. - Adjusted styling and layout for the empty group drop zone to improve user experience. - Removed unused progress properties from the task group data structure for cleaner code. --- .../src/components/EmptyListPlaceholder.tsx | 11 +++++++-- .../task-list-v2/TaskListV2Table.tsx | 24 +++++++------------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/worklenz-frontend/src/components/EmptyListPlaceholder.tsx b/worklenz-frontend/src/components/EmptyListPlaceholder.tsx index dfe1aa76..58cf691e 100644 --- a/worklenz-frontend/src/components/EmptyListPlaceholder.tsx +++ b/worklenz-frontend/src/components/EmptyListPlaceholder.tsx @@ -1,17 +1,24 @@ import { Empty, Typography } from 'antd'; import React from 'react'; +import { useTranslation } from 'react-i18next'; type EmptyListPlaceholderProps = { imageSrc?: string; imageHeight?: number; - text: string; + text?: string; + textKey?: string; + i18nNs?: string; }; const EmptyListPlaceholder = ({ imageSrc = 'https://s3.us-west-2.amazonaws.com/worklenz.com/assets/empty-box.webp', imageHeight = 60, text, + textKey, + i18nNs = 'task-list-table', }: EmptyListPlaceholderProps) => { + const { t } = useTranslation(i18nNs); + const description = textKey ? t(textKey) : text; return ( {text}} + description={{description}} /> ); }; diff --git a/worklenz-frontend/src/components/task-list-v2/TaskListV2Table.tsx b/worklenz-frontend/src/components/task-list-v2/TaskListV2Table.tsx index 1cc6c680..2c810cec 100644 --- a/worklenz-frontend/src/components/task-list-v2/TaskListV2Table.tsx +++ b/worklenz-frontend/src/components/task-list-v2/TaskListV2Table.tsx @@ -67,6 +67,7 @@ import AddTaskRow from './components/AddTaskRow'; import { AddCustomColumnButton, CustomColumnHeader } from './components/CustomColumnComponents'; import TaskListSkeleton from './components/TaskListSkeleton'; import ConvertToSubtaskDrawer from '@/components/task-list-common/convert-to-subtask-drawer/convert-to-subtask-drawer'; +import EmptyListPlaceholder from '@/components/EmptyListPlaceholder'; // Empty Group Drop Zone Component const EmptyGroupDropZone: React.FC<{ @@ -89,8 +90,9 @@ const EmptyGroupDropZone: React.FC<{ className={`relative w-full transition-colors duration-200 ${ isOver && active ? 'bg-blue-50 dark:bg-blue-900/20' : '' }`} + style={{ minHeight: 80 }} > -
+
{visibleColumns.map((column, index) => { const emptyColumnStyle = { width: column.width, @@ -105,16 +107,12 @@ const EmptyGroupDropZone: React.FC<{ ); })}
-
-
- {isOver && active ? t('dropTaskHere') || 'Drop task here' : t('noTasksInGroup')} -
+ {/* Left-aligned visually appealing empty state */} +
+
{isOver && active && (
@@ -551,10 +549,6 @@ const TaskListV2Section: React.FC = () => { name: group.title, count: group.actualCount, color: group.color, - todo_progress: group.todo_progress, - doing_progress: group.doing_progress, - done_progress: group.done_progress, - groupType: group.groupType, }} isCollapsed={isGroupCollapsed} onToggle={() => handleGroupCollapse(group.id)}