Skip to content

[FE-26] Build DocumentExportButton #523

@mftee

Description

@mftee

Problem

The PDF and Excel export endpoints (BE-16, BE-17) are implemented but unreachable from the UI. Users cannot export their document records for compliance or legal purposes.

Proposed Solution

Create a DocumentExportButton component inside frontend/module/components/export-button/ that provides a dropdown to trigger PDF or Excel exports.

Acceptance Criteria

  • Renders a button labeled Export with a chevron icon that opens a dropdown menu on click
  • Dropdown contains two options: Export as PDF and Export as Excel
  • Export as PDF calls GET /api/module/documents/:id/export/pdf and triggers a browser file download
  • Export as Excel (on the document list page) calls GET /api/module/documents/export/excel and triggers a browser file download
  • Shows a loading spinner on the selected option while the download is being prepared
  • Shows a toast error message if the export request fails
  • Accepts a documentId prop for single-document PDF export; when not provided renders only the Excel option
  • All component files live inside frontend/module/components/export-button/

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions