[Card grants] Add status filter to card grants table - #14908
[Card grants] Add status filter to card grants table#14908ArushYadlapati wants to merge 2 commits into
Conversation
|
Ready for review. Also, can I request a review from Claude? |
|
@claude do review thing |
|
Claude finished @mattsoh's task in 3m 26s —— View job Code Review
Reviewed the diff against Findings1. "Frozen" filter misses cards that are scope :frozen, -> { active.joins(:stripe_card).merge(StripeCard.frozen) }
elsif stripe_card.frozen? || stripe_card.inactive?
"Frozen"So a grant whose card was created but hasn't yet completed activation ( scope :frozen, -> { active.joins(:stripe_card).where(stripe_cards: { stripe_status: "inactive" }) }2. No filter bucket for fraud-flagged grants (minor/possibly intentional) 3. Nit: naming 4. Nit: typo in spec description — Other observations (no action needed)
Note: I wasn't able to run the test suite in this environment ( |
|
I'll start addressing this feedback right away! |
|
@claude could you do the review thing again perchance 🙏🏽 |
Summary of the problem
Fixes #14043.
The card grants table on an event's card grants page only has a text search box. There's no way to narrow the list down to, say, just the ones that have been activated vs. not activated, which is not great for events with a lot of grants.
Describe your changes
This PR creates a filter for the different status types that matches the existing filter UI (like the one on the ledger page). There are new
CardGrantscopes for each state, and afilter_by_statescope that maps thestatusparam to one of them, falling back toallon unknown values. Canceled grants are split into "Returned" and "Converted to reimbursement report" depending or not on whether a reimbursements report was created from them.Filter:

Filter in action:
