www.fgks.org   »   [go: up one dir, main page]

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

List + Solr work_key powered QueryCarousel #5299

Merged
merged 5 commits into from
Jul 30, 2021
Merged

Conversation

mekarpeles
Copy link
Member

Allows List keys to be passed to QueryCarousel macro to power carousels

Technical

This PR extends QueryCarousel so a list key may be provided, such as /people/mekBot/lists/OL104041L/ and the when master...list-querycarousel#diff-a6072af04af429689c35331c2a4a35fa2c23317099533cc2161ef6d8ba79df90R1034 is called, the list will be expanded into a set of work_keys which are then passed through to solr.

Note: The limit and offset are necessarily for paging through the List, but we don't want the limit and offset to be applied to solr because solr is going to receive a discrete list of work_ids (from the already paginated/offset List) and we want to return all of these works from solr.

Will likely be unnecessary once/if Lists are in solr

Testing

Adding a {{ QueryParam("/people/mekBot/lists/OL104041L/") }} (please check syntax) macro somewhere not too public (e.g. user profile page) should do the trick once this code is on testing.

Screenshot

Will add once it's on testing

Stakeholders

@cdrini @seabelis

@cclauss
Copy link
Collaborator
cclauss commented Jun 11, 2021

Please run psf/black on this code to autofix the failing tests...

git diff "${BASE_BRANCH:-master}" -U0 | ./scripts/flake8-diff.sh
openlibrary/plugins/openlibrary/lists.py:210:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/openlibrary/lists.py:225:17: W503 line break before binary operator
openlibrary/plugins/openlibrary/lists.py:237:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/openlibrary/lists.py:251:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/openlibrary/lists.py:255:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/openlibrary/lists.py:269:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/openlibrary/lists.py:327:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/openlibrary/lists.py:367:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/worksearch/code.py:1011:1: E302 expected 2 blank lines, found 1
openlibrary/plugins/worksearch/code.py:1048:89: E501 line too long (98 > 88 characters)
openlibrary/plugins/worksearch/code.py:1109:89: E501 line too long (93 > 88 characters)
8     E302 expected 2 blank lines, found 1
2     E501 line too long (98 > 88 characters)
1     W503 line break before binary operator

@mekarpeles mekarpeles marked this pull request as draft June 28, 2021 19:19
@mekarpeles mekarpeles marked this pull request as ready for review July 22, 2021 20:16
@mekarpeles mekarpeles added the Priority: 2 Important, as time permits. [managed] label Jul 22, 2021
Copy link
Collaborator
@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

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

The new ListCarousel macro seems to be working properly locally and on testing. The list JSON endpoint is returning errors, though.

Co-authored-by: jimchamp <jameschamp@acm.org>
@mekarpeles mekarpeles merged commit 02881e4 into master Jul 30, 2021
@mekarpeles mekarpeles deleted the list-querycarousel branch July 30, 2021 18:05
Sabreen-Parveen pushed a commit to Sabreen-Parveen/openlibrary that referenced this pull request Aug 5, 2021
* List + Solr work_key powered QueryCarousel
* adding ListCarousel macro

Co-authored-by: jimchamp <jameschamp@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 Important, as time permits. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants