Skip to content

Commit

Permalink
Merge changes for v4.3.1 (#267)
Browse files Browse the repository at this point in the history
* Merge changes for ReShare update (#263)

* Add initial module for ReShare interface

* Add initial module for ReShare interface

* Code cleanup for Rubocop

* Use proper holdings metadata to check BD availability

* Fix volume select bug

* Update DeliveryMethod::BD to check availability via holdings instead of items

* Update views for new ReShare code

* Place BD requests using ReShare

* Place BD requests using ReShare

* Add note about changing workflows

* 'Permanently' disable BD delivery option.

* Remove old BD API code (good riddance).

* Remove borrow_direct gem dependency.

* Update wording and delivery time estimate for ILL form (now BD/ILL form)

* Update release notes

* Update ILL link to include OCLC num & ISBN

* Remove apparently uncalled helper methods

* Update documentation & code cleanup

* Bump version to 4.3

* DISCOVERYACCESS-7931: update links to main library website

* DISCOVERYACCESS-7719: Restore old behavior for records with no items attached (#265)

* Restore old behavior for records with no items attached (DISCOVERYACCESS-7719)

* Restore old behavior for records with no items attached (DISCOVERYACCESS-7719)

* DISCOVERYACCESS-7944: PDA update, views update, workflow update (#266)

* Fix view typo bug

* Update PDA selection to use call number (DISCOVERYACCESS-7944)

* Bump version

---------

Co-authored-by: Melissa Wallace <[email protected]>
  • Loading branch information
Baroquem and mhk33 authored Feb 8, 2023
1 parent 7a6b2fe commit d8fdee2
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 34 deletions.
20 changes: 10 additions & 10 deletions app/controllers/blacklight_cornell_requests/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def magic_request(target = '')
# a work with only one item and that item is inactive, we need to redirect because the items array
# will be empty.
# Rails.logger.debug "mjc12test: items: #{items}"
if @document['items_json'].present? && eval(@document['items_json']).size == 1 && items.empty?
flash[:alert] = 'There are no items available to request for this title.'
redirect_to "/catalog/#{params['bibid']}"
return
end
# if @document['items_json'].present? && eval(@document['items_json']).size == 1 && items.empty?
# flash[:alert] = 'There are no items available to request for this title.'
# redirect_to "/catalog/#{params['bibid']}"
# return
# end

@ti = work_metadata.title
@ill_link = work_metadata.ill_link
Expand Down Expand Up @@ -213,10 +213,11 @@ def magic_request(target = '')
fastest_method = sorted_methods[:fastest]
@alternate_methods = sorted_methods[:alternate]
# Add PDA if appropriate
pda_data = PDA.pda_data(@document)
if pda_data.present?
@alternate_methods.unshift fastest_method
fastest_method = { method: PDA }.merge(pda_data)
# pda_data = PDA.pda_data(@document)
# if pda_data.present?
if PDA.available?(@document)
@alternate_methods = []
fastest_method = { method: PDA }
end

Rails.logger.debug "mjc12test8: fastest #{fastest_method}"
Expand Down Expand Up @@ -514,7 +515,6 @@ def make_pda_request

begin
response = RestClient.post(url, body, headers)
Rails.logger.debug "mjc12test8: Got response: #{response.body}"
flash[:success] = I18n.t('requests.success')
rescue StandardError => e
Rails.logger.debug "Requests: PDA request failed (#{e})"
Expand Down
20 changes: 10 additions & 10 deletions app/models/blacklight_cornell_requests/delivery_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,19 @@ def self.time(options = {})
[5, 5]
end

def self.available?(item, _)
item.nil?
def self.available?(solrdoc)
solrdoc['callnum_sort'] == 'Available for the Library to Purchase'
end

def self.pda_data(solrdoc)
return nil unless solrdoc['url_pda_display']
# def self.pda_data(solrdoc)
# return nil unless solrdoc['url_pda_display']

url, note = solrdoc['url_pda_display'][0].split('|')
{
url: url,
note: note
}
end
# url, note = solrdoc['url_pda_display'][0].split('|')
# {
# url: url,
# note: note
# }
# end
end

class PurchaseRequest < DeliveryMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%h2 Ask a Librarian
%p
We are currently unable to place a request for this item. Please
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
for more help.
- if @scan == "yes"
%br
Expand Down
2 changes: 1 addition & 1 deletion app/views/blacklight_cornell_requests/request/bd.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
.form-alternative-action
= succeed "." do
If you need further help, please
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%h2 Check at Circulation
%p
This item has a short loan period and cannot be requested. Please check at the circulation desk to see if it is available or
=link_to 'ask a librarian','http://www.library.cornell.edu/ask'
=link_to 'ask a librarian','http://www.library.cornell.edu/get-help/ask'
for help.

-if @alternate_request_options and @alternate_request_options.count >= 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-else
%div.accordion-heading.request-options.pull-left.form-alternative-action
or
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
for help.


Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
%input#request-submit.btn.btn-danger.pull-left(type="submit" name="submit" value="Submit hold request")
%div.accordion-heading.request-options.pull-left.form-alternative-action
or
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
for help.
-## Used to display working status and result of request via Ajax
#result
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
.form-alternative-action
= succeed "." do
If you need further help, please
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
%input#request-submit.btn.btn-danger.pull-left(type="submit" name="submit" value="Submit delivery request")
%div.accordion-heading.request-options.pull-left.form-alternative-action
or
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
for help.

-## Used to display working status and result of request via Ajax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
.form-alternative-action
= succeed "." do
If you need further help, please
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
4 changes: 2 additions & 2 deletions app/views/blacklight_cornell_requests/request/pda.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-# Submit Purchase Request
%div.accordion-heading.request-options.pull-left.form-alternative-action
or
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
for help.
- if [email protected]?
%br
Expand All @@ -33,7 +33,7 @@
-# Submit Purchase Request
-# %div.accordion-heading.request-options.pull-left.form-alternative-action
-# or
-# =link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
-# =link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
-# for help.
-# - if [email protected]?
-# %br
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
%input#request-submit.btn.btn-danger.pull-left(type="submit" name="submit" value="Submit delivery request")
%div.accordion-heading.request-options.pull-left.form-alternative-action
or
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
for help.
-## Used to display working status and result of request via Ajax
#result
2 changes: 1 addition & 1 deletion app/views/shared/_more_info.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
For more information about pickup locations, including
%br
hours,
= link_to "please visit our website.", 'https://www.library.cornell.edu/contactless-pickup', :target => '_blank', :title => 'library hours'
= link_to "please visit our website.", 'https://www.library.cornell.edu/libraries', :target => '_blank', :title => 'library hours'
2 changes: 1 addition & 1 deletion app/views/shared/_request_options.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@
%p.form-alternative-action
= succeed "." do
If you need further help, please
=link_to 'Ask a Librarian','http://www.library.cornell.edu/ask'
=link_to 'Ask a Librarian','http://www.library.cornell.edu/get-help/ask'
2 changes: 1 addition & 1 deletion lib/blacklight_cornell_requests/version.rb
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BlacklightCornellRequests
VERSION = "4.3"
VERSION = "4.3.1"
end
5 changes: 5 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes - blacklight-cornell-requests

## v4.3.1
- Update view links to CUL website (DISCOVERYACCESS-7931)
- Restore old behavior (Ask a librarian) for records with no items attached (DISCOVERYACCESS-7719)
- Update PDA selection to use call number field from Solr record (DISCOVERYACCESS-7944)

## v4.3 (ReShare update)
- Combine Borrow Direct and ILL functionality into a single form (effectively the old ILL form).
- Disable Borrow Direct-specific functionality and remove code for old API.
Expand Down

0 comments on commit d8fdee2

Please sign in to comment.