Skip to content

feat: add grant export feature (JSON and CSV)#394

Open
zeroknowledge0x wants to merge 2 commits into
PhasoraLabs:mainfrom
zeroknowledge0x:feat/grant-export
Open

feat: add grant export feature (JSON and CSV)#394
zeroknowledge0x wants to merge 2 commits into
PhasoraLabs:mainfrom
zeroknowledge0x:feat/grant-export

Conversation

@zeroknowledge0x

Copy link
Copy Markdown

Summary

Adds export functionality to the Grant Detail page, allowing users to download grant data as JSON or CSV without a wallet connection.

Changes

  • **** — New utility module with three export functions:

    • exportGrantAsJSON(grant, milestones) — Downloads grant + milestone data as formatted JSON
    • exportGrantAsCSV(grant, milestones) — Downloads milestones as CSV
    • exportFundersAsCSV(funders) — Downloads funders as CSV
    • All BigInt values serialized as strings (no [object BigInt] issues)
    • File names use grant ID and slugged title
  • **** — Dropdown button component:

    • Matches existing design system (border style, accent colors)
    • Closes on outside click
    • Keyboard accessible with ARIA attributes
    • Shows funders option only when funders data is available
  • **** — Integration:

    • ExportButton added to grant header alongside status badge
    • Works without wallet connection (read-only feature)

Testing

  • "Export as JSON" downloads a JSON file with grant and milestone data
  • "Export milestones as CSV" downloads a correctly formatted CSV
  • BigInt values are serialized as strings in JSON
  • File names include grant ID and slugged title
  • Export works without a wallet connection

Related Issues

Fixes #388

Add export functionality to the Grant Detail page allowing users to
download grant data without a wallet connection.

Changes:
- Create lib/utils/export.ts with exportGrantAsJSON, exportGrantAsCSV,
  and exportFundersAsCSV functions
- Create components/grants/ExportButton.tsx dropdown component
- Add ExportButton to Grant Detail page header

Acceptance criteria:
- Export as JSON downloads grant + milestone data with BigInt as strings
- Export milestones as CSV downloads correctly formatted CSV
- File naming uses grant ID and slugged title
- Works without wallet connection (read-only)

Fixes PhasoraLabs#388
Convert FunderRow[] to FunderRecord[] at the ExportButton call site
by adding default token ('native') and timestamp (null) values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build Grant Export Feature (CSV and JSON)

1 participant