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

Allow Alma guest users to request all - In Library Use - from ReCAP #3848

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions app/views/requests/request/_request_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
<span class="error error-items">
</span>
</div>
<% if @request.alma_provider_on_shelf_item_available? %>
<h2><%=I18n.t('requests.alma_login.no_access')%> </h2>
<p><%=I18n.t('requests.alma_login.available_no_access', library: @request.location_label) %></p>
<% elsif @request.alma_provider_item_unavailable? %>
<h2><%=I18n.t('requests.alma_login.unavailable')%> </h2>

<% if @request.alma_provider_item_unavailable? %>
<h2><%=I18n.t('requests.alma_login.unavailable')%> </h2> %>
<% elsif @request.only_aeon? %>
<%= render partial: "requestable_list_aeon", locals: { requestable_list: @request.requestable, mfhd: @request.mfhd, holdings: @request.holdings, default_pick_ups: @request.default_pick_ups } %>
<% else %>
Expand Down
183 changes: 182 additions & 1 deletion spec/cassettes/request_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9734,4 +9734,185 @@ http_interactions:
Available","status_label":"Acquisitions and Cataloging","status_source":"work_order","process_type":null,"on_reserve":"N","item_type":"Gen","pickup_location_id":"recap","pickup_location_code":"recap","location":"recap$pa","label":"ReCAP
- Remote Storage","description":"","enum_display":"","chron_display":"","in_temp_library":false}]'
recorded_at: Thu, 30 Mar 2023 14:11:29 GMT
recorded_with: VCR 6.1.0
- request:
method: get
uri: https://catalog.princeton.edu/catalog/99127133356906421/raw
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Faraday v2.7.11
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- "*/*"
response:
status:
code: 200
message: OK
headers:
Server:
- nginx/1.25.1
Date:
- Wed, 22 Nov 2023 15:06:54 GMT
Content-Type:
- application/json; charset=utf-8
Transfer-Encoding:
- chunked
Connection:
- keep-alive
Status:
- 200 OK
Cache-Control:
- max-age=0, private, must-revalidate
Referrer-Policy:
- strict-origin-when-cross-origin
X-Permitted-Cross-Domain-Policies:
- none
X-Xss-Protection:
- 1; mode=block
X-Request-Id:
- b8594820-190e-4f1e-b191-2b2e0fef0092
X-Download-Options:
- noopen
X-Ua-Compatible:
- IE=edge,chrome=1
Etag:
- W/"c2f5bc8f8759b6edb6e8c67cb953ad6a"
X-Frame-Options:
- SAMEORIGIN
X-Runtime:
- '0.030914'
X-Content-Type-Options:
- nosniff
X-Powered-By:
- Phusion Passenger(R) 6.0.18
Access-Control-Allow-Origin:
- "*"
Access-Control-Allow-Credentials:
- 'true'
Access-Control-Allow-Methods:
- GET, POST, OPTIONS
Access-Control-Allow-Headers:
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Origin
body:
encoding: ASCII-8BIT
string: !binary |-
eyJpZCI6Ijk5MTI3MTMzMzU2OTA2NDIxIiwibnVtZXJpY19pZF9iIjp0cnVlLCJhdXRob3JfZGlzcGxheSI6WyJSb21hbmksIEZlbGljZSwgMTc4OC0xODY1Il0sImF1dGhvcl9jaXRhdGlvbl9kaXNwbGF5IjpbIlJvbWFuaSwgRmVsaWNlIiwiSHVnbywgVmljdG9yIiwiRG9uaXpldHRpLCBHYWV0YW5vIl0sImF1dGhvcl9yb2xlc18xZGlzcGxheSI6IntcInNlY29uZGFyeV9hdXRob3JzXCI6W1wiSHVnbywgVmljdG9yXCIsXCJEb25pemV0dGksIEdhZXRhbm9cIl0sXCJ0cmFuc2xhdG9yc1wiOltdLFwiZWRpdG9yc1wiOltdLFwiY29tcGlsZXJzXCI6W10sXCJwcmltYX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WVuZGVsIE11c2ljIExpYnJhcnkiXSwibmFtZV90aXRsZV9icm93c2VfcyI6WyJIdWdvLCBWaWN0b3IsIDE4MDItMTg4NS4gTHVjcmXMgGNlIEJvcmdpYSIsIkRvbml6ZXR0aSwgR2FldGFubywgMTc5Ny0xODQ4LiBMdWNyZXppYSBCb3JnaWEiLCJSb21hbmksIEZlbGljZSwgMTc4OC0xODY1LiBMdWNyZXppYSBCb3JnaWEiXSwiY2FsbF9udW1iZXJfZGlzcGxheSI6WyJNTDUwLkQ2ODMgTDkgMTg0MHoiXSwiY2FsbF9udW1iZXJfYnJvd3NlX3MiOlsiTUw1MC5ENjgzIEw5IDE4NDB6Il0sImNhbGxfbnVtYmVyX2xvY2F0b3JfZGlzcGxheSI6WyJNTDUwLkQ2ODMgTDkgMTg0MHoiXSwiaGFzaGVkX2lkX3NzaSI6IjAwNDhkOTk3ZjUzNzNlZjMiLCJfdmVyc2lvbl8iOjE3Nzc0NjMxNDU2NTQxMjQ1NDQsInRpbWVzdGFtcCI6IjIwMjMtMDktMTlUMTA6NTU6NTAuMjM4WiJ9
recorded_at: Wed, 22 Nov 2023 15:06:54 GMT
- request:
method: get
uri: https://bibdata-staging.princeton.edu/locations/holding_locations/mendel$pk.json
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Faraday v2.7.11
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- "*/*"
response:
status:
code: 200
message: OK
headers:
Server:
- nginx/1.25.1
Date:
- Wed, 22 Nov 2023 15:06:54 GMT
Content-Type:
- application/json; charset=utf-8
Transfer-Encoding:
- chunked
Connection:
- keep-alive
Status:
- 200 OK
Access-Control-Allow-Headers:
- Origin, Content-Type, Accept, Authorization, Token
Cache-Control:
- max-age=0, private, must-revalidate
Access-Control-Allow-Origin:
- "*"
Etag:
- W/"4bf8e9d8c93ea6d263bcd65fc04491f1"
X-Runtime:
- '0.019123'
Access-Control-Request-Method:
- GET
X-Request-Id:
- 575ffb22-4807-4d73-aa1f-e6a430c701e3
X-Powered-By:
- Phusion Passenger(R) 6.0.19
body:
encoding: UTF-8
string: '{"label":"Remote Storage (ReCAP)","code":"mendel$pk","aeon_location":false,"recap_electronic_delivery_location":true,"open":false,"requestable":true,"always_requestable":false,"circulates":true,"remote_storage":"recap_rmt","fulfillment_unit":"Closed","library":{"label":"Mendel
Music Library","code":"mendel","order":0},"holding_library":{"label":"Mendel
Music Library","code":"mendel","order":0},"delivery_locations":[{"label":"Technical
Services 693","address":"693 Alexander Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"[email protected]","gfa_pickup":"QT","staff_only":true,"pickup_location":true,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"Mendel Music Library","address":"Woolworth
Center Princeton, NJ 08544","phone_number":"609-258-3230","contact_email":"[email protected]","gfa_pickup":"PK","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Mendel
Music Library","code":"mendel","order":0}},{"label":"Firestone Library, Resource
Sharing","address":"One Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"[email protected]","gfa_pickup":"QA","staff_only":true,"pickup_location":true,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"Technical Services HMT","address":"One
Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"[email protected]","gfa_pickup":"QC","staff_only":true,"pickup_location":true,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"Preservation","address":"One
Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"[email protected]","gfa_pickup":"QP","staff_only":true,"pickup_location":false,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}}]}'
recorded_at: Wed, 22 Nov 2023 15:06:54 GMT
- request:
method: get
uri: https://bibdata-staging.princeton.edu/bibliographic/99127133356906421/holdings/22971539920006421/availability.json
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Faraday v2.7.11
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- "*/*"
response:
status:
code: 200
message: OK
headers:
Server:
- nginx/1.25.1
Date:
- Wed, 22 Nov 2023 15:07:01 GMT
Content-Type:
- application/json; charset=utf-8
Transfer-Encoding:
- chunked
Connection:
- keep-alive
Status:
- 200 OK
Access-Control-Allow-Headers:
- Origin, Content-Type, Accept, Authorization, Token
Cache-Control:
- max-age=0, private, must-revalidate
Access-Control-Allow-Origin:
- "*"
Etag:
- W/"cc2e797fc48ba3fe8073af44458ee2d2"
X-Runtime:
- '7.092285'
Access-Control-Request-Method:
- GET
X-Request-Id:
- 4a641547-468d-48ef-843e-6f6a14754c52
X-Powered-By:
- Phusion Passenger(R) 6.0.19
body:
encoding: UTF-8
string: '[{"barcode":"32101111747083","id":"23971539900006421","holding_id":"22971539920006421","copy_number":"","status":"Available","status_label":"Item
in place","status_source":"base_status","process_type":null,"on_reserve":"N","item_type":"Closed","pickup_location_id":"mendel","pickup_location_code":"mendel","location":"mendel$pk","label":"Mendel
Music Library - Remote Storage (ReCAP)","description":"","enum_display":"","chron_display":"","in_temp_library":false}]'
recorded_at: Wed, 22 Nov 2023 15:07:01 GMT
recorded_with: VCR 6.2.0
10 changes: 8 additions & 2 deletions spec/features/requests/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,13 @@
expect(page).to have_content 'Physical Item Delivery'
end

