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

DACCESS Sprint 2 - Merge dev to main #2255

Draft
wants to merge 95 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
21084a8
Fix docker warning
sk274 Jan 8, 2025
e4bcec5
Add integration image builder/runner
sk274 Jan 8, 2025
0951ed7
Combine integration logic into production logic
sk274 Jan 9, 2025
ff7206e
Merge remote-tracking branch 'origin/dev' into DACCESS-439
sk274 Jan 10, 2025
0410978
Testing multi-processor code
gdelisle Jan 10, 2025
38f01d4
Merge branch 'dev' into DACCESS-439
gdelisle Jan 10, 2025
6984bb2
Add support for parallel processing
sk274 Jan 13, 2025
31c1d9c
Merge remote-tracking branch 'origin/dev' into DACCESS-439
sk274 Jan 15, 2025
e358e35
Update selenium image from seleniarm/standalone-chromium to selenium/…
sk274 Jan 16, 2025
cee50ac
Add docker compose files for running containerized tests on Jenkins
sk274 Jan 16, 2025
7226db1
Fix run_test.sh to use --force-recreate for non interactive test mode…
sk274 Jan 16, 2025
1cda0f0
Merge remote-tracking branch 'origin/dev' into DACCESS-439
sk274 Feb 11, 2025
046c244
Merge remote-tracking branch 'origin/dev' into DACCESS-439
sk274 Feb 17, 2025
2a46114
Remove unnecessary comments
sk274 Feb 17, 2025
d7c841e
Add container test section to Jenkins file
sk274 Feb 18, 2025
01fb21c
Add container test section to Jenkins file
sk274 Feb 18, 2025
cbb4638
Fix wrong path in Jenkins shell scripts
sk274 Feb 18, 2025
04bd830
Use chromium directly instead of selenium container; fix coverage rep…
sk274 Feb 20, 2025
404258a
Fix multiple parameter
sk274 Feb 20, 2025
2e13a3b
Export coverage path to container-tests.sh
sk274 Feb 20, 2025
763dd68
Fix chrome path
sk274 Feb 20, 2025
d83d6aa
Fix chromium user data setting for parallel tests
sk274 Feb 20, 2025
ae1aaab
Remove unnecessary docker compoe files
sk274 Feb 20, 2025
4ed5298
Send exit code from container
sk274 Feb 20, 2025
241fcbd
Remove unnecessary flags
sk274 Feb 20, 2025
fb8c2a2
Separate cucumber and rspec tests in Jenkins pipeline
sk274 Feb 25, 2025
fd99537
Separate cucumber and rspec tests in Jenkins pipeline
sk274 Feb 25, 2025
b2943c3
Separate cucumber and rspec tests in Jenkins pipeline
sk274 Feb 25, 2025
682df38
Separate cucumber and rspec tests in Jenkins pipeline
sk274 Feb 25, 2025
1b07ea1
Remove unused browse_search_field helper method
chrisrlc Jan 21, 2025
e413990
Merge pull request #2227 from cul-it/cc-browse-whoops
chrisrlc Feb 25, 2025
7527967
Override individual BentoSearch::StandardDecorator methods with prepe…
chrisrlc Feb 25, 2025
e64308f
DACCESS-516 - Fix fixedPanes bento box order bug
chrisrlc Feb 25, 2025
9f4bc8a
DACCESS-515 - Make bento single_search routes functional at least
chrisrlc Feb 26, 2025
2db7f95
Minor bento cleanup, add comments
chrisrlc Feb 26, 2025
0825be4
Remove unused BentoSearch::ArticleDecorator
chrisrlc Feb 26, 2025
8904fa0
Don't hardcode domain for item.link in BentoSearch::SolrEngine
chrisrlc Feb 26, 2025
a89a132
Remove unused search_apis.yml
chrisrlc Feb 26, 2025
8f74fbb
Merge pull request #2239 from cul-it/DACCESS-515
chrisrlc Feb 26, 2025
1315714
Add tests for display_helper
Baroquem Feb 26, 2025
4c8039e
Add tests for display_helper
Baroquem Feb 26, 2025
ab3ba58
Add tests for display_helper
Baroquem Feb 26, 2025
7f69f3a
Refactor render_display_link
Baroquem Feb 26, 2025
3fa945c
Display all the finding aid links that we have (DACCESS-300)
Baroquem Feb 26, 2025
44eb6d3
Merge branch 'dev' into DACCESS-439
sk274 Feb 27, 2025
842566b
DACCESS-300: update css for multiple finding aid links; wrap each lin…
mhk33 Feb 27, 2025
1ab136f
Create integration.rb
gdelisle Feb 27, 2025
ccac4e7
Merge branch 'dev' into DACCESS-300
Baroquem Feb 27, 2025
843272f
Merge remote-tracking branch 'origin/dev' into DACCESS-300
Baroquem Feb 27, 2025
08deb5e
Merge remote-tracking branch 'origin/DACCESS-300' into DACCESS-300
Baroquem Feb 27, 2025
27692f3
Merge pull request #2237 from cul-it/DACCESS-439
sk274 Feb 27, 2025
0646f66
Support multiple finding aids in reading room request
Baroquem Feb 27, 2025
4b4b89a
Support multiple finding aids in aeon request forms (DACCESS-300)
Baroquem Feb 27, 2025
8ceb4fc
Add tests for finding aid helper method
Baroquem Feb 27, 2025
d6e0a82
Cleanup
Baroquem Feb 27, 2025
2d25f7f
Merge branch 'dev' into DACCESS-300
Baroquem Feb 27, 2025
45caa11
Switch target to new catalog-int machine
gdelisle Feb 27, 2025
b0b6e7a
Fortify tests
Baroquem Feb 27, 2025
988f9c2
Merge remote-tracking branch 'origin/DACCESS-300' into DACCESS-300
Baroquem Feb 27, 2025
943dba3
Don't produce output for finding aids without URLs
Baroquem Feb 27, 2025
6846632
Default label
Baroquem Feb 27, 2025
e0a647f
Default label
Baroquem Feb 27, 2025
5a175e8
DACCESS-512
sarah-cul Feb 27, 2025
00372b5
Merge branch 'dev' into DACCESS-512
sarah-cul Feb 28, 2025
639adf4
Update test
Baroquem Feb 28, 2025
d9ef0ca
DACCESS-518 move the warning message and hints above the textarea for…
sarah-cul Feb 28, 2025
88e7f8a
Merge pull request #2240 from cul-it/DACCESS-300
Baroquem Feb 28, 2025
d40126f
Merge branch 'dev' into DACCESS-512
sarah-cul Feb 28, 2025
5d1a739
Merge pull request #2242 from cul-it/DACCESS-512
sarah-cul Feb 28, 2025
2e573a9
Uncomment empty bento search test
chrisrlc Mar 3, 2025
03593b9
Merge pull request #2244 from cul-it/bento-empty-search
chrisrlc Mar 3, 2025
eb70221
Eliminate redundant API key
Baroquem Mar 3, 2025
8381fd1
Merge pull request #2245 from cul-it/env-key
Baroquem Mar 4, 2025
12e444a
Use SearchService logic in bento catalog search
chrisrlc Mar 3, 2025
f6e8c91
DACCESS-517 - Return bento repository, best bet, libguide results fro…
chrisrlc Mar 3, 2025
298757a
Add TODO in bento ebsco eds engine
chrisrlc Mar 3, 2025
c632076
Link to root_path from bento search, don't hard-code
chrisrlc Mar 3, 2025
cdabf31
Merge pull request #2243 from cul-it/DACCESS-360-bento-searchable
chrisrlc Mar 4, 2025
1704318
DACCESS-482: update paths to unit library locations
mhk33 Mar 4, 2025
27631e5
DACCESS-482: tweak spacing for facet values
mhk33 Mar 4, 2025
9bcb727
Merge pull request #2248 from cul-it/DACCESS-482
mhk33 Mar 4, 2025
faa3c62
Update RMC hours link
chrisrlc Mar 5, 2025
cd1f998
Echo git branch in Jenkinsfile
chrisrlc Mar 5, 2025
5d8b42e
Remove deploy config for old machine
gdelisle Mar 5, 2025
52146c5
Merge branch 'dev' into DACCESS-439-b
gdelisle Mar 5, 2025
13d224c
Comment out RMC hours tests for now
chrisrlc Mar 5, 2025
7592b4d
Simplify test containers builds on jenkins
chrisrlc Mar 5, 2025
a827adf
Merge pull request #2253 from cul-it/test-container-build
chrisrlc Mar 6, 2025
2b89482
DACCESS-486 - Fix holdings urls on browse#info pages
chrisrlc Mar 5, 2025
1137580
DACCESS-486 - Display holdings by format on Author-Title browse pages
chrisrlc Mar 5, 2025
9a7f14a
Merge branch 'dev' into DACCESS-439-b
gdelisle Mar 6, 2025
56f5f96
Use DisplayHelper::FORMAT_MAPPINGS in browse instead of redefining
chrisrlc Mar 6, 2025
4598421
Merge pull request #2251 from cul-it/DACCESS-486-browse-holdings
chrisrlc Mar 7, 2025
a51a782
Merge branch 'dev' into DACCESS-439-b
gdelisle Mar 7, 2025
26b1eba
Merge pull request #2241 from cul-it/DACCESS-439-b
gdelisle Mar 7, 2025
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
26 changes: 24 additions & 2 deletions blacklight-cornell/app/assets/javascripts/aeon/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ function buildRequestForItem(_, element, multipleFlag) {
location = '',
callnumber = '',
copy = '',
loc_code = '',
} = itemdata[req] ?? {};

