From 28951189f1acd07cf5dd64439b6ca37bdc0c9a7e Mon Sep 17 00:00:00 2001 From: Christina Chortaria Date: Sat, 27 May 2023 11:13:32 -0400 Subject: [PATCH] When multiple checked selectboxes and deselect one, preserve the active request button --- app/assets/javascripts/requests/requests.js | 4 +++- solr/conf/solrconfig.xml | 2 ++ spec/features/requests/request_spec.rb | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/requests/requests.js b/app/assets/javascripts/requests/requests.js index 726018211..30250c64a 100644 --- a/app/assets/javascripts/requests/requests.js +++ b/app/assets/javascripts/requests/requests.js @@ -140,7 +140,9 @@ $(function() { if (selected && deMode && deLocation) { activateRequestButton(); } else { - deactivateRequestButton(); + if ($('input:checkbox').filter(':checked').length < 1){ + deactivateRequestButton(); + } } } diff --git a/solr/conf/solrconfig.xml b/solr/conf/solrconfig.xml index ed32690f9..fd4b6ab6a 100644 --- a/solr/conf/solrconfig.xml +++ b/solr/conf/solrconfig.xml @@ -303,6 +303,7 @@ isbn_t^3 issn_s^3 lccn_s^3 + uncontrolled_keyword_unstem_search^3 text description_t cjk_all @@ -329,6 +330,7 @@ isbn_t^30 issn_s^30 lccn_s^30 + uncontrolled_keyword_unstem_search^10 text^10 description_t^10 cjk_all^10 diff --git a/spec/features/requests/request_spec.rb b/spec/features/requests/request_spec.rb index da8180a4d..c3cd96c83 100644 --- a/spec/features/requests/request_spec.rb +++ b/spec/features/requests/request_spec.rb @@ -1539,7 +1539,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 @@ -1605,6 +1605,14 @@ expect(confirm_email.subject).to eq("In Process Request") end end + context 'when multiple checkboxes selected' do + # if delivery mode in one checkbox parent is selected + # the request button is active + # deselecting another checkbox will not deactivate the request button + # visit 'requests/99125465081006421?mfhd=22922148510006421' + ## better to work also ticket https://github.com/pulibrary/orangelight/issues/3595 + + end end # rubocop:enable RSpec/MultipleExpectations end