refactor(enhanced-kanban): improve code readability and integrate TaskListFilters component
- Refactored EnhancedKanbanBoard and EnhancedKanbanGroup components for better code organization and readability. - Integrated TaskListFilters component to enhance task filtering capabilities within the kanban board. - Cleaned up unnecessary whitespace and improved formatting for consistency across the codebase.
This commit is contained in:
@@ -33,6 +33,8 @@ import EnhancedKanbanTaskCard from './EnhancedKanbanTaskCard';
|
|||||||
import PerformanceMonitor from './PerformanceMonitor';
|
import PerformanceMonitor from './PerformanceMonitor';
|
||||||
import './EnhancedKanbanBoard.css';
|
import './EnhancedKanbanBoard.css';
|
||||||
|
|
||||||
|
// Import the TaskListFilters component
|
||||||
|
const TaskListFilters = React.lazy(() => import('@/pages/projects/projectView/taskList/task-list-filters/task-list-filters'));
|
||||||
interface EnhancedKanbanBoardProps {
|
interface EnhancedKanbanBoardProps {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
@@ -258,7 +260,16 @@ const EnhancedKanbanBoard: React.FC<EnhancedKanbanBoardProps> = ({ projectId, cl
|
|||||||
return (
|
return (
|
||||||
<div className={`enhanced-kanban-board ${className}`}>
|
<div className={`enhanced-kanban-board ${className}`}>
|
||||||
{/* Performance Monitor - only show for large datasets */}
|
{/* Performance Monitor - only show for large datasets */}
|
||||||
{performanceMetrics.totalTasks > 100 && <PerformanceMonitor />}
|
{/* {performanceMetrics.totalTasks > 100 && <PerformanceMonitor />} */}
|
||||||
|
<Card
|
||||||
|
size="small"
|
||||||
|
className="mb-4"
|
||||||
|
styles={{ body: { padding: '12px 16px' } }}
|
||||||
|
>
|
||||||
|
<React.Suspense fallback={<div>Loading filters...</div>}>
|
||||||
|
<TaskListFilters position="board" />
|
||||||
|
</React.Suspense>
|
||||||
|
</Card>
|
||||||
|
|
||||||
{loadingGroups ? (
|
{loadingGroups ? (
|
||||||
<Card>
|
<Card>
|
||||||
@@ -285,7 +296,7 @@ const EnhancedKanbanBoard: React.FC<EnhancedKanbanBoardProps> = ({ projectId, cl
|
|||||||
key={group.id}
|
key={group.id}
|
||||||
group={group}
|
group={group}
|
||||||
activeTaskId={dragState.activeTaskId}
|
activeTaskId={dragState.activeTaskId}
|
||||||
overId={overId}
|
overId={overId as string | null}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -121,12 +121,12 @@ const EnhancedKanbanGroup: React.FC<EnhancedKanbanGroupProps> = React.memo(({
|
|||||||
|
|
||||||
{/* Show drop indicator after last task if dropping at the end */}
|
{/* Show drop indicator after last task if dropping at the end */}
|
||||||
{shouldShowDropIndicators &&
|
{shouldShowDropIndicators &&
|
||||||
index === group.tasks.length - 1 &&
|
index === group.tasks.length - 1 &&
|
||||||
overId === group.id && (
|
overId === group.id && (
|
||||||
<div className="drop-preview-indicator">
|
<div className="drop-preview-indicator">
|
||||||
<div className="drop-line"></div>
|
<div className="drop-line"></div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
))}
|
))}
|
||||||
</SortableContext>
|
</SortableContext>
|
||||||
|
|||||||
Reference in New Issue
Block a user