Skip to content

Dedicated grant flow#11084

Merged
Betree merged 26 commits intomainfrom
dedicated-grant-flow
Mar 31, 2025
Merged

Dedicated grant flow#11084
Betree merged 26 commits intomainfrom
dedicated-grant-flow

Conversation

@hdiniz
Copy link
Contributor

@hdiniz hdiniz commented Mar 11, 2025

@hdiniz hdiniz self-assigned this Mar 11, 2025
@vercel
Copy link

vercel bot commented Mar 11, 2025

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

Name Status Preview Comments Updated (UTC)
opencollective-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 31, 2025 2:42pm

@Betree Betree force-pushed the dedicated-grant-flow branch from f63b330 to a6eac27 Compare March 27, 2025 14:15
@Betree
Copy link
Member

Betree commented Mar 27, 2025

Policies are not being saved, investigating.

@Betree Betree requested a review from Copilot March 27, 2025 15:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds a dedicated grant flow to the expense system while introducing new sections, schema changes, and UI adjustments for grant expenses. Key changes include:

  • New React components for grant submission (InvitationNoteSection, InstructionsSection, GrantProviderSection, SubmitGrantFlowSteps).
  • Updates to the expense form logic and validation in useExpenseForm.ts, including a new grant title generator.
  • Adjustments in UI components (SummarySection, SubmittedExpense, collective navbar, RichTextEditor, and Policies) to support grant-specific behavior.

Reviewed Changes

Copilot reviewed 42 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
components/submit-grant/sections/InvitationNoteSection.tsx Introduces InvitationNoteSection using the ExpenseInviteRecipientNote component.
components/submit-grant/sections/InstructionsSection.tsx Adds instructions UI for grant submission.
components/submit-grant/sections/GrantProviderSection.tsx Implements a section for selecting the grant provider via ExpenseAccountItem.
components/submit-grant/SubmitGrantFlowSteps.tsx Establishes a dedicated step flow for grant submission.
components/submit-expense/useExpenseForm.ts Adds grant-related form fields, validation refinements, and a new generateGrantTitle function.
components/submit-expense/form/SummarySection.tsx Updates summary components to generate the grant title and display exchange rate warnings.
components/submit-expense/form/ExpenseItemsSection.tsx Updates expense item handling based on grant configurations.
components/submit-expense/SubmittedExpense.tsx Conditionally renders FAQ for non-grant expenses.
components/submit-expense/SubmitExpenseFlowSteps.tsx Exposes StepHeader and StepItem as exported functions for the flow.
components/submit-expense/SubmitExpenseFlow.tsx Refactors onSubmit logic and separates success and error handling for grant flows.
components/expenses/ExpenseInviteWelcome.tsx Switches to a named export for ExpenseInviteRecipientNote.
components/expenses/Expense.tsx Adjusts navigation to use a dedicated grant flow when appropriate.
components/edit-collective/sections/Policies.js Introduces grant expense policy fields and messages to the policies section.
components/edit-collective/sections/EditCollectivePage.js Adds grantPolicy to the settings query.
components/collective-navbar/index.js Updates navigation actions to include a new grant flow option.
components/collective-navbar/ActionsMenu.js Adds grant flow support to the actions menu link logic.
components/RichTextEditor.tsx Adds a flag to control Trix initialization and ensures correct initialization behavior.
Files not reviewed (3)
  • lang/ca.json: Language not supported
  • lang/cs.json: Language not supported
  • lang/de.json: Language not supported
Comments suppressed due to low confidence (2)

components/submit-expense/useExpenseForm.ts:2228

  • The generateGrantTitle function does not handle cases when both 'payee' and 'invitee' are undefined, resulting in a title with 'undefined'. Consider adding a fallback or validating input values before generating the title.
export function generateGrantTitle(account, payee, invitee): string {

components/RichTextEditor.tsx:290

  • [nitpick] Relying on 'hasRunBeforeInitialize' to conditionally initialize Trix may delay editor initialization on the component's first mount if the flag is not set. Verify that the initialization logic correctly triggers when expected.
} else if (!this.isReady && this.state.hasRunBeforeInitialize) {

@Betree Betree force-pushed the dedicated-grant-flow branch from 85114b0 to 4d9d604 Compare March 31, 2025 14:38
@Betree Betree merged commit 13c534b into main Mar 31, 2025
19 checks passed
@Betree Betree deleted the dedicated-grant-flow branch March 31, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants