Export Preview Panel
Component Detail
Description
Displays a structured summary of the data that will be included in the export before the user confirms: number of peer mentors, total activities by Bufdir category, period, and scope. Fetches preview data from the export edge function without finalising the record.
export-preview-panel
Summaries
The Export Preview Panel protects the organization from costly reporting errors by giving users a clear, structured summary of exactly what data will be submitted to Bufdir before any irreversible action is taken. By surfacing warnings about missing data or unmapped activity types ahead of submission, it reduces the risk of rejected reports and the administrative burden of corrections and resubmissions. This directly supports compliance with Bufdir reporting requirements, safeguards funding relationships, and builds user confidence in the accuracy of submitted records — a critical competitive and operational advantage for peer mentor program administrators.
This is a medium-complexity mobile UI component with a dependency on the bufdir-export-service, meaning its development cannot begin until that service's preview endpoint is stable and tested. The panel must handle asynchronous data fetching, warning state rendering, and scope/period parameterization, all of which require coordination with backend teams. QA should include edge cases for missing data warnings and unmapped activity types. Deployment risk is low in isolation, but integration testing with the export service is essential.
Plan for at least one iteration cycle to validate warning display logic against real data scenarios.
Export Preview Panel is a mobile UI component that calls `loadPreview(scope, period)` against the bufdir-export-service edge function to fetch aggregated preview data without committing any records. It renders activity counts grouped by Bufdir category alongside scope/period metadata and surfaces structured warnings (e.g., unmapped activity types, missing peer mentor data). The `refresh()` interface supports re-fetching after parameter changes. Data models consumed are `activity` and `bufdir-category-mapping`.
State management must handle loading, error, and warning states independently. No write operations occur in this component — it is strictly read-only and preview-scoped.
Responsibilities
- Show aggregated activity counts by Bufdir category
- Display scope and period summary
- Indicate warnings (e.g. missing data, unmapped activity types)
Interfaces
build()
loadPreview(scope, period)
refresh()
onWarningTapped(warning)
getPreviewData()
Relationships
Related Data Entities (1)
Data entities managed by this component