-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
remove inlinejs for waitlist #9038
remove inlinejs for waitlist #9038
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9038 +/- ##
==========================================
- Coverage 15.93% 15.89% -0.05%
==========================================
Files 89 90 +1
Lines 4720 4732 +12
Branches 823 825 +2
==========================================
Hits 752 752
- Misses 3457 3467 +10
- Partials 511 513 +2 ☔ View full report in Codecov by Sentry. |
1b416c8
to
9247654
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @RayBB!
While testing with production data, the dialog would open when I clicked a a.leave
link. However, confirming would not remove me from the waitlist.
I mocked a waiting list on my local environment, and discovered that the context of this
has changed from a.leave
to the initLeaveWaitlist
function. I've provided some code that should fix that.
I also noticed that the "Leave waitlist" dialog has an existing bug. There should be a "Are you sure you want to leave the waiting list of {title}?" CTA displayed in the dialog, but it is hidden by the hidden
class. I think that removing hidden
from the #leave-waitinglist-dialog
element on a.leave
clicks would fix this, but I didn't test it out.
Co-authored-by: jimchamp <jameschamp@acm.org>
Co-authored-by: jimchamp <jameschamp@acm.org>
@jimchamp I addressed your comments. Good catch on the context changing. I've updated the code as you mentioned and put it on testing and it seems to be working right (easier to tell now that the title isn't hidden in the dialog). Did you figure out how to add books to your waitlist in prod? In any case, I'm hoping this PR is done now! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Tested removing some myself from some books' wait lists on testing.openlibrary.org.
Did you figure out how to add books to your waitlist in prod?
I had to join wait lists on archive.org details pages, from the borrow button's drop down options:
Or can you share how you were mocking the responses? Is there an easy way to do that?
I hacked together this code to test your changes locally. I mocked the response based on how the wait list is represented in the store, as per this docstring, and mocked the methods that are called in /account/loans.html
(the commented-out attributes weren't needed for that page).
This was definitely a quick and dirty way to mock this. It would be more broadly useful if User.get_waitinglist()
returned some configurable waiting list in dev enviroments, and that the mocked methods returned expected values (without the need for additional parameters, like the get_book
call in the linked branch). I'm not sure if this is a worthwhile pursuit, though, as we rarely need a working waitlist in dev...
Closes #8378
Technical
Testing
I don't know locate a book that is waitlistable to test better. However, I have a book on my waitlist from long ago. The testing plan is:
This plan will be shown via the screen recording
Screenshot
waitlist720_2.mp4
Stakeholders