Skip to content

AO3-5937 "Save" button visible on bookmarks when logged out and on a tag's bookmarks page#4757

Open
forceofcalm wants to merge 31 commits intootwcode:masterfrom
forceofcalm:AO3-5937
Open

AO3-5937 "Save" button visible on bookmarks when logged out and on a tag's bookmarks page#4757
forceofcalm wants to merge 31 commits intootwcode:masterfrom
forceofcalm:AO3-5937

Conversation

@forceofcalm
Copy link
Contributor

@forceofcalm forceofcalm commented Mar 1, 2024

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-5937

Purpose

Wraps the "save" and "saved" actions for bookmarks in a logged_in? check.

Testing Instructions

I have left a comment for clarification on the JIRA ticket.

Credit

calm (they/them)

@ceithir
Copy link
Contributor

ceithir commented Apr 5, 2024

Could you add an integration test covering this fix?

Copy link
Member

@brianjaustin brianjaustin left a comment

Choose a reason for hiding this comment

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

I think these should help with the ERB lint warning (I have not had a chance to test locally though, so some further nudges may be required)

forceofcalm and others added 2 commits April 20, 2024 11:01
Co-authored-by: Brian Austin <13002992+brianjaustin@users.noreply.github.com>
Co-authored-by: Brian Austin <13002992+brianjaustin@users.noreply.github.com>
@forceofcalm
Copy link
Contributor Author

I'm writing the integration test for this now (or at least, trying to), and I've noticed that the Save button is actually an <li> element styled like a button. For accessibility reasons, this should be an actual <button> element. A change like that is out of the scope of this ticket, but should be noted somewhere.

@forceofcalm
Copy link
Contributor Author

Hi! I have no fucking idea what RuboCop wants from me. I've tried a ton of different indents and it is still upset.

Copy link
Member

@brianjaustin brianjaustin left a comment

Choose a reason for hiding this comment

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

If rubocop and/or erblint is giving me trouble, I usually will run

rubocop -A path/to/file.rb
# or
erblint -A path/to/file.html.erb

That will often do a lot more than we need, so I also use git add -p to selectively add lines to my commit, and then run git checkout path/to/file.rb to avoid changing a bunch of things at once. I sympathise with fighting erblint/rubocop though, so I've pushed what ERB lint seems to want to brianjaustin@6f6f854

@Bilka2
Copy link
Contributor

Bilka2 commented Feb 8, 2026

I've flipped the label back to action needed since the comment about the test still needs addressing

assert orig_cache_key == bookmark.cache_key, "Cache key #{orig_cache_key} does not match #{bookmark.cache_key}."
end

When "I go to the bookmarks for the tag {string}" do |tag|
Copy link
Contributor

@Bilka2 Bilka2 Mar 5, 2026

Choose a reason for hiding this comment

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

The tests don't actually use this step, instead they use the generic "I go to ":

When /^(?:|I )go to (.+)$/ do |page_name|
visit path_to(page_name)
end

This means the tests go to the overall bookmarks index instead of the tag's index and don't fail even if the change in this PR is reverted. If you define this path in paths.rb instead then it should work correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants