Files
ColaFlow/docs/plans/sprint_1_story_3_task_1.md
Yaojia Wang 08b317e789
Some checks failed
Code Coverage / Generate Coverage Report (push) Has been cancelled
Tests / Run Tests (9.0.x) (push) Has been cancelled
Tests / Docker Build Test (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Add trace files.
2025-11-04 23:28:56 +01:00

2.3 KiB

Task 9: Migrate to ProjectManagement API

Task ID: TASK-009 | Story: STORY-003 | Sprint: Sprint 1 Estimated Hours: 3h | Assignee: Frontend Developer 1 | Priority: P1 | Status: Not Started

Task Description

Update Kanban board to fetch data from ProjectManagement API instead of Issue Management API.

Implementation Steps

  1. Update API calls (1h):
// Before (Issue API)
const { data: issues } = await issueApiClient.getAll(projectId);

// After (ProjectManagement API)
const { data: epics } = await epicApiClient.getAll(projectId);
const { data: stories } = await storyApiClient.getAll(projectId);
const { data: tasks } = await taskApiClient.getAll(projectId);

// Combine into single list for Kanban
const allItems = [...epics, ...stories, ...tasks];
  1. Update KanbanBoard.tsx (1.5h):
export const KanbanBoard: React.FC = () => {
  const { projectId } = useParams();
  const { data: epics } = useEpics(projectId);
  const { data: stories } = useStories(projectId);
  const { data: tasks } = useTasks(projectId);

  const allCards = useMemo(() => {
    return [
      ...(epics || []).map(e => ({ ...e, type: 'Epic' })),
      ...(stories || []).map(s => ({ ...s, type: 'Story' })),
      ...(tasks || []).map(t => ({ ...t, type: 'Task' }))
    ];
  }, [epics, stories, tasks]);

  const cardsByStatus = groupBy(allCards, 'status');

  return (
    <div className="kanban-board">
      <KanbanColumn title="Backlog" cards={cardsByStatus['Backlog']} />
      <KanbanColumn title="Todo" cards={cardsByStatus['Todo']} />
      <KanbanColumn title="InProgress" cards={cardsByStatus['InProgress']} />
      <KanbanColumn title="Done" cards={cardsByStatus['Done']} />
    </div>
  );
};
  1. Test migration (30 min):
  • Verify all cards displayed
  • Check filtering by type (Epic/Story/Task)
  • Verify drag-and-drop still works

Acceptance Criteria

  • Kanban loads data from ProjectManagement API
  • All three types (Epic/Story/Task) displayed
  • Backward compatibility maintained
  • No console errors
  • Tests updated and passing

Deliverables

  1. Updated KanbanBoard.tsx
  2. Updated KanbanCard.tsx
  3. Migration tests passing

Status: Not Started | Created: 2025-11-04