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

Create a URL which initiates a library search #871

Merged
merged 9 commits into from Nov 10, 2021
Merged

Conversation

jsnshrmn
Copy link
Member

@jsnshrmn jsnshrmn commented Nov 4, 2021

Description

Adds:

  • an intentionally minimal page with an intermediary form at /search/?q=<search terms> that sends users from stable urls on-wiki to searches in EDS.
  • an eligible editors only view mixin that raises permission denied for users without an editor and redirects ineligible editors to my_library, which explains eligibility

Updates:

  • the referring url policy to be in django instead of nginx. the header was getting added twice and it was causing intermittent problems during testing
  • Drops the from_homepage query parameter once our auth check is done using it

Rationale

For use in the Find Sources template

Phabricator Ticket

https://phabricator.wikimedia.org/T294919

How Has This Been Tested?

I added unit tests for the new view mixin, since that is reusable and has security implications.
I manually tested:

  • multiple locales, including those that need the code manipulated, like pt, with JavaScript enabled and disabled.
  • eligible and ineligible editor accounts
  • anonymous and logged in users

Screenshots of your changes (if appropriate):

nojs screenshot; the javascript version automatically sends the user to EDS.
image

Types of changes

What types of changes does your code introduce? Add an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Minor change (fix a typo, add a translation tag, add section to README, etc.)

@jsnshrmn jsnshrmn force-pushed the jason-T294919 branch 2 times, most recently from f9cd8eb to 1731883 Compare November 4, 2021 19:18
@jsnshrmn jsnshrmn changed the title WIP Create a URL which initiates a library search Create a URL which initiates a library search Nov 4, 2021
Copy link
Contributor

@suecarmol suecarmol left a comment

Choose a reason for hiding this comment

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

Just a small change before I can merge this

TWLight/urls.py Outdated Show resolved Hide resolved
Copy link
Contributor

@suecarmol suecarmol left a comment

Choose a reason for hiding this comment

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

Thank you for working on this!

@suecarmol suecarmol merged commit fed2225 into master Nov 10, 2021
@jsnshrmn jsnshrmn deleted the jason-T294919 branch November 18, 2021 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants