---
description: "Development tasks for Migration Plugin Dashboard Grid"
---

# Development Tasks: Migration Plugin Dashboard Grid

**Role**: Developer Agent
**Goal**: Implement the logic defined in the architecture contracts.

## Phase 1: Backend Implementation

- [x] D001 [US1] Implement `SupersetClient.get_dashboards_summary` in `backend/src/core/superset_client.py`
    - **Context**: Fetch dashboards from Superset API with specific columns (`id`, `dashboard_title`, `changed_on_utc`, `published`).
    - **Input**: None (uses instance config).
    - **Output**: List of dictionaries mapped to `DashboardMetadata` fields.

- [x] D002 [US1] Implement `get_dashboards` endpoint in `backend/src/api/routes/migration.py`
    - **Context**: Initialize `SupersetClient` with environment config and call `get_dashboards_summary`.
    - **Input**: `env_id` (path param).
    - **Output**: JSON list of `DashboardMetadata`.

- [x] D003 [US1] Implement `execute_migration` endpoint in `backend/src/api/routes/migration.py`
    - **Context**: Validate selection and initiate migration task (placeholder or TaskManager integration).
    - **Input**: `DashboardSelection` body.
    - **Output**: Task ID and status message.

## Phase 2: Frontend Implementation

- [x] D004 [US1] Implement `DashboardGrid.svelte` logic
    - **Context**: `frontend/src/components/DashboardGrid.svelte`
    - **Requirements**:
        - Client-side pagination (default 20 items).
        - Sorting by Title, Last Modified, Status.
        - Text filtering (search by title).
        - Multi-selection with "Select All" capability.
        - Emit selection events.

- [x] D005 [US1] Integrate `DashboardGrid` into Migration Page
    - **Context**: `frontend/src/routes/migration/+page.svelte`
    - **Requirements**:
        - Fetch dashboards when `sourceEnvId` changes.
        - Bind `dashboards` data to `DashboardGrid`.
        - Bind `selectedDashboardIds`.
        - Update `startMigration` to send `selectedDashboardIds` to backend.

## Phase 3: Verification

- [ ] D006 Verify Dashboard Grid functionality (Sort, Filter, Page).
- [ ] D007 Verify API integration (Fetch dashboards, Start migration).