-
Notifications
You must be signed in to change notification settings - Fork 509
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
AO3-5901 Limit number of pseuds on profile and sidebar #4554
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The view was a bit confusing, pulling information from various parts of the user entity, the profile, and the preferences. In extracting it to a presenter, I realised that if the preference was set to show it, we were showing the birthday section even if the field itself was empty, so I changed that to not show the section. Refactor some specs to remove duplication. Update ignore file for Brakeman to ignore the newly introduced false positive.
These yaks aren't going to shave themselves...
Fixes a long-standing bug where the intention of the code was always to show the current pseud at the top of the pseud switcher.
The maximum number of pseuds on the profile page is now tested in `pseuds.feature`.
And remove user request spec, as per review.
Show different link text, depending on whether there are more pseuds in total than there are shown on profile.
I mean Hound. Yes, that's what I mean. * Double quoting strings * Using `let` like DHH intended us to instead of instance variables * Assertive language in spec descriptions * Explicit expectations ("Do not use `be` without an argument")
Co-authored-by: Cesy <[email protected]>
Co-authored-by: tickinginstant <[email protected]>
5 tasks
Bilka2
reviewed
Jun 26, 2023
Comment on lines
+34
to
+40
@user = User.find_by(login: params[:user_id]) | ||
|
||
if @user.nil? | ||
flash[:error] = ts("Sorry, there's no user by that name.") | ||
redirect_to root_path | ||
return | ||
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.
scottsds
approved these changes
Jul 6, 2023
5 tasks
neuroalien
added a commit
to neuroalien/otwarchive
that referenced
this pull request
Jul 16, 2023
When we started limiting the number of pseuds in the sidebar, the way to guarantee that the current pseud would show up in the sidebar was to show it at the top of the pseud switcher. However, [AO3-6249](https://otwarchive.atlassian.net/browse/AO3-6249) decided that the pseud switcher should always say "Pseuds" at the top. We broke this behaviour in otwcode#4554. Fixing it in c3e4ab9 resulted in the current pseud not showing in the sidebar in some conditions. Move or add the current pseud at the beginning of the list, whether or not it is present in the abbreviated list. We are aware that this could make the abbreviated list in the pseud switcher show `ITEMS_PER_PAGE` + 1 pseuds in some cases, discuss with @sarken if you disagree.
sarken
added a commit
that referenced
this pull request
Jul 16, 2023
* AO3-5901 Pseud switcher text on the New Pseud page Provide fallback text for the edge case of the New Pseud page, where `@pseud` is defined, but doesn't have a `name` yet. * Update app/views/users/_sidebar.html.erb Co-authored-by: sarken <[email protected]> * AO3-5901 Ensure pseud switcher shows current pseud When we started limiting the number of pseuds in the sidebar, the way to guarantee that the current pseud would show up in the sidebar was to show it at the top of the pseud switcher. However, [AO3-6249](https://otwarchive.atlassian.net/browse/AO3-6249) decided that the pseud switcher should always say "Pseuds" at the top. We broke this behaviour in #4554. Fixing it in c3e4ab9 resulted in the current pseud not showing in the sidebar in some conditions. Move or add the current pseud at the beginning of the list, whether or not it is present in the abbreviated list. We are aware that this could make the abbreviated list in the pseud switcher show `ITEMS_PER_PAGE` + 1 pseuds in some cases, discuss with @sarken if you disagree. * AO3-5901 Don't use instance vars in helpers The Hound has arisen from its slumber as soon as I touched some ancient scrolls, and so I've tried to appease it with the following sacrifices: - add spaces after and before curly bois (`{` and `}`) - IN-TER-PO-LATE! IN-TER-PO-LATE! (AKA prefer interpolation to string concatenation) - stop using instance vars in helper method The latter change has morally forced my hand to: - separate the method that determines which pseuds to show in the sidebar selector from the method that outputs the HTML - remove the `print_` prefix from the method that I touched, as [per precedent](50f7b7e) * AO3-5901 Remove code unused since 2013 This method has had no callers since c10ef8a#diff-638a702b43ccba6b5dcb42edd2c6f8bb4ba56c492cb2ef7ccf56815663743e07. Tacking it onto this issue because its presence confused me when deciding whether the `pseuds_for_sidebar` method belonged in the user helper or the pseud helper. --------- Co-authored-by: sarken <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-5901
Purpose
What does this PR do?
Testing Instructions
How can the Archive's QA team verify that this is working as you intended?
If you have a Jira account with access, please update or comment on the issue
with any new or missing testing instructions instead.
References
Are there other relevant issues/pull requests/mailing list discussions?
Credit
What name and pronouns should we use to credit you in the Archive of Our Own's Release Notes?
alien, they/them
However, more people contributed to this PR over the years (years!), who should also be credited.