fix(frontend): Implement Task Edit functionality - Sprint 4 Story 2
Completed the missing Task Edit feature identified as high-priority issue in Sprint 4 testing. Changes: - Created TaskEditDialog component (285 lines) - Full form with title, description, priority, hours fields - React Hook Form + Zod validation - Modal dialog with proper UX (loading states, error handling) - Support for all Task fields (estimated/actual hours) - Integrated TaskEditDialog into TaskCard component - Added isEditDialogOpen state management - Connected Edit menu item to open dialog - Proper event propagation handling Features: - Complete CRUD: Users can now edit existing tasks - Form validation with clear error messages - Optimistic updates via React Query - Toast notifications for success/error - Responsive design matches existing UI Testing: - Frontend compiles successfully with no errors - Component follows existing patterns (Story Form, Task Quick Add) - Consistent with shadcn/ui design system Fixes: Task Edit TODO at task-card.tsx:147 Related: Sprint 4 Story 2 - Task Management Test Report: SPRINT_4_STORY_1-3_FRONTEND_TEST_REPORT.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
Circle
|
||||
} from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { TaskEditDialog } from './task-edit-dialog';
|
||||
|
||||
interface TaskCardProps {
|
||||
task: Task;
|
||||
@@ -45,6 +46,7 @@ const statusColors = {
|
||||
|
||||
export function TaskCard({ task, storyId }: TaskCardProps) {
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
const [isEditDialogOpen, setIsEditDialogOpen] = useState(false);
|
||||
const changeStatus = useChangeTaskStatus();
|
||||
const updateTask = useUpdateTask();
|
||||
const deleteTask = useDeleteTask();
|
||||
@@ -144,7 +146,7 @@ export function TaskCard({ task, storyId }: TaskCardProps) {
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem onClick={() => {/* TODO: Open edit dialog */}}>
|
||||
<DropdownMenuItem onClick={() => setIsEditDialogOpen(true)}>
|
||||
<Pencil className="w-4 h-4 mr-2" />
|
||||
Edit
|
||||
</DropdownMenuItem>
|
||||
@@ -160,6 +162,13 @@ export function TaskCard({ task, storyId }: TaskCardProps) {
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
{/* Edit Dialog */}
|
||||
<TaskEditDialog
|
||||
task={task}
|
||||
open={isEditDialogOpen}
|
||||
onOpenChange={setIsEditDialogOpen}
|
||||
/>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user