From 5f0f48f762beaa8916e80ebb80819199113ae6af Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Wed, 24 Apr 2019 11:22:43 +0200 Subject: [PATCH 01/18] upgrading rails and actionview --- Gemfile | 5 +- Gemfile.lock | 248 ++++++++++++++++++++++-------------------- config/blacklight.yml | 2 +- 3 files changed, 134 insertions(+), 121 deletions(-) diff --git a/Gemfile b/Gemfile index 99f6e15..cf7b8ad 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,10 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.0.1' +gem 'rails', '~> 5.1.4' +# gem 'rails', '~> 5.0.1' +gem "actionview", ">= 5.0.7.2" +# # Use sqlite3 as the database for Active Record gem 'sqlite3' # Use Puma as the app server diff --git a/Gemfile.lock b/Gemfile.lock index cbde8f4..653526e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,68 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.0.4) - actionpack (= 5.0.4) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.7) + actionpack (= 5.1.7) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.4) - actionpack (= 5.0.4) - actionview (= 5.0.4) - activejob (= 5.0.4) + actionmailer (5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.4) - actionview (= 5.0.4) - activesupport (= 5.0.4) + actionpack (5.1.7) + actionview (= 5.1.7) + activesupport (= 5.1.7) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.4) - activesupport (= 5.0.4) + actionview (5.1.7) + activesupport (= 5.1.7) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.4) - activesupport (= 5.0.4) + activejob (5.1.7) + activesupport (= 5.1.7) globalid (>= 0.3.6) - activemodel (5.0.4) - activesupport (= 5.0.4) - activerecord (5.0.4) - activemodel (= 5.0.4) - activesupport (= 5.0.4) - arel (~> 7.0) - activesupport (5.0.4) + activemodel (5.1.7) + activesupport (= 5.1.7) + activerecord (5.1.7) + activemodel (= 5.1.7) + activesupport (= 5.1.7) + arel (~> 8.0) + activesupport (5.1.7) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) + i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - arel (7.1.4) - autoprefixer-rails (7.1.1.2) + arel (8.0.0) + autoprefixer-rails (9.5.1) execjs - bcrypt (3.1.11) - bindex (0.5.0) - blacklight (6.10.1) + bcrypt (3.1.12) + bindex (0.7.0) + blacklight (6.20.0) bootstrap-sass (~> 3.2) deprecation globalid + jbuilder (~> 2.7) kaminari (>= 0.15) nokogiri (~> 1.6) rails (>= 4.2, < 6) rsolr (>= 1.0.6, < 3) twitter-typeahead-rails (= 0.11.1.pre.corejavascript) - blacklight-gallery (0.8.0) + blacklight-gallery (0.11.0) blacklight (~> 6.3) bootstrap-sass (~> 3.0) openseadragon (>= 0.2.0) rails - bootstrap-sass (3.3.7) + bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) - sass (>= 3.3.4) + sassc (>= 2.0.0) builder (3.2.3) - byebug (9.0.6) + byebug (11.0.1) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) @@ -69,35 +70,37 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.5) + crass (1.0.4) deprecation (1.0.0) activesupport - devise (4.3.0) + devise (4.6.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 4.1.0, < 5.2) + railties (>= 4.1.0, < 6.0) responders warden (~> 1.2.3) - devise-guests (0.6.0) + devise-guests (0.7.0) devise - devise_cas_authenticatable (1.10.0) + devise_cas_authenticatable (1.10.3) devise (>= 1.2.0) rubycas-client (>= 2.2.1) - erubis (2.7.0) + erubi (1.8.0) execjs (2.7.0) - faraday (0.12.1) + faraday (0.15.4) multipart-post (>= 1.2, < 3) - ffi (1.9.18) - font-awesome-rails (4.7.0.2) - railties (>= 3.2, < 5.2) - globalid (0.4.0) + ffi (1.10.0) + font-awesome-rails (4.7.0.5) + railties (>= 3.2, < 6.1) + globalid (0.4.2) activesupport (>= 4.2.0) high_voltage (3.0.0) - i18n (0.8.4) - jbuilder (2.7.0) + i18n (1.6.0) + concurrent-ruby (~> 1.0) + jbuilder (2.8.0) activesupport (>= 4.2.0) multi_json (>= 1.2) - jquery-rails (4.3.1) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -107,92 +110,98 @@ GEM jquery-ui-rails (6.0.1) railties (>= 3.2.16) jstree-rails-4 (3.3.4) - kaminari (1.0.1) + kaminari (1.1.1) activesupport (>= 4.1.0) - kaminari-actionview (= 1.0.1) - kaminari-activerecord (= 1.0.1) - kaminari-core (= 1.0.1) - kaminari-actionview (1.0.1) + kaminari-actionview (= 1.1.1) + kaminari-activerecord (= 1.1.1) + kaminari-core (= 1.1.1) + kaminari-actionview (1.1.1) actionview - kaminari-core (= 1.0.1) - kaminari-activerecord (1.0.1) + kaminari-core (= 1.1.1) + kaminari-activerecord (1.1.1) activerecord - kaminari-core (= 1.0.1) - kaminari-core (1.0.1) + kaminari-core (= 1.1.1) + kaminari-core (1.1.1) libv8 (3.16.14.19) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - loofah (2.0.3) + loofah (2.2.3) + crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.6.6) - mime-types (>= 1.16, < 4) - method_source (0.8.2) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.2.0) - minitest (5.10.2) - multi_json (1.12.1) + mail (2.7.1) + mini_mime (>= 0.1.1) + method_source (0.9.2) + mini_mime (1.0.1) + mini_portile2 (2.4.0) + minitest (5.11.3) + multi_json (1.13.1) multipart-post (2.0.0) - nio4r (2.1.0) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) - openseadragon (0.3.3) + nio4r (2.3.1) + nokogiri (1.10.3) + mini_portile2 (~> 2.4.0) + openseadragon (0.5.0) rails (> 3.2.0) orm_adapter (0.5.0) perfect-scrollbar-rails (0.6.15) railties (>= 3.2, < 6.0) - puma (3.9.1) - rack (2.0.3) - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.4) - actioncable (= 5.0.4) - actionmailer (= 5.0.4) - actionpack (= 5.0.4) - actionview (= 5.0.4) - activejob (= 5.0.4) - activemodel (= 5.0.4) - activerecord (= 5.0.4) - activesupport (= 5.0.4) - bundler (>= 1.3.0, < 2.0) - railties (= 5.0.4) + puma (3.12.1) + rack (2.0.7) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.1.7) + actioncable (= 5.1.7) + actionmailer (= 5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) + activemodel (= 5.1.7) + activerecord (= 5.1.7) + activesupport (= 5.1.7) + bundler (>= 1.3.0) + railties (= 5.1.7) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - railties (5.0.4) - actionpack (= 5.0.4) - activesupport (= 5.0.4) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) + railties (5.1.7) + actionpack (= 5.1.7) + activesupport (= 5.1.7) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (12.0.0) - rb-fsevent (0.9.8) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) + rake (12.3.2) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) ref (2.0.0) - responders (2.4.0) - actionpack (>= 4.2.0, < 5.3) - railties (>= 4.2.0, < 5.3) - retriable (3.0.2) + responders (2.4.1) + actionpack (>= 4.2.0, < 6.0) + railties (>= 4.2.0, < 6.0) + retriable (3.1.2) rsolr (1.1.2) builder (>= 2.1.2) - ruby-progressbar (1.8.1) + ruby-progressbar (1.10.0) rubycas-client (2.3.9) activesupport - rubyzip (1.2.1) - sass (3.4.24) - sass-rails (5.0.6) + rubyzip (1.2.2) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.0.7) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - solr_wrapper (1.1.0) + sassc (2.0.1) + ffi (~> 1.9) + rake + solr_wrapper (2.1.0) faraday retriable ruby-progressbar @@ -202,48 +211,49 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (3.7.1) + sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.0) + sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.3.13) + sqlite3 (1.4.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref - thor (0.19.4) + thor (0.20.3) thread_safe (0.3.6) - tilt (2.0.7) - turbolinks (5.0.1) - turbolinks-source (~> 5) - turbolinks-source (5.0.3) + tilt (2.0.9) + turbolinks (5.2.0) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) twitter-typeahead-rails (0.11.1.pre.corejavascript) actionpack (>= 3.1) jquery-rails railties (>= 3.1) - tzinfo (1.2.3) + tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (3.2.0) + uglifier (4.1.20) execjs (>= 0.3.0, < 3) - warden (1.2.7) - rack (>= 1.0) - web-console (3.5.1) + warden (1.2.8) + rack (>= 2.0.6) + web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.2) - xray-rails (0.3.1) + websocket-extensions (0.1.3) + xray-rails (0.3.2) rails (>= 3.1.0) PLATFORMS ruby DEPENDENCIES + actionview (>= 5.0.7.2) blacklight (~> 6.0) blacklight-gallery byebug @@ -261,7 +271,7 @@ DEPENDENCIES listen (~> 3.0.5) perfect-scrollbar-rails puma (~> 3.0) - rails (~> 5.0.1) + rails (~> 5.1.4) rsolr (~> 1.0) sass-rails (~> 5.0) solr_wrapper (>= 0.3) diff --git a/config/blacklight.yml b/config/blacklight.yml index c6d6738..34851d6 100644 --- a/config/blacklight.yml +++ b/config/blacklight.yml @@ -19,4 +19,4 @@ test: &test production: adapter: solr url: <%= ENV['SOLR_URL'] || "http://index-test.kb.dk/solr/cop-editions" %> - \ No newline at end of file + From 34a1371f40467ad7010fec3b3c8c2eb8afa592d6 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Wed, 24 Apr 2019 11:28:15 +0200 Subject: [PATCH 02/18] updated nokogiri --- Gemfile | 3 ++- Gemfile.lock | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index cf7b8ad..781525c 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,8 @@ gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.2' # See https://github.com/rails/execjs#readme for more supported runtimes gem 'therubyracer', platforms: :ruby - +# +gem "nokogiri", ">= 1.8.5" # Use jquery as the JavaScript library gem 'jquery-rails' gem 'jquery-ui-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 653526e..5c3671f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -269,6 +269,7 @@ DEPENDENCIES jquery-ui-rails jstree-rails-4 listen (~> 3.0.5) + nokogiri (>= 1.8.5) perfect-scrollbar-rails puma (~> 3.0) rails (~> 5.1.4) From 4271dc6a5c738189746c940423ac38138626e9ca Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Wed, 24 Apr 2019 11:31:29 +0200 Subject: [PATCH 03/18] fixed devise --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 781525c..63e2dc6 100644 --- a/Gemfile +++ b/Gemfile @@ -66,7 +66,7 @@ group :development, :test do end gem 'rsolr', '~> 1.0' -gem 'devise' +gem "devise", ">= 4.6.0" gem 'devise-guests', '~> 0.5' gem 'devise_cas_authenticatable' diff --git a/Gemfile.lock b/Gemfile.lock index 5c3671f..c472f71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -258,7 +258,7 @@ DEPENDENCIES blacklight-gallery byebug coffee-rails (~> 4.2) - devise + devise (>= 4.6.0) devise-guests (~> 0.5) devise_cas_authenticatable font-awesome-rails From 4257fa2f8ab2897deb9941f84c3e5c944cbeb5f9 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Wed, 24 Apr 2019 11:56:37 +0200 Subject: [PATCH 04/18] fixed bootstrap-sass --- Gemfile | 1 + Gemfile.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 63e2dc6..fca716c 100644 --- a/Gemfile +++ b/Gemfile @@ -69,6 +69,7 @@ gem 'rsolr', '~> 1.0' gem "devise", ">= 4.6.0" gem 'devise-guests', '~> 0.5' gem 'devise_cas_authenticatable' +gem "bootstrap-sass", ">= 3.4.1" #Makes it possible to find a file path using fx. page_path gem 'high_voltage', '~> 3.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index c472f71..7ed8b17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -256,6 +256,7 @@ DEPENDENCIES actionview (>= 5.0.7.2) blacklight (~> 6.0) blacklight-gallery + bootstrap-sass (>= 3.4.1) byebug coffee-rails (~> 4.2) devise (>= 4.6.0) From 1bc1b9c6b4d8b52b1cf8ddd1406c808c348b165e Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Wed, 24 Apr 2019 12:13:46 +0200 Subject: [PATCH 05/18] fixed loofah --- Gemfile | 3 +++ Gemfile.lock | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Gemfile b/Gemfile index fca716c..9dc2d4a 100644 --- a/Gemfile +++ b/Gemfile @@ -70,6 +70,9 @@ gem "devise", ">= 4.6.0" gem 'devise-guests', '~> 0.5' gem 'devise_cas_authenticatable' gem "bootstrap-sass", ">= 3.4.1" +gem "rack", ">= 2.0.6" +gem "rails-html-sanitizer", ">= 1.0.4" +gem "loofah", ">= 2.2.3" #Makes it possible to find a file path using fx. page_path gem 'high_voltage', '~> 3.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 7ed8b17..5f8f2aa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -270,10 +270,13 @@ DEPENDENCIES jquery-ui-rails jstree-rails-4 listen (~> 3.0.5) + loofah (>= 2.2.3) nokogiri (>= 1.8.5) perfect-scrollbar-rails puma (~> 3.0) + rack (>= 2.0.6) rails (~> 5.1.4) + rails-html-sanitizer (>= 1.0.4) rsolr (~> 1.0) sass-rails (~> 5.0) solr_wrapper (>= 0.3) From cf4d34e5d1353f8da6463fa895a58b2e6e5d7121 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 30 Apr 2019 09:02:37 +0200 Subject: [PATCH 06/18] should call IIPimage using https --- app/views/catalog/_show_default.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/catalog/_show_default.html.erb b/app/views/catalog/_show_default.html.erb index ddd569d..9460f50 100644 --- a/app/views/catalog/_show_default.html.erb +++ b/app/views/catalog/_show_default.html.erb @@ -44,7 +44,10 @@ - + From 58869a2e5bb9eec455902d5428714c17d4d1c4f3 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 30 Apr 2019 09:41:18 +0200 Subject: [PATCH 08/18] thumbnails using https --- app/helpers/application_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 45ee6f9..53e6120 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -46,6 +46,7 @@ def get_lang params def show_scaled_image(doc, opts) uri = doc['thumbnail_url_ssm'].first + uri = uri.gsub(/(https?:\/\/)(.*)$/,"https://\\2") if uri[/ull\/[^\/]*?/] uri = uri.gsub(/full\/[^\/]*?\//,'full/!225,/') end From 78b3373fa541a218f2b6b486436a8afe4599e7ae Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 30 Apr 2019 12:28:26 +0200 Subject: [PATCH 09/18] no comments --- config/environments/development.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 7af462d..e5d87c7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -12,6 +12,8 @@ # Show full error reports. config.consider_all_requests_local = true + + config.i18n.fallbacks = true #cache settings config.action_controller.perform_caching = true config.cache_store = :file_store, 'cache' From 60322c2eb052a4f32c9be22489d57499f005fc82 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 30 Apr 2019 12:53:14 +0200 Subject: [PATCH 10/18] trying with a list of fallback locales --- config/environments/development.rb | 2 +- config/environments/production.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index e5d87c7..d94c2e3 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -13,7 +13,7 @@ config.consider_all_requests_local = true - config.i18n.fallbacks = true + config.i18n.fallbacks = [:en,:da] #cache settings config.action_controller.perform_caching = true config.cache_store = :file_store, 'cache' diff --git a/config/environments/production.rb b/config/environments/production.rb index 6a25093..d898d5b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -69,7 +69,8 @@ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true + # config.i18n.fallbacks = true + config.i18n.fallbacks = [:en,:da] # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify From 181c7fedd1b3ee3bdc9a51f0c60c29f1c8580d2b Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Wed, 1 May 2019 08:54:41 +0200 Subject: [PATCH 11/18] editing the URIs for the front page as well --- app/controllers/catalog_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index b6b27c0..94addd0 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -229,6 +229,7 @@ def get_edition_image_url(editionId) url = "" if docs.size > 0 url = docs.first['thumbnail_url_ssm'].first + url = url.gsub(/(https?:\/\/)(.*)$/,"https://\\2") end url end From b6f4791f522668a3b86a27a5bfb735b0502ea3e3 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 19 Jul 2022 11:04:07 +0200 Subject: [PATCH 12/18] trying this ruby version --- Gemfile | 1 + Gemfile.lock | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 92f482f..e69413b 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ git_source(:github) do |repo_name| "https://github.com/#{repo_name}.git" end +ruby "~> 2.6.5" # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.1' diff --git a/Gemfile.lock b/Gemfile.lock index ca3e963..d02b005 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -279,5 +279,8 @@ DEPENDENCIES web-console (>= 3.3.0) xray-rails +RUBY VERSION + ruby 2.6.5p114 + BUNDLED WITH - 1.16.0 + 1.17.2 From 8a96b52dc27536a665d0b6fcf892082a477c81ca Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 19 Jul 2022 12:06:30 +0200 Subject: [PATCH 13/18] trying to get ruby version correct --- Gemfile.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5f8f2aa..31feff6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -145,7 +145,8 @@ GEM orm_adapter (0.5.0) perfect-scrollbar-rails (0.6.15) railties (>= 3.2, < 6.0) - puma (3.12.1) + puma (4.3.12) + nio4r (~> 2.0) rack (2.0.7) rack-test (1.1.0) rack (>= 1.0, < 3) @@ -273,7 +274,7 @@ DEPENDENCIES loofah (>= 2.2.3) nokogiri (>= 1.8.5) perfect-scrollbar-rails - puma (~> 3.0) + puma (~> 4.3) rack (>= 2.0.6) rails (~> 5.1.4) rails-html-sanitizer (>= 1.0.4) @@ -291,4 +292,4 @@ DEPENDENCIES xray-rails BUNDLED WITH - 1.16.0 + 1.17.2 From c2f3640f3e9343132eca9f9bc2f4715fbbc6be90 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 19 Jul 2022 12:20:54 +0200 Subject: [PATCH 14/18] bumping nokogiri to a current version --- Gemfile | 4 ++-- Gemfile.lock | 25 +++++++++++-------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 34b8430..6e02f6c 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ gem 'coffee-rails', '~> 4.2' # See https://github.com/rails/execjs#readme for more supported runtimes gem 'therubyracer', platforms: :ruby # -gem "nokogiri", ">= 1.8.5" +gem "nokogiri", ">= 1.13.6" # Use jquery as the JavaScript library gem 'jquery-rails' gem 'jquery-ui-rails' @@ -72,7 +72,7 @@ gem 'devise-guests', '~> 0.5' gem 'devise_cas_authenticatable' gem "bootstrap-sass", ">= 3.4.1" gem "rack", ">= 2.0.6" -gem "rails-html-sanitizer", ">= 1.0.4" +gem "rails-html-sanitizer", ">= 1.4.3" gem "loofah", ">= 2.2.3" #Makes it possible to find a file path using fx. page_path diff --git a/Gemfile.lock b/Gemfile.lock index ba8916b..6dc8f16 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,6 @@ GEM actioncable (5.1.7) actionpack (= 5.1.7) nio4r (~> 2.0) - websocket-driver (~> 0.6.1) actionmailer (5.1.7) actionpack (= 5.1.7) actionview (= 5.1.7) @@ -71,7 +70,7 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.1.5) - crass (1.0.4) + crass (1.0.6) deprecation (1.0.0) activesupport devise (4.6.2) @@ -126,20 +125,21 @@ GEM listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - loofah (2.2.3) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) method_source (0.9.2) mini_mime (1.0.1) - mini_portile2 (2.4.0) + mini_portile2 (2.8.0) minitest (5.11.3) multi_json (1.13.1) multipart-post (2.0.0) nio4r (2.3.1) - nokogiri (1.10.3) - mini_portile2 (~> 2.4.0) + nokogiri (1.13.7) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) openseadragon (0.5.0) rails (> 3.2.0) orm_adapter (0.5.0) @@ -147,6 +147,7 @@ GEM railties (>= 3.2, < 6.0) puma (4.3.12) nio4r (~> 2.0) + racc (1.6.0) rack (2.0.7) rack-test (1.1.0) rack (>= 1.0, < 3) @@ -165,8 +166,8 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) railties (5.1.7) actionpack (= 5.1.7) activesupport (= 5.1.7) @@ -244,11 +245,7 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - websocket-driver (0.6.5) - websocket-extensions (>= 0.1.0) xray-rails (0.3.2) - websocket-extensions (0.1.5) - rails (>= 3.1.0) PLATFORMS ruby @@ -272,12 +269,12 @@ DEPENDENCIES jstree-rails-4 listen (~> 3.0.5) loofah (>= 2.2.3) - nokogiri (>= 1.8.5) + nokogiri (>= 1.13.6) perfect-scrollbar-rails puma (~> 4.3) rack (>= 2.0.6) rails (~> 5.1.4) - rails-html-sanitizer (>= 1.0.4) + rails-html-sanitizer (>= 1.4.3) rsolr (~> 1.0) sass-rails (~> 5.0) solr_wrapper (>= 0.3) From 4f2720625970b109f4499f790c0f8ea705f5d979 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 19 Jul 2022 12:24:05 +0200 Subject: [PATCH 15/18] bumping puma --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 6e02f6c..30dd965 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem "actionview", ">= 5.0.7.2" # Use sqlite3 as the database for Active Record gem 'sqlite3' # Use Puma as the app server -gem 'puma', '~> 4.3' +gem 'puma', '~> 4.3.12' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets diff --git a/Gemfile.lock b/Gemfile.lock index 6dc8f16..370dd11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -136,7 +136,7 @@ GEM minitest (5.11.3) multi_json (1.13.1) multipart-post (2.0.0) - nio4r (2.3.1) + nio4r (2.5.8) nokogiri (1.13.7) mini_portile2 (~> 2.8.0) racc (~> 1.4) @@ -271,7 +271,7 @@ DEPENDENCIES loofah (>= 2.2.3) nokogiri (>= 1.13.6) perfect-scrollbar-rails - puma (~> 4.3) + puma (~> 4.3.12) rack (>= 2.0.6) rails (~> 5.1.4) rails-html-sanitizer (>= 1.4.3) From 9470b9efb9db63cfcc38d00be0110ba6ae5893b7 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 19 Jul 2022 12:28:11 +0200 Subject: [PATCH 16/18] updating rack --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 30dd965..260347a 100644 --- a/Gemfile +++ b/Gemfile @@ -71,7 +71,7 @@ gem "devise", ">= 4.6.0" gem 'devise-guests', '~> 0.5' gem 'devise_cas_authenticatable' gem "bootstrap-sass", ">= 3.4.1" -gem "rack", ">= 2.0.6" +gem "rack", ">= 2.2.3" gem "rails-html-sanitizer", ">= 1.4.3" gem "loofah", ">= 2.2.3" diff --git a/Gemfile.lock b/Gemfile.lock index 370dd11..afa9635 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -148,7 +148,7 @@ GEM puma (4.3.12) nio4r (~> 2.0) racc (1.6.0) - rack (2.0.7) + rack (2.2.4) rack-test (1.1.0) rack (>= 1.0, < 3) rails (5.1.7) @@ -272,7 +272,7 @@ DEPENDENCIES nokogiri (>= 1.13.6) perfect-scrollbar-rails puma (~> 4.3.12) - rack (>= 2.0.6) + rack (>= 2.2.3) rails (~> 5.1.4) rails-html-sanitizer (>= 1.4.3) rsolr (~> 1.0) From 0cb18e56d3316455e97a18a278e20f43be759704 Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Tue, 19 Jul 2022 15:33:59 +0200 Subject: [PATCH 17/18] added version to Migrations --- db/migrate/20170301125837_create_searches.blacklight.rb | 2 +- db/migrate/20170301125838_create_bookmarks.blacklight.rb | 2 +- ...0301125839_add_polymorphic_type_to_bookmarks.blacklight.rb | 2 +- db/migrate/20170301125841_add_devise_guests_to_users.rb | 4 ++-- db/migrate/20170314101550_cas_users.rb | 2 +- db/migrate/20170314101640_cas_username.rb | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/db/migrate/20170301125837_create_searches.blacklight.rb b/db/migrate/20170301125837_create_searches.blacklight.rb index 97bc5e2..caeb80c 100644 --- a/db/migrate/20170301125837_create_searches.blacklight.rb +++ b/db/migrate/20170301125837_create_searches.blacklight.rb @@ -1,6 +1,6 @@ # This migration comes from blacklight (originally 20140202020201) # frozen_string_literal: true -class CreateSearches < ActiveRecord::Migration +class CreateSearches < ActiveRecord::Migration[5.0] def self.up create_table :searches do |t| t.binary :query_params diff --git a/db/migrate/20170301125838_create_bookmarks.blacklight.rb b/db/migrate/20170301125838_create_bookmarks.blacklight.rb index 3050c72..1a021cd 100644 --- a/db/migrate/20170301125838_create_bookmarks.blacklight.rb +++ b/db/migrate/20170301125838_create_bookmarks.blacklight.rb @@ -1,6 +1,6 @@ # This migration comes from blacklight (originally 20140202020202) # frozen_string_literal: true -class CreateBookmarks < ActiveRecord::Migration +class CreateBookmarks < ActiveRecord::Migration[5.0] def self.up create_table :bookmarks do |t| t.integer :user_id, index: true, null: false diff --git a/db/migrate/20170301125839_add_polymorphic_type_to_bookmarks.blacklight.rb b/db/migrate/20170301125839_add_polymorphic_type_to_bookmarks.blacklight.rb index be9f730..0666f2f 100644 --- a/db/migrate/20170301125839_add_polymorphic_type_to_bookmarks.blacklight.rb +++ b/db/migrate/20170301125839_add_polymorphic_type_to_bookmarks.blacklight.rb @@ -1,6 +1,6 @@ # This migration comes from blacklight (originally 20140320000000) # frozen_string_literal: true -class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration +class AddPolymorphicTypeToBookmarks < ActiveRecord::Migration[5.0] def change add_column(:bookmarks, :document_type, :string) unless Bookmark.connection.column_exists? :bookmarks, :document_type diff --git a/db/migrate/20170301125841_add_devise_guests_to_users.rb b/db/migrate/20170301125841_add_devise_guests_to_users.rb index 445a7d1..2380aaa 100644 --- a/db/migrate/20170301125841_add_devise_guests_to_users.rb +++ b/db/migrate/20170301125841_add_devise_guests_to_users.rb @@ -1,4 +1,4 @@ -class AddDeviseGuestsToUsers < ActiveRecord::Migration +class AddDeviseGuestsToUsers < ActiveRecord::Migration[5.0] def self.up change_table(:users) do |t| ## Database authenticatable @@ -12,4 +12,4 @@ def self.down # model already existed. Please edit below which fields you would like to remove in this migration. raise ActiveRecord::IrreversibleMigration end -end \ No newline at end of file +end diff --git a/db/migrate/20170314101550_cas_users.rb b/db/migrate/20170314101550_cas_users.rb index 6073f3c..8c8d5d0 100644 --- a/db/migrate/20170314101550_cas_users.rb +++ b/db/migrate/20170314101550_cas_users.rb @@ -1,4 +1,4 @@ -class CasUsers < ActiveRecord::Migration +class CasUsers < ActiveRecord::Migration[5.0] def self.up add_column :users, :username, :string add_index :users, :username, :unique => true diff --git a/db/migrate/20170314101640_cas_username.rb b/db/migrate/20170314101640_cas_username.rb index 5245b49..0cca662 100644 --- a/db/migrate/20170314101640_cas_username.rb +++ b/db/migrate/20170314101640_cas_username.rb @@ -1,4 +1,4 @@ -class CasUsername < ActiveRecord::Migration +class CasUsername < ActiveRecord::Migration[5.0] def change change_table :users do |t| t.string :fullname From 726245bbb57432b40e251eadb5b7f6ff29b4ca8c Mon Sep 17 00:00:00 2001 From: Sigfrid Lundberg Date: Mon, 28 Nov 2022 13:21:03 +0100 Subject: [PATCH 18/18] the little change in frontend for category tree --- app/models/finder.rb | 6 +++--- app/views/tree/_tree.html.erb | 37 +++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/models/finder.rb b/app/models/finder.rb index 90d1a4d..0d64de2 100644 --- a/app/models/finder.rb +++ b/app/models/finder.rb @@ -8,7 +8,7 @@ def self.get_solr # Function to return the solr document by id def self.get_doc_by_id(id) Rails.cache.fetch("document/#{id}", expires_in: 3.hours) do - query = "id:#{id}" + query = "id:\"#{id}\"" response = get_solr.get 'select', :params => {:q => query} # Return the first document response['response']['docs'].first @@ -18,8 +18,8 @@ def self.get_doc_by_id(id) # Function to return the solr documents that are subcategories, searching by id def self.get_subcats_by_id id Rails.cache.fetch("subcats/#{id}", expires_in: 3.hours) do - query = "parent_ssi:#{id}" # Set the query - response = get_solr.get 'select', :params => {:q => query, :rows => 1000} # Return all the subcategories (by default the rows: 10) + query = "parent_ssi:\"#{id}\"" # Set the query + response = get_solr.get 'select', :params => {:q => query , :rows => 1000} # Return all the subcategories (by default the rows: 10) response['response']['docs'].delete_if { |x| x["id"]=="/images/luftfo/2011/maj/luftfoto/subject203" } # Return all the documents except luftfoto end end diff --git a/app/views/tree/_tree.html.erb b/app/views/tree/_tree.html.erb index 3ebe3b0..ce29e89 100644 --- a/app/views/tree/_tree.html.erb +++ b/app/views/tree/_tree.html.erb @@ -6,28 +6,31 @@
+
+ <% if subject_id == "/editions/any/2009/jul/editions" %> - -
    - <% get_children("/editions/any/2009/jul/editions").each do |child| %> -
  • - <%= link_to show_category_name(child['id']), "#{child['id']}/#{lang}/"+filter_params_url %> -
  • - <% end %> - -
- + + +
    + <% get_children("/editions/any/2009/jul/editions").each do |child| %> +
  • + <%= link_to show_category_name(child['id']), "#{child['id']}/#{lang}/"+filter_params_url %> +
  • + <% end %> +
+ <% elsif !get_breadcrumb_path(subject_id).nil? %> - - <% array_of_ancestors = get_breadcrumb_path(subject_id) %> - <% i=0 %> - -
    - <%= render :partial => 'tree/siblings', locals: {:array_of_ancestors => array_of_ancestors, :i => i, :lang => lang, :filter_params_url => filter_params_url} %> -
+ + + <% array_of_ancestors = get_breadcrumb_path(subject_id) %> + <% i=0 %> + +
    + <%= render :partial => 'tree/siblings', locals: {:array_of_ancestors => array_of_ancestors, :i => i, :lang => lang, :filter_params_url => filter_params_url} %> +
<% end %>