From 177d4ab7981a2578215db6abae5fff337746f398 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 12 Aug 2024 11:07:20 -0500 Subject: [PATCH 01/15] Only render iiif drag-and-drop for resources from a manifest --- app/views/catalog/_index_header.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/catalog/_index_header.html.erb b/app/views/catalog/_index_header.html.erb index ebe800e..5dbe035 100644 --- a/app/views/catalog/_index_header.html.erb +++ b/app/views/catalog/_index_header.html.erb @@ -16,7 +16,9 @@ <% end %> <%= link_to_document document, counter: counter %> - <%= iiif_drag_n_drop get_presentation_manifest document, document_counter %> + <% if !document.uploaded_resource? %> + <%= iiif_drag_n_drop get_presentation_manifest document, document_counter %> + <% end %> <%= document_actions %> From d0eb61be583b38c0bb4277898aef01f14d1de0f9 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 12 Aug 2024 11:34:02 -0500 Subject: [PATCH 02/15] Add openseadragon to package.json --- .gitignore | 2 ++ package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 790502d..393c3e2 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ /yarn-error.log yarn-debug.log* .yarn-integrity + +featured_images/ diff --git a/package.json b/package.json index 07838e8..324fccc 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@rails/ujs": "^6.0.3", "@rails/webpacker": "5.4.4", "mirador": "^3.0.0", + "openseadragon": "^4.1.1", "react": "^16.13.1", "react-dom": "^16.13.1", "turbolinks": "^5.2.0" From 375a1f304f9105cf5d4283dc6439561ce11b20f6 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 12 Aug 2024 12:30:20 -0500 Subject: [PATCH 03/15] Debug production environment --- config/environments/production.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index 80d9051..96fada0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -137,4 +137,6 @@ # Digital Collections URL config.collections_url = ENV.fetch('COLLECTIONS_URL', 'http://library.tamu.edu/research/digital_collections') + config.assets.debug = true + end From d7b42a84803ec9f29f93532537e82ac9cd431956 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 12 Aug 2024 13:36:56 -0500 Subject: [PATCH 04/15] Fall back to runtime assets compilation --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 96fada0..f144912 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -27,7 +27,7 @@ config.assets.js_compressor = :uglifier # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false + config.assets.compile = true # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' From e3265069cc196e55c08e36af1ef7a4ab0948d737 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 12 Aug 2024 14:10:21 -0500 Subject: [PATCH 05/15] Update assets js compressor [b660bad1036e2e5a66a53ca181b5f791] ActionView::Template::Error (Unexpected token: keyword (const). To use ES6 syntax, harmony mode must be enabled with Uglifier.new(:harmony => true). App 273 output: -- App 273 output: 21867 } else if (tx === 'array') { App 273 output: 21868 return eqArray(eqAny).eq(x, y); App 273 output: 21869 } else if (tx === 'object') { App 273 output: 21870 return eqRecord(eqAny).eq(x, y); App 273 output: 21871 } App 273 output: 21872 return false; App 273 output: 21873 }); App 273 output: 21874 App 273 output: => const getPrototypeOf$2 = Object.getPrototypeOf; App 273 output: 21876 const hasProto = (v, constructor, predicate) => { App 273 output: 21877 var _a; App 273 output: 21878 if (predicate(v, constructor.prototype)) { App 273 output: 21879 return true; App 273 output: 21880 } else { App 273 output: 21881 return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name; App 273 output: 21882 } App 273 output: 21883 }; App 273 output: ==): --- config/environments/production.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index f144912..5dd2951 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -24,7 +24,7 @@ # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass - config.assets.js_compressor = :uglifier + config.assets.js_compressor = Uglifier.new(harmony: true) # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = true @@ -137,6 +137,4 @@ # Digital Collections URL config.collections_url = ENV.fetch('COLLECTIONS_URL', 'http://library.tamu.edu/research/digital_collections') - config.assets.debug = true - end From 7b6e244e972a68cdf5539f1c66e7c0a2f4335587 Mon Sep 17 00:00:00 2001 From: William Welling Date: Mon, 12 Aug 2024 14:49:14 -0500 Subject: [PATCH 06/15] Disable js compressor --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 5dd2951..ea68864 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -24,7 +24,7 @@ # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass - config.assets.js_compressor = Uglifier.new(harmony: true) + # config.assets.js_compressor = Uglifier.new(harmony: true) # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = true From 93de9fef552cc86a406b7f669179f30cedab42a7 Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 13 Aug 2024 19:58:12 -0500 Subject: [PATCH 07/15] Dependency updates --- Gemfile | 36 ++++++++++++++++++++---------------- package.json | 1 - 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index 1f2aaf8..adeaf64 100644 --- a/Gemfile +++ b/Gemfile @@ -4,15 +4,15 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.1.6' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 6.1' +gem 'rails', '~> 6.1.7', '>= 6.1.7.8' # Use sqlite3 as the database for Active Record gem 'sqlite3', '~> 1.4' # Use Puma as the app server -gem 'puma', '~> 4.1' +gem 'puma', '~> 5.0' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker -gem 'webpacker', '~> 4.0' +gem 'webpacker', '~> 5.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder @@ -35,28 +35,26 @@ end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. - gem 'web-console', '>= 3.3.0' + gem 'web-console', '>= 4.1.0' + # Display performance information such as SQL time and flame graphs for each request in your browser. + # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md + gem 'rack-mini-profiler', '~> 2.0' end group :test do # Adds support for Capybara system testing and selenium driver - gem 'capybara', '>= 2.15' - gem 'selenium-webdriver', '~> 3.142', '>= 3.142.7' + gem 'capybara', '>= 3.26' + gem 'selenium-webdriver', '>= 4.0.0.rc1' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data' - -gem 'pg' - -gem 'devise_saml_authenticatable' - -gem 'tinymce-rails' +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'blacklight', ' ~> 7.0' gem 'blacklight-spotlight', ' ~> 3.0.3' + group :development, :test do gem 'solr_wrapper', '>= 0.3' end @@ -66,13 +64,19 @@ gem 'bootstrap', '~> 4.0' gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript' gem 'jquery-rails' gem 'devise' -gem 'devise-guests', '~> 0.6' +gem 'devise-guests', '~> 0.8' gem 'coffee-rails', '~> 4.2' gem 'uglifier', '>= 1.3.0' gem 'friendly_id' +gem 'riiif' gem 'sitemap_generator' -gem 'blacklight-gallery', '~> 1.1' +gem 'blacklight-gallery', '~> 4.0' +gem 'openseadragon', '>= 0.2.0' gem 'blacklight-oembed', '~> 1.0' gem 'devise_invitable' -gem 'psych', '~> 3.1' +gem 'devise_saml_authenticatable' + +gem 'tinymce-rails' + +gem 'pg' diff --git a/package.json b/package.json index 324fccc..07838e8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "@rails/ujs": "^6.0.3", "@rails/webpacker": "5.4.4", "mirador": "^3.0.0", - "openseadragon": "^4.1.1", "react": "^16.13.1", "react-dom": "^16.13.1", "turbolinks": "^5.2.0" From 26aa185af89805d865f52aa21bdde5ad79468f01 Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 13 Aug 2024 19:58:40 -0500 Subject: [PATCH 08/15] Update default production environment config --- config/environments/production.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index ea68864..e90c0b2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -23,11 +23,11 @@ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress CSS using a preprocessor. - # config.assets.css_compressor = :sass - # config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.css_compressor = :sass + config.assets.js_compressor = Uglifier.new(harmony: true) # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = true + config.assets.compile = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' From 053672e054353786393092e969c9f942e642c7c5 Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 13 Aug 2024 20:15:24 -0500 Subject: [PATCH 09/15] Link openseadragon-assets in manifest --- app/assets/config/manifest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 99db349..7b8b24e 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,3 +1,5 @@ //= link_tree ../images //= link_directory ../stylesheets .css -//= link_directory ../javascripts .js \ No newline at end of file +//= link_directory ../javascripts .js + +//= link openseadragon-assets From 0520c44dce49a1f10bb8fe383694019ccfc7c169 Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 13 Aug 2024 20:29:31 -0500 Subject: [PATCH 10/15] Update _index_header.html.erb --- app/views/catalog/_index_header.html.erb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/catalog/_index_header.html.erb b/app/views/catalog/_index_header.html.erb index 5dbe035..ebe800e 100644 --- a/app/views/catalog/_index_header.html.erb +++ b/app/views/catalog/_index_header.html.erb @@ -16,9 +16,7 @@ <% end %> <%= link_to_document document, counter: counter %> - <% if !document.uploaded_resource? %> - <%= iiif_drag_n_drop get_presentation_manifest document, document_counter %> - <% end %> + <%= iiif_drag_n_drop get_presentation_manifest document, document_counter %> <%= document_actions %> From 530903bdc99ba50be25755d493edafd3c1d692ac Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 13 Aug 2024 20:31:19 -0500 Subject: [PATCH 11/15] Update .gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 393c3e2..790502d 100644 --- a/.gitignore +++ b/.gitignore @@ -39,5 +39,3 @@ /yarn-error.log yarn-debug.log* .yarn-integrity - -featured_images/ From 737c0b85d4c2def78b7c9bed4ec970ad6fe14df3 Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 13 Aug 2024 20:37:27 -0500 Subject: [PATCH 12/15] Conditionally render IIIF drag and drop --- app/views/catalog/_index_header.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/catalog/_index_header.html.erb b/app/views/catalog/_index_header.html.erb index ebe800e..5dbe035 100644 --- a/app/views/catalog/_index_header.html.erb +++ b/app/views/catalog/_index_header.html.erb @@ -16,7 +16,9 @@ <% end %> <%= link_to_document document, counter: counter %> - <%= iiif_drag_n_drop get_presentation_manifest document, document_counter %> + <% if !document.uploaded_resource? %> + <%= iiif_drag_n_drop get_presentation_manifest document, document_counter %> + <% end %> <%= document_actions %> From 7a4ce126248dacd4c373269de2aa14760bcead8c Mon Sep 17 00:00:00 2001 From: William Welling Date: Tue, 13 Aug 2024 20:37:35 -0500 Subject: [PATCH 13/15] Downgrade blacklight-gallery --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index adeaf64..cb6ed6d 100644 --- a/Gemfile +++ b/Gemfile @@ -70,7 +70,7 @@ gem 'uglifier', '>= 1.3.0' gem 'friendly_id' gem 'riiif' gem 'sitemap_generator' -gem 'blacklight-gallery', '~> 4.0' +gem 'blacklight-gallery', '~> 1.1' gem 'openseadragon', '>= 0.2.0' gem 'blacklight-oembed', '~> 1.0' gem 'devise_invitable' From 87b19aa4ef065373dfe6fb35379548ba5aef7c20 Mon Sep 17 00:00:00 2001 From: William Welling Date: Wed, 14 Aug 2024 10:48:19 -0500 Subject: [PATCH 14/15] Disable source maps for production --- config/environments/production.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index e90c0b2..4b51836 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -26,6 +26,8 @@ config.assets.css_compressor = :sass config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.debug = false + # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false From 90528c65cc3f01831445fbaa76ec336bf716db04 Mon Sep 17 00:00:00 2001 From: William Welling Date: Thu, 15 Aug 2024 10:31:14 -0500 Subject: [PATCH 15/15] Update package.json version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 07838e8..9ec556c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "react-dom": "^16.13.1", "turbolinks": "^5.2.0" }, - "version": "3.0.4-RC1", + "version": "3.0.5-RC1", "devDependencies": { "webpack-dev-server": "^3.11.0" }