it "allows a physical pickup request of a - Library In Use - ReCAP Item" do
stub_scsb_availability(bib_id: "99127133356906421", institution_id: "PUL", barcode: "32101111747083")
visit 'requests/99127133356906421?aeon=false&mfhd=22971539920006421'
expect(page).not_to have_content 'Electronic Delivery'
expect(page).to have_content 'Available for In Library Use'
end

it "allows only physical pickup to enumerated annex item" do
stub_alma_hold_success('9947220743506421', '22734584180006421', '23734584140006421', user.uid)

Expand Down Expand Up @@ -1491,7 +1498,6 @@
expect(page).not_to have_content 'Electronic Delivery'
expect(page).not_to have_content 'Physical Item Delivery'
expect(page).to have_content 'Request options for this item are only available to Faculty, Staff, and Students.'
expect(page).to have_content 'Please proceed to Firestone Library - Classics Collection to retrieve this item'
end

it "does not allow access to items on the shelf when not available" do
Expand Down Expand Up @@ -1554,7 +1560,7 @@
end
end

it "does not allow reuesting of on order books" do
it "does not allow requesting of on order books" do
visit "requests/99125492003506421?mfhd=22927395910006421"
expect(page).to have_content 'This item is not available'
end
Expand Down
124 changes: 123 additions & 1 deletion spec/fixtures/alma_login_response.json
Original file line number Diff line number Diff line change
@@ -1 +1,123 @@
{"record_type":{"value":"PUBLIC","desc":"Public"},"primary_id":"logintest","first_name":"login","middle_name":"","last_name":"test","full_name":"login test","user_title":{"value":"","desc":""},"job_category":{"value":"","desc":""},"job_description":"","gender":{"value":"","desc":""},"user_group":{"value":"Affiliate","desc":"Affiliate"},"campus_code":{"value":null,"desc":""},"web_site_url":"","cataloger_level":{"value":"00","desc":"[00] Default Level"},"preferred_language":{"value":"en","desc":"English"},"account_type":{"value":"INTERNAL","desc":"Internal"},"external_id":"","password":"","force_password_change":"","status":{"value":"ACTIVE","desc":"Active"},"status_date":"2022-03-21Z","requests":{"value":0,"link":"https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/logintest/requests"},"loans":{"value":0,"link":"https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/logintest/loans"},"fees":{"value":0.0,"link":"https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/logintest/fees"},"contact_info":{"address":[],"email":[{"email_address":"[email protected]","description":null,"preferred":true,"segment_type":"Internal","email_type":[{"value":"alternative","desc":"Alternative"}]}],"phone":[]},"pref_first_name":"","pref_middle_name":"","pref_last_name":"","pref_name_suffix":"","is_researcher":false,"researcher":null,"link":null,"user_identifier":[{"value":"11122233344455","id_type":{"value":"BARCODE","desc":"Barcode"},"note":null,"status":"ACTIVE","segment_type":"Internal"}],"user_role":[{"status":{"value":"ACTIVE","desc":"Active"},"scope":{"value":"01PRI_INST","desc":"Princeton University Library"},"role_type":{"value":"200","desc":"Patron"},"parameter":[]}],"user_block":[],"user_note":[],"user_statistic":[],"proxy_for_user":[]}
{
"record_type": {
"value": "PUBLIC",
"desc": "Public"
},
"primary_id": "logintest",
"first_name": "login",
"middle_name": "",
"last_name": "test",
"full_name": "login test",
"user_title": {
"value": "",
"desc": ""
},
"job_category": {
"value": "",
"desc": ""
},
"job_description": "",
"gender": {
"value": "",
"desc": ""
},
"user_group": {
"value": "Affiliate",
"desc": "Affiliate"
},
"campus_code": {
"value": null,
"desc": ""
},
"web_site_url": "",
"cataloger_level": {
"value": "00",
"desc": "[00] Default Level"
},
"preferred_language": {
"value": "en",
"desc": "English"
},
"account_type": {
"value": "INTERNAL",
"desc": "Internal"
},
"external_id": "",
"password": "",
"force_password_change": "",
"status": {
"value": "ACTIVE",
"desc": "Active"
},
"status_date": "2022-03-21Z",
"requests": {
"value": 0,
"link": "https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/logintest/requests"
},
"loans": {
"value": 0,
"link": "https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/logintest/loans"
},
"fees": {
"value": 0.0,
"link": "https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/logintest/fees"
},
"contact_info": {
"address": [],
"email": [
{
"email_address": "[email protected]",
"description": null,
"preferred": true,
"segment_type": "Internal",
"email_type": [
{
"value": "alternative",
"desc": "Alternative"
}
]
}
],
"phone": []
},
"pref_first_name": "",
"pref_middle_name": "",
"pref_last_name": "",
"pref_name_suffix": "",
"is_researcher": false,
"researcher": null,
"link": null,
"user_identifier": [
{
"value": "11122233344455",
"id_type": {
"value": "BARCODE",
"desc": "Barcode"
},
"note": null,
"status": "ACTIVE",
"segment_type": "Internal"
}
],
"user_role": [
{
"status": {
"value": "ACTIVE",
"desc": "Active"
},
"scope": {
"value": "01PRI_INST",
"desc": "Princeton University Library"
},
"role_type": {
"value": "200",
"desc": "Patron"
},
"parameter": []
}
],
"user_block": [],
"user_note": [],
"user_statistic": [],
"proxy_for_user": []
}