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

fix for new hold form for non holdable records #240

Merged
merged 9 commits into from
Sep 14, 2020

Conversation

banukutlu
Copy link
Contributor

@banukutlu banukutlu commented Aug 31, 2020

Issue #237, also fixes Issue #220

@banukutlu banukutlu requested a review from cdmo August 31, 2020 18:29
@banukutlu banukutlu self-assigned this Aug 31, 2020
@banukutlu banukutlu force-pushed the 237-fix-new-hold-form-for-no-holdable-locs branch from 6fe2c8e to cd899f0 Compare August 31, 2020 18:30
@cdmo
Copy link
Contributor

cdmo commented Sep 3, 2020

from issue

reopened to add a message Sorry! You cannot place a hold on this item. Contact your library if you need assistance for records that are not holdable eg. catkey: 31200756

I just ran http://localhost:3001/holds/new?catkey=31200756 and it did not work but I got the following:

Screen Shot 2020-09-02 at 9 34 09 PM

I was expecting to get "Sorry! You cannot place a hold on this item. Contact your library if you need assistance"

@banukutlu
Copy link
Contributor Author

banukutlu commented Sep 3, 2020

from issue

reopened to add a message Sorry! You cannot place a hold on this item. Contact your library if you need assistance for records that are not holdable eg. catkey: 31200756

I just ran http://localhost:3001/holds/new?catkey=31200756 and it did not work but I got the following:

Screen Shot 2020-09-02 at 9 34 09 PM

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.

@ruthtillman
Copy link
Collaborator

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.

@cdmo
Copy link
Contributor

cdmo commented Sep 8, 2020

Can you give me the catkeys of records you tested with so I can check them out? The reason I caught 31200756 is because it was the one mentioned in the issue. Thanks!

@banukutlu
Copy link
Contributor Author

banukutlu commented Sep 8, 2020

Can you give me the catkeys of records you tested with so I can check them out? The reason I caught 31200756 is because it was the one mentioned in the issue. Thanks!

There were couple more that I could not find out right now, will add here if I do:

  • 19200019
  • 31200756
  • a non-existing key
  • no key (just going to holds/new or holds/new?catkey=)

@ruthtillman
Copy link
Collaborator

I also used

2308333

@ruthtillman
Copy link
Collaborator

Yields error: To place a hold, please select a volume. 17735134

@banukutlu
Copy link
Contributor Author

banukutlu commented Sep 8, 2020

Yields error: To place a hold, please select a volume. 17735134

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.

@ruthtillman
Copy link
Collaborator

Yes, ideally it wouldn't load the form.

Copy link
Contributor

@cdmo cdmo left a 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 link
  • 177351341 (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...

  1. 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?
  2. 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." 🤷‍♂️

@ruthtillman
Copy link
Collaborator

  1. Nice to have. Consistency would be ideal. I am ok with launching before that part is consistent because neither of those has an "I Want It" button and therefore we're dealing with an edge case that is already being handled by suppressing "I Want It." So we can prioritize other things before addressing thing.

  2. Yes, change to "There was a problem processing your hold request, please contact your library if you need assistance." Ideally they won't run into that either, but if they are we should also know about it and learn how they got there.

Copy link
Contributor

@cdmo cdmo left a 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

@banukutlu banukutlu requested a review from cdmo September 9, 2020 17:26
Co-authored-by: Charlie Morris <523381+cdmo@users.noreply.github.com>
Copy link
Contributor

@cdmo cdmo left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@cdmo cdmo left a 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)
Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

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

cool

@banukutlu
Copy link
Contributor Author

Overall I think we're good, I'm pushing one commit with some semantics suggestions and code organizing suggestions - can you review?

Your refactor looks good 👌 thanks!

@banukutlu banukutlu requested a review from cdmo September 14, 2020 15:15
Copy link
Contributor

@cdmo cdmo left a comment

Choose a reason for hiding this comment

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

Teamwork!

@cdmo cdmo merged commit 47b9dbb into master Sep 14, 2020
@cdmo cdmo deleted the 237-fix-new-hold-form-for-no-holdable-locs branch September 14, 2020 15:18
@banukutlu
Copy link
Contributor Author

Teamwork!

🍻

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.

3 participants