Skip to content

Implement grantee report submission system and bot integration (take 3)#434

Closed
BoltTouring wants to merge 1 commit into
masterfrom
fix/grantee-reports-clean-2
Closed

Implement grantee report submission system and bot integration (take 3)#434
BoltTouring wants to merge 1 commit into
masterfrom
fix/grantee-reports-clean-2

Conversation

@BoltTouring
Copy link
Copy Markdown
Contributor

@BoltTouring BoltTouring commented Apr 2, 2025

This PR implements a complete grantee report submission system that allows grantees to submit their progress reports through a web form. The reports are then posted as comments on the corresponding GitHub issue and sent via email to the grantee.

Features

  • Report submission form with validation
  • GitHub integration for posting reports as comments
  • Email confirmation with report copy
  • Error handling and validation
  • Development mode support for testing

Testing

The changes have been tested locally with:

  • Multiple successful report submissions
  • Proper bot token usage (posting as OpenSatsBot)
  • Email confirmations working correctly
  • Error boundary catching and displaying errors appropriately

Quick Test Script for Report Submission Flow

  1. Validate Grant:

    • Use live grant ID (e.g., 887414)
    • Use live email (e.g., rob@opensats.org)
    • Verify validation succeeds
  2. Submit Report:

    • Fill in all required fields
    • Check preview for errors
    • Verify all headings and text are visible
    • Submit report
    • Verify GitHub comment is created (delete after confirmation)
    • Verify confirmation email is received
    • Verify redirect to success page
  3. Error Cases:

    • Verify form validation works
    • Verify local storage saves draft on error

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
os-website ❌ Failed (Inspect) Apr 2, 2025 7:04am

Copy link
Copy Markdown
Member

@dergigi dergigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid I'll have to close this PR.

Comment thread lib/session.ts
const sessionOptions: IronSessionOptions = {
password:
process.env.SECRET_COOKIE_PASSWORD ||
'complex_password_at_least_32_characters_long',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahem

Comment thread utils/email.ts
reportContent: string
): Promise<boolean> {
// Convert markdown to HTML
const htmlContent = marked(reportContent, {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's how you convert HTML to markdown.

Comment thread utils/email.ts
* @param markdown Markdown content to convert
* @returns HTML content
*/
function convertMarkdownToHtml(markdown: string): string {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's not how you convert HTML to markdown.

@dergigi dergigi closed this Apr 21, 2025
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.

2 participants