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

Search: refactor views #8157

Merged
merged 2 commits into from May 25, 2021
Merged

Search: refactor views #8157

merged 2 commits into from May 25, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented May 4, 2021

This was extracted from #8149
to make it easy to review.

  • Separate this "shared" view into two classes, too many conditionals
    otherwise.
  • Remove unused index query param.

No changes to the logic were made, there is another PR in .com to match these changes

This was extracted from #8149
to make it easy to review.

- Separate this "shared" view into two classes, too many conditionals
  otherwise.
- Remove unused `index` query param.
results = []
facets = {}

if user_input.query:
Copy link
Member Author

Choose a reason for hiding this comment

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

this whole block was moved to the base class.

Comment on lines +89 to +91
- q: search term
- version: version to filter by
- role_name: sphinx role to filter by
Copy link
Member Author

@stsewd stsewd May 4, 2021

Choose a reason for hiding this comment

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

In the search tab we only search for files under that project, so no need to choose between serializes or to pass any other additional inputs

@stsewd stsewd requested review from a team and ericholscher May 4, 2021 23:25
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Looks good.

readthedocs/search/views.py Outdated Show resolved Hide resolved
Co-authored-by: Eric Holscher <25510+ericholscher@users.noreply.github.com>
@stsewd stsewd enabled auto-merge (squash) May 25, 2021 00:21
@stsewd stsewd merged commit 9c8bbf5 into master May 25, 2021
@stsewd stsewd deleted the refactor-search-views branch May 25, 2021 00:30
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