-
Notifications
You must be signed in to change notification settings - Fork 80
[Card Grants] More UI improvements on index page #12393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| </div> | ||
| <% end %> | ||
| <div data-tabs-target="tab" id="user"> | ||
| <% @organizers.each do |position| %> | ||
| <% @grant_recipients.each do |user| %> | ||
| <div class="flex items-center"> | ||
| <%= link_to(event_ledger_path(@event, upsert_query_params(user: position.user.friendly_id)), class: "flex-auto flex items-center menu__action #{"menu__action--active" if @user&.friendly_id == position.user.friendly_id}", data: { turbo_prefetch: "false" }) do %> | ||
| <%= link_to(event_ledger_path(@event, upsert_query_params(user: user.friendly_id)), class: "flex-auto flex items-center menu__action #{"menu__action--active" if @user&.friendly_id == user.friendly_id}", data: { turbo_prefetch: "false" }) do %> | ||
| <div class="avatar-grow line-height-0 mr1"> | ||
| <%= avatar_for position.user, size: 18 %> | ||
| <%= avatar_for user, size: 18 %> | ||
| </div> | ||
| <%= position.user.name %> | ||
| <% end %> | ||
| </div> | ||
| <% end %> | ||
| </div> | ||
| <div data-tabs-target="tab" id="type"> | ||
| <% ["ach_transfer", "card_charge", "check_deposit", "donation", "fiscal_sponsorship_fee", "hcb_transfer", "invoice", "mailed_check", "paypal_transfer", "refund", "reimbursement", "wire"].each do |type| %> | ||
| <div class="flex items-center"> | ||
| <%= link_to(event_ledger_path(@event, upsert_query_params(type:)), class: "flex-auto menu__action #{"menu__action--active" if @type == type}", data: { turbo_prefetch: "false" }) do %> | ||
| <%= type.humanize.gsub("Ach", "ACH").gsub("Paypal", "PayPal").gsub("Hcb", "HCB") %> | ||
| <%= user.name %> | ||
| <% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The user filter on the regular transaction page incorrectly displays card grant recipients instead of event organizers by unconditionally iterating over @grant_recipients.
Severity: HIGH | Confidence: High
🔍 Detailed Analysis
On the regular event transaction page, the filter for users incorrectly displays a list of card grant recipients instead of the event organizers. This is caused by a change in app/views/events/_filter_menu.html.erb which now unconditionally iterates over the @grant_recipients collection. The controller populates both @organizers and @grant_recipients, but the view no longer distinguishes between the regular transaction context and the card grant transaction context (which is determined by the @subledger variable). This results in a functionally incorrect filter for regular event transactions.
💡 Suggested Fix
In _filter_menu.html.erb, add a conditional check for @subledger. If @subledger is true, iterate over @grant_recipients. Otherwise, iterate over @organizers to display the correct list of users based on the context.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: app/views/events/_filter_menu.html.erb#L40-L50
Potential issue: On the regular event transaction page, the filter for users incorrectly
displays a list of card grant recipients instead of the event organizers. This is caused
by a change in `app/views/events/_filter_menu.html.erb` which now unconditionally
iterates over the `@grant_recipients` collection. The controller populates both
`@organizers` and `@grant_recipients`, but the view no longer distinguishes between the
regular transaction context and the card grant transaction context (which is determined
by the `@subledger` variable). This results in a functionally incorrect filter for
regular event transactions.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 7321999
Summary of the problem
Describe your changes