Skip to content
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

MBS-12989 / MBS-12998: Edit list quick links improvements #2898

Merged
merged 4 commits into from Apr 17, 2023

Conversation

reosarevok
Copy link
Member

Fix MBS-12989 / MBS-12998

Problem

The quick links section has a few issues:

  • The refine search link on the subscribed editors page does not set the "I haven't voted" predicate (MBS-12989)
  • The edit search pages are not supposed to link to themselves, but they do (no ticket)
  • The quick links sometimes (like for Open edits) start with a stray | separator (MBS-12998)

Solution

The first commit adds the missing predicate to the refine_url_args of subscribed_editors.

The second commit sets isSearch when calling EditList from search_results.tt, which I think was always supposed to happen - we literally didn't set isSearch anywhere at the moment.

The third commit builds an array of any appropriate quick links, then joins them with the | separator as needed, as we do with FooterSwitch in ArtistIndex, rather than trying to guess when a separator will be needed. This also allowed me to group the conditions a bit better, which hopefully is clearer.

Testing

Manually, navigating between all the different edit lists, when logged in and logged out.

@reosarevok reosarevok added the Bug Bugs that should be checked/fixed soonish label Mar 14, 2023
@reosarevok
Copy link
Member Author

@brainzbot, retest this please

@jesus2099
Copy link
Contributor

I tested the stray pipe problem and it's gone!

Copy link
Contributor

@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

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

Much better code. Tested manually. Updated the already linked ticket MBS-12998 to cover hiding the link “Search for edits” too (as in the current second commit).
🚢

Related to this second commit (but that can be addressed in a later pull request): The paragraph “No edits were found matching your query. Please try again.” that is now displayed (and was never displayed at least since the React conversion) doesn’t seem to be useful. It says the same thing as the “Found 0 edits” which is already shown. The link named “try again” actually blanks search conditions, while it would expect the same search to be tried again. I would rather just remove this paragraph.

The actual results in subscribed_editors are already filtered to show only edits
the editor hasn't voted on yet, but we forgot to add this restriction
to refine_url_args (it's already there for other similar refinements).
This is supposed to hide the Search for edits link on ListHeader
and show an extra message when accessing EditList from edit search,
but we were never setting it.
This was kind of a mess with us trying to guess where the different
| separators should go. Rather than doing this, I'm now just
building an array of any appropriate quick links,
then joining them with the separator as needed,
as we do with FooterSwitch in ArtistIndex.
"Found 0 edits" is already shown, and the try again link
is not helpful since it would drop the edit search parameters.
The edit search form is still present on the page anyway
to edit the search directly.
@reosarevok
Copy link
Member Author

You're right about that no results message actually, it does more harm than good. Added a commit dropping it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Super!
I wanted to do that but I didn't recognise the JavaScript I know.
In JavaScript I usually use join() but this .js file uses some high tech code I didn't understand, so I was clueless and could only repeat exact same existing code.

@reosarevok reosarevok merged commit 37bbb21 into metabrainz:master Apr 17, 2023
2 checks passed
@reosarevok reosarevok deleted the MBS-12989 branch April 17, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bugs that should be checked/fixed soonish
Projects
None yet
3 participants