Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Redirect /search/ page to the Openverse homepage #596

Closed
1 task
obulat opened this issue Jan 12, 2022 · 4 comments · Fixed by #1474
Closed
1 task

Redirect /search/ page to the Openverse homepage #596

obulat opened this issue Jan 12, 2022 · 4 comments · Fixed by #1474
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon

Comments

@obulat
Copy link
Contributor

obulat commented Jan 12, 2022

Problem

Currently, when you go to https://wordpress.org/openverse/search/, you see an image page that confusingly states that you got no results for " ", and a Load more button. The page is not linked from anywhere, so you can only get there if you type in the exact address.

Screen Shot 2022-01-12 at 6 43 32 PM

Description

It is better for user experience to redirect this page to the home page (https://wordpress.org/openverse/), so that even if the user gets to the /search/ address, they are not confused with incorrect text and impossible actions.

Alternatives

We could design a special page for this address, but considering that it is not linked from anywhere, it doesn't seem to be a good use of time and resources.

Implementation

  • 🙋 I would be interested in implementing this feature.
@obulat obulat added 🟩 priority: low Low priority and doesn't need to be rushed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels Jan 12, 2022
@zackkrida
Copy link
Member

Keep in mind that this will be the endpoint of the 'all' results view in the redesign. And also that we use this endpoint for the links on the 'sources' page, for example 'Animal Diversity' links to https://wordpress.org/openverse/search?source=animaldiversity

Perhaps when this endpoint is hit without any filters or a search term applied, we should redirect to the homepage.

@zackkrida zackkrida added 🟨 priority: medium Not blocking but should be addressed soon and removed 🟩 priority: low Low priority and doesn't need to be rushed labels Feb 1, 2022
@zackkrida zackkrida modified the milestones: Postlaunch bug fixes and SEO improvements, Design cleanup Feb 1, 2022
@obulat obulat removed the 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work label Feb 15, 2022
@zackkrida zackkrida removed this from the Design maintenance milestone Feb 15, 2022
@kb-0311
Copy link
Contributor

kb-0311 commented Mar 5, 2022

One possible solution I was thinking about is - because the address needs to be typed and it is not linked to anywhere, because the openverse search page here, does not accept null query

https://wordpress.org/openverse/
Screenshot (8671)

However. if you search for null query from the search bar instead of the address here , after searching for a non-null value first the page redirects to the previously filled non-null query value

https://wordpress.org/openverse/search/?q=aRandomTestToDemonstrateNullValues

Directly input a null value in the query from the address manually and you will see the same error

https://wordpress.org/openverse/search/?q=

So I guess the issue might be here - opensorce-frontend/src/store/search.js here the null value query is not defined-

   // Ensure that q filter always comes first
   const params = { q: state.query.q.trim() }
   // Handle mature filter separately
   const filterKeys = Object.keys(state.query).filter(
     (key) => !['q', 'mature'].includes(key)
   )
   filterKeys.forEach((key) => {
     if (state.query[key].length) {
       params[key] = state.query[key]
     }
   })
   if (state.query.mature === true) {
     params.mature = true
   }
   return params
 },

So maybe if I define a route for null query we can solve this problem in a more creative way maybe set the query to 'I like to test routes' if it is null. or something like this

@kb-0311
Copy link
Contributor

kb-0311 commented Mar 5, 2022

I am not sure . how would we redirect the search route with null query to the home page though? if that is the solution you want to implement.

As in I am unable to find the files where this URL change can be made

@sarayourfriend
Copy link
Contributor

@kb-0311 I think you'd need to use the redirect function present on the nuxt context passed to asyncData to redirect to the homepage when /search/ is reached with no query params: https://nuxtjs.org/docs/concepts/context-helpers#redirecting-users--accessing-the-store

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon
Projects
None yet
4 participants