diff --git a/worklenz-frontend/src/components/task-management/improved-task-filters.tsx b/worklenz-frontend/src/components/task-management/improved-task-filters.tsx index dd777df4..8f81687d 100644 --- a/worklenz-frontend/src/components/task-management/improved-task-filters.tsx +++ b/worklenz-frontend/src/components/task-management/improved-task-filters.tsx @@ -56,6 +56,12 @@ import { setBoardLabels, } from '@/features/board/board-slice'; +// Import ConfigPhaseButton and CreateStatusButton components +import ConfigPhaseButton from '@/features/projects/singleProject/phase/ConfigPhaseButton'; +import CreateStatusButton from '@/components/project-task-filters/create-status-button/create-status-button'; +import { useAuthService } from '@/hooks/useAuth'; +import useIsProjectManager from '@/hooks/useIsProjectManager'; + // Performance constants const FILTER_DEBOUNCE_DELAY = 300; // ms const SEARCH_DEBOUNCE_DELAY = 500; // ms @@ -324,6 +330,10 @@ const FilterDropdown: React.FC<{ isDarkMode: boolean; className?: string; }> = ({ section, onSelectionChange, isOpen, onToggle, themeClasses, isDarkMode, className = '' }) => { + // Add permission checks for groupBy section + const isOwnerOrAdmin = useAuthService().isOwnerOrAdmin(); + const isProjectManager = useIsProjectManager(); + const canConfigure = isOwnerOrAdmin || isProjectManager; const [searchTerm, setSearchTerm] = useState(''); const [filteredOptions, setFilteredOptions] = useState(section.options); const dropdownRef = useRef(null); @@ -412,6 +422,14 @@ const FilterDropdown: React.FC<{ /> + {/* Configuration Buttons for GroupBy section */} + {section.id === 'groupBy' && canConfigure && ( +
+ {section.selectedValues[0] === 'phase' && } + {section.selectedValues[0] === 'status' && } +
+ )} + {/* Dropdown Panel */} {isOpen && (
diff --git a/worklenz-frontend/src/pages/TaskManagementDemo.tsx b/worklenz-frontend/src/pages/TaskManagementDemo.tsx deleted file mode 100644 index 836b4a3f..00000000 --- a/worklenz-frontend/src/pages/TaskManagementDemo.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import React, { useEffect } from 'react'; -import { Layout, Typography, Card, Space, Alert } from 'antd'; -import { useDispatch } from 'react-redux'; -import TaskListBoard from '@/components/task-management/task-list-board'; -import { AppDispatch } from '@/app/store'; - -const { Header, Content } = Layout; -const { Title, Paragraph } = Typography; - -const TaskManagementDemo: React.FC = () => { - const dispatch = useDispatch(); - - // Mock project ID for demo - const demoProjectId = 'demo-project-123'; - - useEffect(() => { - // Initialize demo data if needed - // You might want to populate some sample tasks here for demonstration - }, [dispatch]); - - return ( - -
-
- - Enhanced Task Management System - -
-
- - - - {/* Introduction */} - - Task Management Features - - This enhanced task management system provides a comprehensive interface for managing tasks - with the following key features: - -
    -
  • Dynamic Grouping: Group tasks by Status, Priority, or Phase
  • -
  • Drag & Drop: Reorder tasks within groups or move between groups
  • -
  • Multi-select: Select multiple tasks for bulk operations
  • -
  • Bulk Actions: Change status, priority, assignees, or delete multiple tasks
  • -
  • Subtasks: Expandable subtask support with progress tracking
  • -
  • Real-time Updates: Live updates via WebSocket connections
  • -
  • Rich Task Display: Progress bars, assignees, labels, due dates, and more
  • -
-
- - {/* Usage Instructions */} - -

Grouping: Use the dropdown to switch between Status, Priority, and Phase grouping.

-

Drag & Drop: Click and drag tasks to reorder within groups or move between groups.

-

Selection: Click checkboxes to select tasks, then use bulk actions in the blue bar.

-

Subtasks: Click the +/- buttons next to task names to expand/collapse subtasks.

-
- } - type="info" - showIcon - className="mb-4" - /> - - {/* Task List Board */} - - - - - ); -}; - -export default TaskManagementDemo; \ No newline at end of file