// DACCESS-512 combine location fields but make sure they are unique, do not use code field it contains 'rmc' on kheel items

const fields = [
{ name: `ItemVolume`, value: `${enumeration} ${chron}` },
{ name: `Location`, value: cslocation + ' ' + location},
{ name: `Location`, value: cleanLocation(cslocation + ' ' + location + ' ' + loc_code) },
{ name: `CallNumber`, value: callnumber },
{ name: `ItemInfo1`, value: chron },
{ name: `ItemNumber`, value: barcode },
{ name: `ItemIssue`, value: copy },
{ name: `Site`, value: (cslocation + ' ' + location).toLowerCase().includes('rmc') ? 'RMC' : 'KHEEL' },
{ name: `Site`, value: /kheel|ilr/i.test(cslocation + ' ' + location + ' ' + loc_code) ? 'KHEEL' : 'RMC' },
];
$("#RequestForm").append(`<input type="hidden" class="dynamic-input" name="Request" value="${req}">`);
const ext = multipleFlag ? `_${req}` : '';
Expand Down Expand Up @@ -81,6 +84,25 @@ function doSubmit(_) {
return true;
}

/**
* Cleans the location fields for all items by removing duplicate words
* may have duplicates due to the variety of ways location is stored for different items
* @param {string} location - original string cslocation + ' ' + location + ' ' + loc_code
* @returns {string} - cleaned location string
*/
function cleanLocation(location) {
const parts = location.split(' ');
const newLocation = [...new Set(parts)];
newLocationstr = newLocation.join(' ');

// if "Rare and Manuscript Collections" is a location, then ensure 'rmc' is included so routing rules work
// necessary for: 'sasa,rare' 'hote,rare' 'was,rare' 'ech,rare' etc.
if (newLocationstr.includes("Rare and Manuscript Collections") && !newLocationstr.includes('rmc')) {
newLocationstr += ' rmc';
}
return newLocationstr;
}

