-
Notifications
You must be signed in to change notification settings - Fork 212
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
Use query parameters for additional search views in Nuxt #3866
Conversation
71af024
to
1fe5805
Compare
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.
This was very easy to follow and looks great! I've requested some changes. I tried to make it clear what suggestions feel optional; let me know if you have questions.
449b4c6
to
36a0bd9
Compare
4645b7b
to
c840209
Compare
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
c840209
to
29f254e
Compare
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.
This works great locally 🎉 LGTM!
Based on the high urgency of this PR, the following reviewers are being gently reminded to review this PR: @AetherUnbound Excluding weekend1 days, this PR was ready for review 3 day(s) ago. PRs labelled with high urgency are expected to be reviewed within 2 weekday(s)2. @obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings. Footnotes
|
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.
I don't have a lot of notes on the code itself, but one thing I've noticed: the collection pages seem to be using the default text (e.g. "Openly Licensed Images, Audio and More | Openverse"). It feels like that should be specific per collections page, as in "tag: cat | Openverse" or something?
I should have added more details on the scope of this PR. The main goal here is to make the creator/tag values with special characters work by making the This PR actually breaks some things like loading of the images (on server-rendered pages), and it does not fix the SEO-related. That should be done in a separate PR. |
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.
Tested this locally and the functionality as described works as expected! 🥳
Fixes
Fixes #3864 by @obulat
Description
This PR updates the frontend implementation to use the query parameters instead of path parameters:
/image/tag/cat
->/image/collection?tag=cat
/image/source/wikimedia
->/image/collection?source=wikimedia
/image/source/wikimedia/creator/me
->/image/collection?source=wikimedia&creator=me
It updates pages, stores, collection middleware and API service.
Pages
The two pages (
tag/_tag.vue
andsource/_vue
) with a singlecollection.vue
page (which is duplicated for each media type). The parsing and setting ofcollectionParams
was removed from thesetup
function and moved to the collection middleware.Store
getCollectionPath
function is updated to create a path usingcollection
path part and relevant query parameters.This function is used for the source and creator link buttons, tags, the sources table.
API requests
The store collection parameters are converted to an API request URL. For now, before the API changes are implemented, we can use the search without
q
parameter: the full-text search within tags, creator and source.The following request URLS are used in this PR:
/images?unstable__collection=tag&tags=cat
/images?unstable__collection=source&source=flickr
/images?unstable__collection=creator&source=flickr&creator=me
The API currently ignores the
unstable__collection
parameter.When the API changes are implemented,
tags
will be replaced withunstable__tag
, and from then on the real collections with exact matches and sorted by newest will be returned.Important limitation
After these changes, the collection pages are not loaded on SSR because the
CollectionPage
sets the value of results before media is fetched, and server renders an empty result list. The follow-up PR that will use the newVMediaCollection
component from #3831, and fix this problem.Testing Instructions
Make sure that
additional_search_views
ison
on the/preferences
page.Navigate to tags, creator and source views from the single result pages. The client-side navigation should work correctly. Note that there will be times that the page renders only the loading skeletons. This problem will be solved in a separate PR.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin