-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix for new hold form for non holdable records #240
Conversation
6fe2c8e
to
cd899f0
Compare
I just ran http://localhost:3001/holds/new?catkey=31200756 and it did not work but I got the following: I was expecting to get "Sorry! You cannot place a hold on this item. Contact your library if you need assistance" |
good catch! this is an interesting one, it is an online resource but has bibinfo and callList. Wonder what the criteria should be to determine if it is holdable or not for such records 🤔 Currently I'm checking if callList is blank or not but that check is not enough for this record. |
While nice to fix if we get a handle on criteria, this is not an issue we need to spend time on. The failure message as screenshotted is sufficient. |
Can you give me the catkeys of records you tested with so I can check them out? The reason I caught |
There were couple more that I could not find out right now, will add here if I do:
|
I also used
|
Yields error: To place a hold, please select a volume. |
It has a callList but no items with holdable locations so it cannot find a barcode. I think for this it should not load the new form and displays that message, right? I will add a fix. |
Yes, ideally it wouldn't load the form. |
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.
19200019
has holdable items and I was able to add a request for it just fine.31200756
(a record that just points to a free and open access resource) produced the error "Hold not allowed".- a non-existing key produced a Rails flash error of "Sorry! You cannot place a hold on this item. Contact your library if you need assistance."
- no catkey provided produced a Rails flash error of "Please select an item to place a hold."
2308333
(unholdable item, needs to be requested through special form) produced "Hold not allowed" like the OA link177351341
(thesis) indeed now does not load the form and instead produces a Rails flash error of "Sorry! You cannot place a hold on this item. Contact your library if you need assistance."
So...
- Seems like we should maybe use the "Sorry you can't place a hold on this item!" message before allowing the patron to fill out the new hold form for OA links (
31200756
) and special request items (2308333
) too. Maybe all unholdable items should have this same setup? - The error message "Please select an item to place a hold." for when no catkey is specified, I wonder if we should change the language? Because when you get that error you don't have an option to "select" any item to place a hold. It's just kinda confusing to me. I sorta wonder if we even need this at all. I can't imagine this scenario ever happening in the real use of the application. If we want to keep it maybe just make a general error message like "There was a problem processing your hold request, please contact your library if you need assistance." 🤷♂️
|
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.
Ok, so we want to update the language on the no catkey provided error
Co-authored-by: Charlie Morris <523381+cdmo@users.noreply.github.com>
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.
As per our zoom, move filter_holdables invocation into the generate method and add a blank? check on call_list after (just a single blank? check) oh and maybe return an empty hash instead of implicit nil? :)
it is irritating that Bib
can have a @record
of just an error. Like it should not be a Bib
it should be a SirsiError
or something. Setting this aside.
@@ -95,4 +102,8 @@ def naturalize(value) | |||
def volumetric? | |||
@call_list&.any? { |call| call.volumetric.present? } | |||
end | |||
|
|||
def find_barcode |
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.
👍
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.
Overall I think we're good, I'm pushing one commit with some semantics suggestions and code organizing suggestions - can you review?
|
||
# no holdable items found | ||
return {} if @call_list.blank? | ||
return {} unless holdables_present?(bib_info) |
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.
liked this 👌 good to have the generate method shorter as a summary
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.
cool
Your refactor looks good 👌 thanks! |
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.
Teamwork!
🍻 |
Issue #237, also fixes Issue #220