/**
* Handles the click event on a checkbox.
* Moves the item to the selected items box when a checkbox is checked or unchecked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
.fa {
margin-right: .25rem;
}
a {
display: inline;
}
.url_findingaid_link {
margin-bottom: .5rem;
}
}
.list-unstyled {
padding: 0;
Expand Down
16 changes: 12 additions & 4 deletions blacklight-cornell/app/assets/stylesheets/cornell/_facets.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.facets {
background: white;
ul {
margin: 0 0 5px 10px;
padding: 0;
list-style: none;
}
Expand Down Expand Up @@ -111,9 +110,18 @@
// ------------------------------------

// Indent child lists - default has no indentation
#facets ul.facet-hierarchy ul {
padding-left: 1.2rem;
margin-bottom: .3rem;
#facets ul.facet-hierarchy {
ul {
padding-left: 1.2rem;
margin-bottom: .3rem;
}
.h-leaf {
padding-left: 1.4rem;
}
}

.facet-hierarchy .twiddle > .toggle-handle .toggle-icon {
margin-top: 0;
}

// PUBLICATION YEAR
Expand Down
3 changes: 2 additions & 1 deletion blacklight-cornell/app/controllers/aeon_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ def scan_aeon
end

def set_variables
@finding_aid = params[:finding] || ''
# @finding_aid = params[:finding] || ''
@bibid = params[:id]
_, @document = search_service.fetch(params[:id])
@title = @document['fulltitle_display']
@author = @document['author_display']
@re506 = @document['restrictions_display']&.first&.delete_suffix("'") || ''
@finding_aids = @document['url_findingaid_display']
@disclaimer = 'Once your order is reviewed by our staff you will then be sent an invoice. ' \
'Your invoice will include information on how to pay for your order. You must pre-pay; ' \
'staff cannot fulfill your request until you pay the charges.'
Expand Down
133 changes: 19 additions & 114 deletions blacklight-cornell/app/controllers/browse_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ def info
}
query_params[:fq] = "headingTypeDesc:\"#{params[:headingtype]}\"" if params[:headingtype].present?
solr_response = solr.get 'browse', :params => query_params
@heading_document = solr_response['response']['docs'][0]
solr_doc = solr_response['response']['docs'][0]
@heading_document = solr_doc.present? ? HeadingSolrDocument.new(solr_doc) : nil

params[:authq].gsub!('%20', ' ')

# Get Library of Congress local name and format facet for Author and Subject heading
if @heading_document.present? && ['Author', 'Subject'].include?(params[:browse_type])
if @heading_document.present?
if params[:browse_type] == 'Author'
loc_url = get_author_loc_url
elsif params[:browse_type] == 'Subject'
Expand All @@ -214,9 +215,9 @@ def info
end

@loc_localname = !loc_url.blank? ? loc_url.split('/').last.inspect : ''
@formats = get_formats(params[:authq], params[:headingtype])
@formats = get_formats(params[:authq])
else
@formats = []
@formats = {}
end

respond_to do |format|
Expand Down Expand Up @@ -283,119 +284,23 @@ def get_subject_loc_url
''
end

def get_formats(query,htype)
qparam_hash = define_search_fields(query,htype)
if qparam_hash.empty?
formats = []
def get_formats(query)
browse_fields = @heading_document.browse_fields
if browse_fields.empty?
{}
else
solr = RSolr.connect :url => ENV["SOLR_URL"]
solr_response = solr.get 'select', :params => {
:q => qparam_hash[:q],
:rows => 0,
:q_row => qparam_hash[:qr],
:op_row => qparam_hash[:or],
:search_field_row => qparam_hash[:sfr],
:mm => 1
}
query = browse_fields.map { |field| "#{field}:\"#{query}\"" }.join(' OR ')
solr = RSolr.connect :url => ENV['SOLR_URL']
solr_response = solr.get 'select',
:params => {
:q => query,
:rows => 0,
:mm => 1
}

formats = solr_response['facet_counts']['facet_fields']['format']
format_facet_counts = solr_response['facet_counts']['facet_fields']['format']
Hash[*format_facet_counts]
end

# uri = "https://digital.library.cornell.edu/catalog.json?utf8=%E2%9C%93&q=#{query}&search_field=all_fields&rows=3"
# url = Addressable::URI.parse(URI.escape(uri))
# url.normalize
# portal_response = JSON.load(open(url.to_s))
# if portal_response['response']['pages']['total_count'] > 0
# formats << "Digital Collections"
# formats << portal_response['response']['pages']['total_count']
# end
f_count = 0
tmp_array = []
formats.each do |f|
if f.class == String
tmp_string = pluralize_format(f) + " (" + number_with_delimiter(formats[f_count + 1], :delimiter => ',').to_s + ")"
tmp_array << tmp_string
end
f_count = f_count + 1
end

return tmp_array.sort
end

def pluralize_format(format)
case format
when "Book"
format = "Books"
when "Journal/Periodical"
format = "Journals/Periodicals"
when "Manuscript/Archive"
format = "Manuscripts/Archives"
when "Map"
format = "Maps"
when "Musical Score"
format = "Musical Scores"
when "Non-musical Recording"
format = "Non-musical Recordings"
when "Video"
format = "Videos"
when "Computer File"
format = "Computer Files"
when "Database"
format = "Databases"
when "Musical Recording"
format = "Musical Recordings"
when "Thesis"
format = "Theses"
when "Microform"
format = "Microforms"
end
return format
end

def define_search_fields(query,htype)
temp_hash = {}
if htype == "Personal Name"
temp_hash = {:q => '(((+author_pers_browse:"' + query + '") OR author_pers_browse:"' + query + '") OR ((+subject_pers_browse:"' + query + '") OR subject_pers_browse:"' + query + '"))',
:qr => [query, query],
:or => ["AND", "AND"],
:sfr => ["author_pers_browse", "subject_pers_browse"]}
elsif htype == "Corporate Name"
temp_hash = {:q => '(((+author_corp_browse:"' + query + '") OR author_corp_browse:"' + query + '") OR ((+subject_corp_browse:"' + query + '") OR subject_corp_browse:"' + query + '"))',
:qr => [query, query],
:or => ["AND", "AND"],
:sfr => ["author_corp_browse", "subject_corp_browse"]}
elsif htype == "Event"
temp_hash = {:q => '(((+author_event_browse:"' + query + '") OR author_event_browse:"' + query + '") OR ((+subject_event_browse:"' + query + '") OR subject_event_browse:"' + query + '"))',
:qr => [query, query],
:or => ["AND", "AND"],
:sfr => ["author_event_browse", "subject_event_browse"]}
elsif htype == "Chronological Term"
temp_hash = {:q => '((+subject_era_browse:"' + query + '") OR subject_era_browse:"' + query + '")',
:qr => [query, query],
:or => ["AND"],
:sfr => ["subject_era_browse"]}
elsif htype == "Genre/Form Term"
temp_hash = {:q => '((+subject_genr_browse:"' + query + '") OR subject_genr_browse:"' + query + '")',
:qr => [query],
:or => ["AND"],
:sfr => ["subject_genr_browse"]}
elsif htype == "Geographic Name"
temp_hash = {:q => '((+subject_geo_browse:"' + query + '") OR subject_geo_browse:"' + query + '")',
:qr => [query],
:or => ["AND"],
:sfr => ["subject_geo_browse"]}
elsif htype == "Topical Term"
temp_hash = {:q => '((+subject_topic_browse:"' + query + '") OR subject_topic_browse:"' + query + '")',
:qr => [query],
:or => ["AND"],
:sfr => ["subject_topic_browse"]}
elsif htype == "Work"
temp_hash = {:q => '((+subject_work_browse:"' + query + '") OR subject_work_browse:"' + query + '")',
:qr => [query],
:or => ["AND"],
:sfr => ["subject_work_browse"]}
end
return temp_hash
end

private
Expand Down
16 changes: 1 addition & 15 deletions blacklight-cornell/app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ class CatalogController < ApplicationController
#prepend_before_action :set_return_path
end

# Ensure that the configuration file is present
begin
SEARCH_API_CONFIG = YAML.load_file("#{::Rails.root}/config/search_apis.yml")
rescue Errno::ENOENT
puts <<-eos

******************************************************************************
Your search_apis.yml config file is missing.
See config/search_apis.yml.example
******************************************************************************

eos
end

# DACCESS-215
def index
if query_has_pub_date_facet? && !params.key?(:q)
Expand Down Expand Up @@ -962,7 +948,7 @@ def folio_request(url)
token = folio_token
if url && token
headers = {
'X-Okapi-Tenant' => ENV['TENANT_ID'],
'X-Okapi-Tenant' => ENV['OKAPI_TENANT'],
'x-okapi-token' => token,
:accept => 'application/json, application/vnd.api+json'
}
Expand Down
Loading
Loading