Skip to content

[Card Grants] Home page reordering #10674

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

manuthecoder
Copy link
Contributor

Currently, you can reorder organizations on your HCB homepage. This PR extends that functionality by enabling sorting for card grants as well.

Work in progress

@manuthecoder manuthecoder requested review from a team as code owners June 22, 2025 00:05
Comment on lines 39 to 42
data-event-sort-organizer-positions-value="<%= @organizer_positions.pluck(:id).to_json %>"
data-action="sortable:stop->event-sort#sort"
>
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
data-event-sort-organizer-positions-value="<%= @organizer_positions.pluck(:id).to_json %>"
data-action="sortable:stop->event-sort#sort"
>
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>
data-event-sort-organizer-positions-value="<%= @organizer_positions.pluck(:id).to_json %>"
data-action="sortable:stop->event-sort#sort">
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>

Comment on lines 39 to 42
data-sort-card-card-grant-value="<%= current_user.card_grants.activated.pluck(:id).to_json %>"
data-action="sortable:stop->card-grant#sort"
>
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
data-sort-card-card-grant-value="<%= current_user.card_grants.activated.pluck(:id).to_json %>"
data-action="sortable:stop->card-grant#sort"
>
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>
data-sort-card-card-grant-value="<%= current_user.card_grants.activated.pluck(:id).to_json %>"
data-action="sortable:stop->card-grant#sort">
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>

Comment on lines +39 to 42
data-sort-card-order-value='<%= current_user.card_grants.includes(:stripe_card).map(&:hashid).to_json %>'
data-action="sortable:stop->sort-card#sort"
>
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
data-sort-card-order-value='<%= current_user.card_grants.includes(:stripe_card).map(&:hashid).to_json %>'
data-action="sortable:stop->sort-card#sort"
>
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>
data-sort-card-order-value='<%= current_user.card_grants.includes(:stripe_card).map(&:hashid).to_json %>'
data-action="sortable:stop->sort-card#sort">
<% current_user.card_grants.includes(:stripe_card).activated.each do |grant| %>

@YodaLightsabr
Copy link
Contributor

Is there an associated issue / feature request / user story behind this PR I can reference for more context? I'm thinking a better way to organize card grants might be just creating a new page for them.

@manuthecoder
Copy link
Contributor Author

honestly I just came up with this randomly because I felt it's sometimes inconvenient to scroll through all the YSWS grants I was issued

@manuthecoder manuthecoder marked this pull request as draft June 25, 2025 20:03
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