From 0ef0d6aedff1cf7ebd06d301e257ebe88ca20ea4 Mon Sep 17 00:00:00 2001 From: Jonathan Rochkind Date: Thu, 12 Dec 2024 16:21:22 -0500 Subject: [PATCH 1/5] Avoid gap in viewer footer for child works with very large windows This CSS has gotten a bit hack on top of hack, but good enough for now. --- app/frontend/stylesheets/local/scihist_viewer.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/frontend/stylesheets/local/scihist_viewer.scss b/app/frontend/stylesheets/local/scihist_viewer.scss index 2badc6210..c002b9822 100644 --- a/app/frontend/stylesheets/local/scihist_viewer.scss +++ b/app/frontend/stylesheets/local/scihist_viewer.scss @@ -364,6 +364,7 @@ $scihist_image_viewer_thumb_width: 54px; // Needs to match ImageServiceHelper::T padding: $btn-padding-y-lg $btn-padding-x-lg; border: 1px solid $primary; + max-width: unset; flex-grow: 4; white-space: nowrap; overflow: hidden; From c7700bed392fa4a2bc03aca4cc1afcdbdaeaa427 Mon Sep 17 00:00:00 2001 From: Jonathan Rochkind Date: Thu, 12 Dec 2024 16:24:34 -0500 Subject: [PATCH 2/5] avoid uppercasing title of child work in viewer footer --- app/frontend/stylesheets/local/scihist_viewer.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/frontend/stylesheets/local/scihist_viewer.scss b/app/frontend/stylesheets/local/scihist_viewer.scss index c002b9822..d8c912ad6 100644 --- a/app/frontend/stylesheets/local/scihist_viewer.scss +++ b/app/frontend/stylesheets/local/scihist_viewer.scss @@ -370,8 +370,6 @@ $scihist_image_viewer_thumb_width: 54px; // Needs to match ImageServiceHelper::T overflow: hidden; text-overflow: ellipsis; text-align: left; - - text-transform: uppercase; } .viewer-spacer { width: 0; From fc93ae9ef0b7ac5b1b8097ff065ad6b5a22f6c69 Mon Sep 17 00:00:00 2001 From: Jonathan Rochkind Date: Thu, 12 Dec 2024 12:14:51 -0500 Subject: [PATCH 3/5] Remove yarn resolution to bootstrap4 no longer needed or wanted because we are using bootstrap4 This may have caused both bootstrap4 and 5 to be loaded in our app? Lucky it didn't cause terrible problems if it didn't! --- package.json | 3 --- yarn.lock | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/package.json b/package.json index 2af170e1e..aecd03474 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,6 @@ "vite-plugin-ruby": "^5.1.0", "vite-plugin-sass-glob-import": "^3.0.2" }, - "resolutions": { - "blacklight-frontend/bootstrap": "^4.6.2" - }, "browserslist": [ "defaults" ], diff --git a/yarn.lock b/yarn.lock index 41df98764..7ffc85c2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -379,12 +379,7 @@ blacklight-range-limit@9.0.0-beta2: dependencies: chart.js "^ 4.4.1" -"bootstrap@>=4.3.1 <6.0.0", bootstrap@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.6.2.tgz#8e0cd61611728a5bf65a3a2b8d6ff6c77d5d7479" - integrity sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ== - -"bootstrap@^ 5.0.0": +"bootstrap@>=4.3.1 <6.0.0", "bootstrap@^ 5.0.0": version "5.3.3" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.3.tgz#de35e1a765c897ac940021900fcbb831602bac38" integrity sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg== From f6ce7ab99379f03dd0cd00257a5211dc5d0bb538 Mon Sep 17 00:00:00 2001 From: Eddie Rubeiz Date: Wed, 18 Dec 2024 15:30:53 -0500 Subject: [PATCH 4/5] using a text field for box and folder --- app/controllers/catalog_controller.rb | 17 +++++++++++++++++ app/indexers/work_indexer.rb | 6 ++++++ solr/config/schema.xml | 6 ++++++ spec/indexers/work_indexer_spec.rb | 26 ++++++++++++++++++++++++++ 4 files changed, 55 insertions(+) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index d56eb8737..799202132 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -361,6 +361,23 @@ def active_sort_fields # case for a BL "search field", which is really a dismax aggregate # of Solr search fields. + + # See https://github.com/sciencehistory/scihist_digicoll/issues/2585 + # Note that a Work can be associated with two consecutive boxes, in which case the box number is something like "34-35". + config.add_search_field('box') do |field| + field.label = 'Box' + field.solr_parameters = { + qf: 'box_tsi', + } + end + + config.add_search_field('folder') do |field| + field.label = 'Folder' + field.solr_parameters = { + qf: 'folder_tsi', + } + end + # config.add_search_field('title') do |field| # # solr_parameters hash are sent to Solr as ordinary url query params. # field.solr_parameters = { diff --git a/app/indexers/work_indexer.rb b/app/indexers/work_indexer.rb index 9d6b56ca6..bea23b3c1 100644 --- a/app/indexers/work_indexer.rb +++ b/app/indexers/work_indexer.rb @@ -61,6 +61,12 @@ class WorkIndexer < Kithe::Indexer acc.concat(DateIndexHelper.new(record).expanded_years) end + to_field "box_tsi", obj_extract("physical_container"), transform( ->(v) { v.box if v.box.present? }) + to_field "folder_tsi", obj_extract("physical_container"), transform( ->(v) { v.folder if v.folder.present? }) + to_field "box_sort", obj_extract("physical_container"), transform( ->(v) { v.box[/\d+/] if v.box.present? }) + to_field "folder_sort", obj_extract("physical_container"), transform( ->(v) { v.folder[/\d+/] if v.folder.present? }) + + # For sorting by oldest first to_field "earliest_date" do |record, acc| # for Solr, we need in "xml schema" format, with 00:00:00 time, and UTC timezone diff --git a/solr/config/schema.xml b/solr/config/schema.xml index 0f5166959..2a8d48676 100644 --- a/solr/config/schema.xml +++ b/solr/config/schema.xml @@ -257,6 +257,12 @@ + + + + + + + + + +