AO3-7353 Fix "Refused Gifts" button failed to show pressed when selected#5697
AO3-7353 Fix "Refused Gifts" button failed to show pressed when selected#5697runxii wants to merge 3 commits intootwcode:masterfrom
Conversation
254e3eb to
a0379f9
Compare
|
Hi, Yang! Thank you so much for this pull request. Someone will be along to review it soon. For now, I've updated the Jira issue status to In Review so no one mistakenly creates a duplicate pull request. If you'd like the ability to comment on, assign, and transition issues in the future, you're welcome to create a Jira account! It makes things a bit easier for us on the organizational side if the Full Name on your Jira account either closely matches the name you'd like us to credit in the release notes or includes it in parentheses, e.g. "Nickname (CREDIT NAME)." Once you've done that (or if you've already done it -- Jira has been unreliable about showing us new accounts in the admin panel lately), you can either reply here or send an email to otw-coders@transformativeworks.org with your account name and email address and we'll set up the permissions for you. Thanks again for contributing! If you have any questions, you can contact us at the same email address listed above. |
|
@sarken Thank you so much for your contribution to managing the repository! I'd love to join the Jira team with the following account: Email: runxii@outlook.com |
|
Your account should hopefully be all set the next time you log in, but Jira's having a major outage on the admin side of things right now, so it's possible the permissions didn't get set up correctly. Feel free to ping me if you run into any issues! |
Bilka2
left a comment
There was a problem hiding this comment.
Thanks for working on this!
app/views/gifts/index.html.erb
Outdated
| </li> | ||
| <li> | ||
| <%= span_if_current ts("Refused Gifts"), user_gifts_path(@user, refused: true) %> | ||
| <%= span_if_current(ts("Refused Gifts"), user_gifts_path(@user, refused: true), params[:refused]=="true") %> |
There was a problem hiding this comment.
It looks like all other code in the controller and view only check whether the parameter is present, not whether it's true, so could you adjust this to only check .present? as well?
There was a problem hiding this comment.
Thank you for the review! I changed the code to check .present rather than true. The erb-lint failed because it suggested Rails built-in t helper over ts, but I meant to align with the original code so preferred to change as less as possible. If there's anything else to be changed, I'm glad to work on it.
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7353
Purpose
Fixed the bug when the "Refused Gifts" is pressed, but the UI does not show that it is pressed. (On the page "My Dashboard">"Gifts")
Fixed by passing the right condition to
span_if_currentinapp/views/gifts/index.html.erb, which should check ifrefusedistruein the URL.Testing Instructions
https://localhost:3000/users/testuser/gifts?sorted=DESC&refused=true, the button remains pressed.References
Switching the params to reproduce the error was mentioned in AO3-7133
Credit
Yang (she/her)