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

Added new endpoint to create a user list from a link. #9670

Conversation

benbdeitch
Copy link
Collaborator

Closes #9667

Currently, there's no endpoint to allow a logged-in user to add a new list without pattern-checking for their name. This poses a problem in the new Bulk Search feature, as it has to build the list in Vue, and getting access to the web.ctx.site variable (where that information is stored) is a non-trivial task in javascript. This PR sidesteps the problem, by creating a new endpoint in python to automatically redirect to the list creation endpoint for the currently logged in user.

Technical

Testing

To test, perform a bulksearch and create a list. With the current structure of how the Bulk Search component works, it'll always try to link to the main Open Library page. This will be fixed in a future PR, but for now, just edit the openlibrary.org portion of the URL to localhost:8080, or whatever you need for this particular test.

Screenshot

image

Stakeholders

@cdrini

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.73%. Comparing base (ce16a79) to head (3395b86).
Report is 144 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9670      +/-   ##
==========================================
+ Coverage   16.06%   16.73%   +0.67%     
==========================================
  Files          90       90              
  Lines        4769     4816      +47     
  Branches      832      840       +8     
==========================================
+ Hits          766      806      +40     
- Misses       3480     3487       +7     
  Partials      523      523              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Looking good! A few opportunities to simplify the code a bit.

@cdrini cdrini added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Aug 7, 2024
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Aug 7, 2024
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Lgtm! Didn't test my small code fix, but I think it shouldn't cause any issues.

Tested on testing and it redirected correctly to the new endpoint!

@cdrini cdrini merged commit 95a4cf3 into internetarchive:master Aug 7, 2024
5 checks passed
Souvik-Cyclic pushed a commit to Souvik-Cyclic/openlibrary that referenced this pull request Aug 17, 2024
SivanC pushed a commit to SivanC/openlibrary that referenced this pull request Aug 20, 2024
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.

"Create a list" button creates a global list, which is currently admin only
3 participants