Skip to content

[FE-17] Implement PDF export for single asset report in opsce folder #782

@yusuftomilola

Description

@yusuftomilola

Problem

Individual asset PDF reports (BE-24) cannot be downloaded from the UI. The asset detail page has no export functionality despite jsPDF being installed on the frontend.

Proposed Solution

Create frontend/opsce/features/assets/DownloadAssetReportButton.tsx. Call GET /api/assets/:id/report and trigger a file download.

Acceptance Criteria

  • Button labeled "Download Report" shown on the asset detail page header
  • Clicking calls GET /api/assets/:id/report and downloads the returned PDF
  • Downloaded filename: asset-report-{serialNumber}-{date}.pdf
  • Loading spinner shown on the button while the request is in progress
  • On error, shows a toast: "Failed to generate report. Please try again."
  • Button is only visible to ADMIN and MANAGER roles (hidden for VIEWER)

Metadata

Metadata

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