Skip to content

feat(grants): Add internal Grants Explorer with Google OAuth#498

Draft
minimalsm wants to merge 4 commits intomasterfrom
feature/private-grants-explorer
Draft

feat(grants): Add internal Grants Explorer with Google OAuth#498
minimalsm wants to merge 4 commits intomasterfrom
feature/private-grants-explorer

Conversation

@minimalsm
Copy link
Contributor

Summary

  • Add internal Grants Explorer at /grants/internal for @ethereum.org team members
  • Implements Google OAuth authentication with domain restriction
  • Shows additional private fields: Cost Center, Evaluator, Budget, Status

Dependencies

Features

  • Google OAuth with @ethereum.org domain restriction
  • Protected route via Next.js middleware
  • Extended Salesforce query with private fields
  • Additional table columns for internal data
  • Logout functionality

Private Fields Displayed

  • Cost Center (from Cost_Center_Lookup__r.Name)
  • Grant Evaluator (from Opportunity_Grant_Evaluator_Lookup__r.Name)
  • Budget (from Amount)
  • Status (from StageName)

Environment Variables Required

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
NEXTAUTH_URL=http://localhost:3000

Test plan

  • Verify /grants/internal redirects to Google OAuth
  • Verify only @ethereum.org emails can access
  • Verify private columns display correct data
  • Test logout functionality
  • Verify unauthorized users see error page

Add a new /grants page that displays funded projects with:
- Dashboard section with fiscal year bar chart, active this month stat, and category donut chart
- Searchable and filterable table with domain/output filters
- Detail modal showing project info, GitHub link, and contact
- ISR data fetching with 1-hour revalidation

Uses mock data when Salesforce credentials unavailable (development/build).
SF field names need verification against actual schema.
- Add client-side pagination (15 items per page)
- Add column sorting (click header to sort A-Z, Z-A, or clear)
- Add clickable domain/output values to filter by that value
- Add year filter dropdown
- Fix Salesforce query pagination to fetch all records
- Switch to calendar year quarters (Jan-Dec)
- Fixed table column widths to prevent layout shift
Add protected /grants/internal route for ESP team members:
- Google OAuth with @ethereum.org domain restriction
- Middleware protecting internal routes
- Extended Salesforce query with private fields
- GrantsTable extended with showPrivateFields prop
- GrantDetailModal shows private fields when authenticated
- Unauthorized page with clear error messages

Private fields include: Cost Center, Grant Evaluator,
Grant Round, Budget Amount, and Status.
- Use Cost_Center_Lookup__r.Name instead of formula field
- Use Opportunity_Grant_Evaluator_Lookup__r.Name for evaluator
- Match June's exact query using CloseDate and correct filters
- Returns 1473 records matching Salesforce query
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.

1 participant