diff --git a/.ruby-version b/.ruby-version index 14dbd3772..9e79f6c4a 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-3.0.6 +ruby-3.2.2 diff --git a/Dockerfile b/Dockerfile index ab5048cd5..783dc509d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG RUBY_VERSION=3.0.6 +ARG RUBY_VERSION=3.2.2 #use ruby base image FROM ruby:$RUBY_VERSION-slim AS base diff --git a/Gemfile b/Gemfile index c023ef1cb..4dd2700b1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,168 +1,70 @@ # frozen_string_literal: true source 'https://rubygems.org' -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 6.0' - -gem 'bootsnap', '>= 1.4.4', require: false - -# Use postgresql as the database for Active Record -gem 'pg' - -# For installing PG on macs: -gem 'lunchy' - -# Use SCSS for stylesheets -gem 'sass-rails', '~> 5.0' -gem 'sassc-rails', '~> 2.1.2' - -# Use Terser as compressor for JavaScript assets -gem 'terser' - -# See https://github.com/rails/execjs#readme for more supported runtimes -# gem 'therubyracer'#, platforms: :ruby - -# CRUD of resources via a UI -gem 'rails_admin', '~> 2.2.1' -gem 'haml' - -# Authentication -gem 'devise' -gem 'omniauth_openid_connect' -gem "omniauth-rails_csrf_protection" -gem 'devise_invitable', '~> 2.0.5' - -# Activity logging -gem 'public_activity', '~> 2.0.2' - -gem 'simple_token_authentication', '~> 1.0' - -gem 'bootstrap-sass', '>= 3.4.1' - -gem 'font-awesome-sass', '~> 4.7.0' - -gem 'friendly_id', '~> 5.2.4' - -# gem 'sunspot_rails', '~> 2.5.0' -gem 'sunspot_rails', github: 'sunspot/sunspot', branch: 'master' - -gem 'progress_bar', '~> 1.1.0' +gem 'rails', '7.0.7.2' +gem 'active_model_serializers' gem 'activerecord-session_store' - -gem 'gravtastic', '~> 3.2.6' - +gem 'ahoy_matey' +gem 'auto_strip_attributes' +gem 'bootsnap', require: false +gem 'bootstrap-datepicker-rails' +gem 'bootstrap-sass' +gem 'bootstrap-tab-history-rails' +gem 'country_select' +gem 'devise' +gem 'devise_invitable' gem 'sitemap_generator' - -gem 'whenever', '~> 1.0.0' - -# These are required for Sidekiq, to look up scientific topics +gem 'eventbrite_sdk' +gem 'font-awesome-sass', '~> 4.7.0' # Prefer V4 icon styles +gem 'friendly_id' +gem 'geocoder' +gem 'gravtastic' +gem 'handlebars_assets' gem 'httparty' -gem 'sidekiq', '< 8' -gem 'sidekiq-status', '~> 3.0.2' -gem 'slim' - -# Use jquery as the JavaScript library -gem 'jquery-rails' -gem 'jquery-qtip2-wrapper-rails' - -# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem 'turbolinks' -gem 'jquery-turbolinks' - -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'i18n_data' +gem 'icalendar' +gem 'iso_country_codes' gem 'jbuilder' -# bundle exec rake doc:rails generates the API under doc/api. - -group :doc do - gem 'sdoc', '>= 1.1.0' - gem 'json', '>= 2.3.0' - gem 'rdoc', '>= 6.3.1' -end - -# Gem for creating before_validation callbacks for stripping whitespace -gem 'auto_strip_attributes', '~> 2.0' - -# Gem for validating URLs -gem 'validate_url', '~> 1.0.2' - -# Gem for simple form: https://github.com/heartcombo/simple_form -gem 'simple_form' -gem 'country_select', '<= 4.0.0' - -# Gem for rendering Markdown -gem 'redcarpet', '~> 3.5.1' - -# Gem for paginating search results -gem 'will_paginate' -# gem 'will_paginate-bootstrap', '~> 1.0.1' - -# Gem for authorisation -gem 'pundit', '~> 1.1.0' - -# Simple colour picker from a predefined list +gem 'jquery-qtip2-wrapper-rails' +gem 'jquery-rails' gem 'jquery-simplecolorpicker-rails' - -# For getting date of materials for the home page -gem 'by_star', git: 'https://github.com/radar/by_star' - -gem 'handlebars_assets' - -gem 'kt-paperclip', '~> 7.0.0' - -gem 'icalendar', '~> 2.4.1' - -gem 'rss' - -gem 'bootstrap-datepicker-rails', '~> 1.6.4.1' -gem 'bootstrap-tab-history-rails' - -gem 'rack-cors', require: 'rack/cors' - -gem 'recaptcha', require: 'recaptcha/rails' - +gem 'jquery-turbolinks' +gem 'kt-paperclip' gem 'linkeddata' - -gem 'tess_rdf_extractors', git: 'https://github.com/ElixirTeSS/TeSS_RDF_Extractors' -gem 'sitemap-parser', '~> 0.5.6' - -# Used for lat/lon rake task -gem 'geocoder' -gem 'redis', '< 5.0.0' - -# set serializers version -gem 'active_model_serializers', '~> 0.10.13' - +gem 'money-rails' +gem 'omniauth-rails_csrf_protection' +gem 'omniauth_openid_connect' +gem 'pg' gem 'private_address_check' - -# For the link monitor rake taks -gem 'time_diff' - -# For internationalisation (i18n) +gem 'public_activity' +gem 'pundit' +gem 'rack-cors', require: 'rack/cors' gem 'rails-i18n' -gem 'i18n_data' - -# for timezone information -gem 'tzinfo' -gem 'tzinfo-data' - -# for currency information -gem 'money-rails' - -# for iso country codes -gem 'iso_country_codes' - -# for rest client +gem 'rails_admin' +gem 'recaptcha', require: 'recaptcha/rails' +gem 'redcarpet' +gem 'redis' gem 'rest-client' - -# for converting html to markdown gem 'reverse_markdown' - -# eventbrite api -gem 'eventbrite_sdk' - -gem 'ahoy_matey' - +gem 'rss' +gem 'sass-rails' +gem 'sassc-rails' +gem 'sidekiq' +gem 'sidekiq-status' +gem 'simple_form' +gem 'simple_token_authentication' +gem 'sitemap-parser' +gem 'slim' +gem 'sunspot_rails', github: 'sunspot/sunspot', branch: 'master' # Contains Ruby 3 fixes that are not released +gem 'terser' +gem 'tess_rdf_extractors', git: 'https://github.com/ElixirTeSS/TeSS_RDF_Extractors' +gem 'turbolinks' +gem 'tzinfo' +gem 'tzinfo-data' +gem 'validate_url' +gem 'whenever' +gem 'will_paginate' source 'https://rails-assets.org' do gem 'rails-assets-clipboard', '~> 1.5.12' @@ -174,7 +76,6 @@ source 'https://rails-assets.org' do end group :development, :test do - # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' gem 'pry-byebug' gem 'rubocop' @@ -183,22 +84,18 @@ group :development, :test do end group :development do - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - # gem 'spring' - gem 'listen' - # Access an IRB console on exception pages or by using <%= console %> in views - gem 'web-console' - gem 'puma' gem 'better_errors' gem 'binding_of_caller' + gem 'listen' + gem 'puma' + gem 'web-console' end group :test do - gem 'minitest', '5.14.4' + gem 'committee' + gem 'minitest' gem 'minitest-reporters' gem 'rails-controller-testing' - gem 'vcr', '~> 6.1.0' - gem 'webmock', '~> 3.18.1' - gem 'committee', '~> 4.4' + gem 'vcr' + gem 'webmock' end - diff --git a/Gemfile.lock b/Gemfile.lock index 21ce56c2c..6d19d0bca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,24 +5,17 @@ GIT tess_rdf_extractors (0.1.0) linkeddata (~> 3.2.0) -GIT - remote: https://github.com/radar/by_star - revision: d7811c0c50f30262b4862b384c50f22f36e54f07 - specs: - by_star (4.0.0) - activesupport (>= 3.2.0) - GIT remote: https://github.com/sunspot/sunspot.git - revision: f2f01a6278030d086e0efb141dceefdcca8932bd + revision: 678c5b2b57d3b06b9432307f00283ecc6c85ad4d branch: master specs: - sunspot (2.5.0) + sunspot (2.6.0) pr_geohash (~> 1.0) rsolr (>= 1.1.1, < 3) - sunspot_rails (2.5.0) - rails (>= 3) - sunspot (= 2.5.0) + sunspot_rails (2.6.0) + rails (>= 5) + sunspot (= 2.6.0) GEM remote: https://rails-assets.org/ @@ -30,10 +23,10 @@ GEM rails-assets-clipboard (1.5.16) rails-assets-devbridge-autocomplete (1.4.9) rails-assets-jquery (>= 1.7) - rails-assets-eonasdan-bootstrap-datetimepicker (4.17.47) + rails-assets-eonasdan-bootstrap-datetimepicker (4.17.49) rails-assets-jquery (>= 1.8.3) rails-assets-moment (>= 2.10.5) - rails-assets-jquery (3.6.0) + rails-assets-jquery (3.7.0) rails-assets-markdown-it (7.0.1) rails-assets-moment (2.15.2) rails-assets-select2 (4.0.8) @@ -41,40 +34,47 @@ GEM GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.3) - actionpack (= 6.1.7.3) - activesupport (= 6.1.7.3) + actioncable (7.0.7.2) + actionpack (= 7.0.7.2) + activesupport (= 7.0.7.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.3) - actionpack (= 6.1.7.3) - activejob (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) + actionmailbox (7.0.7.2) + actionpack (= 7.0.7.2) + activejob (= 7.0.7.2) + activerecord (= 7.0.7.2) + activestorage (= 7.0.7.2) + activesupport (= 7.0.7.2) mail (>= 2.7.1) - actionmailer (6.1.7.3) - actionpack (= 6.1.7.3) - actionview (= 6.1.7.3) - activejob (= 6.1.7.3) - activesupport (= 6.1.7.3) + net-imap + net-pop + net-smtp + actionmailer (7.0.7.2) + actionpack (= 7.0.7.2) + actionview (= 7.0.7.2) + activejob (= 7.0.7.2) + activesupport (= 7.0.7.2) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.3) - actionview (= 6.1.7.3) - activesupport (= 6.1.7.3) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.7.2) + actionview (= 7.0.7.2) + activesupport (= 7.0.7.2) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.3) - actionpack (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) + actiontext (7.0.7.2) + actionpack (= 7.0.7.2) + activerecord (= 7.0.7.2) + activestorage (= 7.0.7.2) + activesupport (= 7.0.7.2) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.3) - activesupport (= 6.1.7.3) + actionview (7.0.7.2) + activesupport (= 7.0.7.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -84,66 +84,65 @@ GEM activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (6.1.7.3) - activesupport (= 6.1.7.3) + activejob (7.0.7.2) + activesupport (= 7.0.7.2) globalid (>= 0.3.6) - activemodel (6.1.7.3) - activesupport (= 6.1.7.3) + activemodel (7.0.7.2) + activesupport (= 7.0.7.2) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (6.1.7.3) - activemodel (= 6.1.7.3) - activesupport (= 6.1.7.3) + activerecord (7.0.7.2) + activemodel (= 7.0.7.2) + activesupport (= 7.0.7.2) activerecord-session_store (2.0.0) actionpack (>= 5.2.4.1) activerecord (>= 5.2.4.1) multi_json (~> 1.11, >= 1.11.2) rack (>= 2.0.8, < 3) railties (>= 5.2.4.1) - activestorage (6.1.7.3) - actionpack (= 6.1.7.3) - activejob (= 6.1.7.3) - activerecord (= 6.1.7.3) - activesupport (= 6.1.7.3) + activestorage (7.0.7.2) + actionpack (= 7.0.7.2) + activejob (= 7.0.7.2) + activerecord (= 7.0.7.2) + activesupport (= 7.0.7.2) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.3) + activesupport (7.0.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.1) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) aes_key_wrap (1.1.0) ahoy_matey (4.2.1) activesupport (>= 5.2) device_detector safely_block (>= 0.2.1) - amazing_print (1.4.0) ansi (1.5.0) ast (2.4.2) attr_required (1.0.1) auto_strip_attributes (2.6.0) activerecord (>= 4.0) - autoprefixer-rails (10.3.3.0) + autoprefixer-rails (10.4.13.0) execjs (~> 2) + base64 (0.1.1) bcp47 (0.3.3) i18n - bcrypt (3.1.16) - better_errors (2.9.1) - coderay (>= 1.0.0) + bcrypt (3.1.19) + better_errors (2.10.1) erubi (>= 1.0.0) rack (>= 0.9.0) - bindata (2.4.10) + rouge (>= 1.0.0) + bindata (2.4.15) bindex (0.8.1) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bootsnap (1.11.1) + bootsnap (1.16.0) msgpack (~> 1.2) - bootstrap-datepicker-rails (1.6.4.1) + bootstrap-datepicker-rails (1.10.0.1) railties (>= 3.0) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) @@ -159,75 +158,58 @@ GEM numerizer (~> 0.1.1) climate_control (0.2.0) coderay (1.1.3) - committee (4.4.0) + committee (5.0.0) json_schema (~> 0.14, >= 0.14.3) - openapi_parser (>= 0.11.1, < 1.0) + openapi_parser (~> 1.0) rack (>= 1.5) concurrent-ruby (1.2.2) - connection_pool (2.4.0) - countries (3.1.0) - i18n_data (~> 0.11.0) - sixarm_ruby_unaccent (~> 1.1) - unicode_utils (~> 1.4) - country_select (4.0.0) - countries (~> 3.0) - sort_alphabetical (~> 1.0) + connection_pool (2.4.1) + countries (5.6.0) + unaccent (~> 0.3) + country_select (8.0.2) + countries (~> 5.0) crack (0.4.5) rexml crass (1.0.6) date (3.3.3) debug_inspector (1.1.0) - device_detector (1.1.0) - devise (4.8.0) + device_detector (1.1.1) + devise (4.9.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise_invitable (2.0.6) + devise_invitable (2.0.8) actionmailer (>= 5.0) devise (>= 4.6) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - ebnf (2.3.1) - amazing_print (~> 1.4) + ebnf (2.3.5) htmlentities (~> 4.3) rdf (~> 3.2) scanf (~> 1.0) sxp (~> 1.2) - unicode-types (~> 1.7) + unicode-types (~> 1.8) erubi (1.12.0) ethon (0.16.0) ffi (>= 1.15.0) eventbrite_sdk (3.6.0) rest-client (~> 2.0) execjs (2.8.1) - faraday (1.8.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) + faraday (2.7.10) + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - ffi (1.15.4) + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-net_http (3.0.2) + ffi (1.15.5) font-awesome-sass (4.7.0) sass (>= 3.2) - friendly_id (5.2.5) + friendly_id (5.5.0) activerecord (>= 4.0.0) - geocoder (1.7.0) + geocoder (1.8.2) globalid (1.1.0) activesupport (>= 5.0) gravtastic (3.2.6) @@ -242,24 +224,26 @@ GEM tilt (>= 1.2) hashdiff (1.0.1) hashie (5.0.0) - highline (1.7.10) htmlentities (4.3.4) http-accept (1.7.0) - http-cookie (1.0.4) + http-cookie (1.0.5) domain_name (~> 0.5) httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - httpclient (2.8.3) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - i18n_data (0.11.0) - icalendar (2.4.1) + i18n_data (0.17.1) + simple_po_parser (~> 1.1) + icalendar (2.9.0) + ice_cube (~> 0.16) + ice_cube (0.16.4) iso_country_codes (0.7.8) - jbuilder (2.11.3) + jbuilder (2.11.5) + actionview (>= 5.0.0) activesupport (>= 5.0.0) jquery-qtip2-wrapper-rails (3.0.3) - jquery-rails (4.4.0) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -268,87 +252,87 @@ GEM jquery-turbolinks (2.1.0) railties (>= 3.1.0) turbolinks - jquery-ui-rails (6.0.1) - railties (>= 3.2.16) - json (2.6.1) - json-canonicalization (0.3.0) - json-jwt (1.13.0) + json (2.6.3) + json-canonicalization (0.3.2) + json-jwt (1.16.3) activesupport (>= 4.2) aes_key_wrap bindata - json-ld (3.2.3) + faraday (~> 2.0) + faraday-follow_redirects + json-ld (3.2.5) htmlentities (~> 4.3) - json-canonicalization (~> 0.3) + json-canonicalization (~> 0.3, >= 0.3.2) link_header (~> 0.0, >= 0.0.8) multi_json (~> 1.15) - rack (~> 2.2) - rdf (~> 3.2, >= 3.2.9) + rack (>= 2.2, < 4) + rdf (~> 3.2, >= 3.2.10) json-ld-preloaded (3.2.2) json-ld (~> 3.2) rdf (~> 3.2) json_schema (0.21.0) jsonapi-renderer (0.2.2) - kaminari (1.2.1) + kaminari (1.2.2) activesupport (>= 4.1.0) - kaminari-actionview (= 1.2.1) - kaminari-activerecord (= 1.2.1) - kaminari-core (= 1.2.1) - kaminari-actionview (1.2.1) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) actionview - kaminari-core (= 1.2.1) - kaminari-activerecord (1.2.1) + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) activerecord - kaminari-core (= 1.2.1) - kaminari-core (1.2.1) - kt-paperclip (7.0.1) + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + kt-paperclip (7.2.0) activemodel (>= 4.2.0) activesupport (>= 4.2.0) marcel (~> 1.0.1) mime-types terrapin (~> 0.6.0) - ld-patch (3.2.0) - ebnf (~> 2.2) + language_server-protocol (3.17.0.3) + ld-patch (3.2.2) + ebnf (~> 2.3) rdf (~> 3.2) rdf-xsd (~> 3.2) sparql (~> 3.2) sxp (~> 1.2) link_header (0.0.8) - linkeddata (3.2.1) - json-ld (~> 3.2, >= 3.2.3) - json-ld-preloaded (~> 3.2) - ld-patch (~> 3.2) + linkeddata (3.2.2) + json-ld (~> 3.2, >= 3.2.5) + json-ld-preloaded (~> 3.2, >= 3.2.2) + ld-patch (~> 3.2, >= 3.2.2) nokogiri (~> 1.13, >= 1.13.8) - rdf (~> 3.2, >= 3.2.9) + rdf (~> 3.2, >= 3.2.1) rdf-aggregate-repo (~> 3.2, >= 3.2.1) - rdf-hamster-repo (~> 3.2) + rdf-hamster-repo (~> 3.2, >= 3.2.1) rdf-isomorphic (~> 3.2, >= 3.2.1) rdf-json (~> 3.2) rdf-microdata (~> 3.2, >= 3.2.1) rdf-n3 (~> 3.2, >= 3.2.1) - rdf-normalize (~> 0.5) + rdf-normalize (~> 0.6, >= 0.6.1) rdf-ordered-repo (~> 3.2, >= 3.2.1) - rdf-rdfa (~> 3.2) - rdf-rdfxml (~> 3.2) + rdf-rdfa (~> 3.2, >= 3.2.3) + rdf-rdfxml (~> 3.2, >= 3.2.2) rdf-reasoner (~> 0.8) rdf-tabular (~> 3.2, >= 3.2.1) rdf-trig (~> 3.2) rdf-trix (~> 3.2) rdf-turtle (~> 3.2, >= 3.2.1) - rdf-vocab (~> 3.2, >= 3.2.1) + rdf-vocab (~> 3.2, >= 3.2.7) rdf-xsd (~> 3.2, >= 3.2.1) - shacl (~> 0.2, >= 0.2.1) + shacl (~> 0.3) shex (~> 0.7, >= 0.7.1) - sparql (~> 3.2, >= 3.2.4) - sparql-client (~> 3.2, >= 3.2.1) + sparql (~> 3.2, >= 3.2.6) + sparql-client (~> 3.2, >= 3.2.2) yaml-ld (~> 0.0) - listen (3.7.0) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.5.1) - loofah (2.19.1) + logger (1.5.3) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - lunchy (0.10.4) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap @@ -357,12 +341,12 @@ GEM marcel (1.0.2) matrix (0.4.2) method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - mini_mime (1.1.2) - mini_portile2 (2.8.1) - minitest (5.14.4) + mime-types-data (3.2023.0808) + mini_mime (1.1.5) + mini_portile2 (2.8.4) + minitest (5.19.0) minitest-reporters (1.6.1) ansi builder @@ -377,14 +361,13 @@ GEM monetize (~> 1.9) money (~> 6.13) railties (>= 3.0) - msgpack (1.5.1) + msgpack (1.7.2) multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.1.1) nested_form (0.3.2) - net-http-persistent (4.0.1) + net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.3.4) + net-imap (0.3.7) date net-protocol net-pop (0.1.2) @@ -394,130 +377,123 @@ GEM net-smtp (0.3.3) net-protocol netrc (0.11.0) - nio4r (2.5.8) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) + nio4r (2.5.9) + nokogiri (1.15.4) + mini_portile2 (~> 2.8.2) racc (~> 1.4) numerizer (0.1.1) - omniauth (2.0.4) + omniauth (2.1.1) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) + rack (>= 2.2.3) rack-protection omniauth-rails_csrf_protection (1.0.1) actionpack (>= 4.2) omniauth (~> 2.0) - omniauth_openid_connect (0.4.0) - addressable (~> 2.5) + omniauth_openid_connect (0.7.1) omniauth (>= 1.9, < 3) - openid_connect (~> 1.1) - openapi_parser (0.15.0) - openid_connect (1.3.0) + openid_connect (~> 2.2) + openapi_parser (1.0.0) + openid_connect (2.2.0) activemodel attr_required (>= 1.0.0) - json-jwt (>= 1.5.0) - rack-oauth2 (>= 1.6.1) - swd (>= 1.0.0) + faraday (~> 2.0) + faraday-follow_redirects + json-jwt (>= 1.16) + net-smtp + rack-oauth2 (~> 2.2) + swd (~> 2.0) tzinfo validate_email validate_url - webfinger (>= 1.0.1) - options (2.3.2) + webfinger (~> 2.0) orm_adapter (0.5.0) - parallel (1.21.0) - parser (3.0.3.1) + parallel (1.23.0) + parser (3.2.2.3) ast (~> 2.4.1) - pg (1.2.3) + racc + pg (1.5.3) pr_geohash (1.0.0) private_address_check (0.5.0) - progress_bar (1.1.0) - highline (~> 1.6) - options (~> 2.3.0) - pry (0.14.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) - psych (4.0.6) + psych (5.1.0) stringio public_activity (2.0.2) actionpack (>= 5.0.0) activerecord (>= 5.0) i18n (>= 0.5.0) railties (>= 5.0.0) - public_suffix (5.0.0) - puma (5.6.4) + public_suffix (5.0.3) + puma (6.3.1) nio4r (~> 2.0) - pundit (1.1.0) + pundit (2.3.1) activesupport (>= 3.0.0) - racc (1.6.2) - rack (2.2.7) - rack-cors (1.1.1) + racc (1.7.1) + rack (2.2.8) + rack-cors (2.0.1) rack (>= 2.0.0) - rack-oauth2 (1.19.0) + rack-oauth2 (2.2.0) activesupport attr_required - httpclient + faraday (~> 2.0) + faraday-follow_redirects json-jwt (>= 1.11.0) rack (>= 2.1.0) - rack-pjax (1.1.0) - nokogiri (~> 1.5) - rack (>= 1.1) - rack-protection (2.2.0) - rack + rack-protection (3.1.0) + rack (~> 2.2, >= 2.2.4) rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.3) - actioncable (= 6.1.7.3) - actionmailbox (= 6.1.7.3) - actionmailer (= 6.1.7.3) - actionpack (= 6.1.7.3) - actiontext (= 6.1.7.3) - actionview (= 6.1.7.3) - activejob (= 6.1.7.3) - activemodel (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) + rails (7.0.7.2) + actioncable (= 7.0.7.2) + actionmailbox (= 7.0.7.2) + actionmailer (= 7.0.7.2) + actionpack (= 7.0.7.2) + actiontext (= 7.0.7.2) + actionview (= 7.0.7.2) + activejob (= 7.0.7.2) + activemodel (= 7.0.7.2) + activerecord (= 7.0.7.2) + activestorage (= 7.0.7.2) + activesupport (= 7.0.7.2) bundler (>= 1.15.0) - railties (= 6.1.7.3) - sprockets-rails (>= 2.0.0) + railties (= 7.0.7.2) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - rails-i18n (7.0.3) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + rails-i18n (7.0.8) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - rails_admin (2.2.1) + rails_admin (3.1.2) activemodel-serializers-xml (>= 1.0) - builder (~> 3.1) - haml (>= 4.0, < 6) - jquery-rails (>= 3.0, < 5) - jquery-ui-rails (>= 5.0, < 7) kaminari (>= 0.14, < 2.0) nested_form (~> 0.3) - rack-pjax (>= 0.7) - rails (>= 5.0, < 7) - remotipart (~> 1.3) - sassc-rails (>= 1.3, < 3) - railties (6.1.7.3) - actionpack (= 6.1.7.3) - activesupport (= 6.1.7.3) + rails (>= 6.0, < 8) + turbo-rails (~> 1.0) + railties (7.0.7.2) + actionpack (= 7.0.7.2) + activesupport (= 7.0.7.2) method_source rake (>= 12.2) thor (~> 1.0) - rainbow (3.0.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.0) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rdf (3.2.9) + rdf (3.2.11) link_header (~> 0.0, >= 0.0.8) rdf-aggregate-repo (3.2.1) rdf (~> 3.2) @@ -539,21 +515,21 @@ GEM rdf (~> 3.2) sparql (~> 3.2) sxp (~> 1.2) - rdf-normalize (0.5.0) + rdf-normalize (0.6.1) rdf (~> 3.2) rdf-ordered-repo (3.2.1) rdf (~> 3.2, >= 3.2.1) - rdf-rdfa (3.2.0) - haml (~> 5.2) + rdf-rdfa (3.2.3) + haml (>= 5.2, < 7) htmlentities (~> 4.3) rdf (~> 3.2) rdf-aggregate-repo (~> 3.2) rdf-vocab (~> 3.2) rdf-xsd (~> 3.2) - rdf-rdfxml (3.2.0) + rdf-rdfxml (3.2.2) + builder (~> 3.2) htmlentities (~> 4.3) rdf (~> 3.2) - rdf-rdfa (~> 3.2) rdf-xsd (~> 3.2) rdf-reasoner (0.8.0) rdf (~> 3.2) @@ -575,23 +551,21 @@ GEM rdf-turtle (3.2.1) ebnf (~> 2.3) rdf (~> 3.2) - rdf-vocab (3.2.3) + rdf-vocab (3.2.7) rdf (~> 3.2, >= 3.2.4) rdf-xsd (3.2.1) rdf (~> 3.2) rexml (~> 3.2) - rdoc (6.3.3) - recaptcha (5.8.1) - json - redcarpet (3.5.1) - redis (4.8.1) - redis-client (0.14.1) + recaptcha (5.15.0) + redcarpet (3.6.0) + redis (5.0.7) + redis-client (>= 0.9.0) + redis-client (0.16.0) connection_pool - regexp_parser (2.1.1) - remotipart (1.4.4) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) + regexp_parser (2.8.1) + responders (3.1.0) + actionpack (>= 5.2) + railties (>= 5.2) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -599,24 +573,28 @@ GEM netrc (~> 0.8) reverse_markdown (2.1.1) nokogiri - rexml (3.2.5) - rsolr (2.3.0) + rexml (3.2.6) + rouge (4.1.3) + rsolr (2.5.0) builder (>= 2.1.2) - faraday (>= 0.9.0) - rss (0.2.9) + faraday (>= 0.9, < 3, != 2.0.0) + rss (0.3.0) rexml - rubocop (1.23.0) + rubocop (1.56.1) + base64 (~> 0.1.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.13.0) - parser (>= 3.0.1.1) - ruby-progressbar (1.11.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) safely_block (0.4.0) sass (3.7.4) @@ -624,12 +602,8 @@ GEM sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.1.0) - railties (>= 5.2.0) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) @@ -639,8 +613,6 @@ GEM sprockets-rails tilt scanf (1.0.0) - sdoc (1.1.0) - rdoc (>= 5.0) shacl (0.3.0) json-ld (~> 3.2) rdf (~> 3.2, >= 3.2.8) @@ -655,77 +627,77 @@ GEM rdf-xsd (~> 3.2) sparql (~> 3.2) sxp (~> 1.2) - sidekiq (7.0.9) + sidekiq (7.1.2) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) - redis-client (>= 0.11.0) - sidekiq-status (3.0.2) + redis-client (>= 0.14.0) + sidekiq-status (3.0.3) chronic_duration sidekiq (>= 6.0, < 8) - simple_form (5.1.0) + simple_form (5.2.0) actionpack (>= 5.2) activemodel (>= 5.2) - simple_token_authentication (1.17.0) - actionmailer (>= 3.2.6, < 7) - actionpack (>= 3.2.6, < 7) + simple_po_parser (1.1.6) + simple_token_authentication (1.18.1) + actionmailer (>= 3.2.6, < 8) + actionpack (>= 3.2.6, < 8) devise (>= 3.2, < 6) - simplecov (0.21.2) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov-lcov (0.8.0) - simplecov_json_formatter (0.1.3) + simplecov_json_formatter (0.1.4) sitemap-parser (0.5.6) nokogiri (~> 1.6) typhoeus (>= 0.6, < 2.0) sitemap_generator (6.3.0) builder (~> 3.0) - sixarm_ruby_unaccent (1.2.0) - slim (4.1.0) - temple (>= 0.7.6, < 0.9) - tilt (>= 2.0.6, < 2.1) - sort_alphabetical (1.1.0) - unicode_utils (>= 1.2.2) - sparql (3.2.4) - builder (~> 3.2) - ebnf (~> 2.2, >= 2.3.1) + slim (5.1.1) + temple (~> 0.10.0) + tilt (>= 2.1.0) + sparql (3.2.6) + builder (~> 3.2, >= 3.2.4) + ebnf (~> 2.3, >= 2.3.5) logger (~> 1.5) - rdf (~> 3.2, >= 3.2.8) - rdf-aggregate-repo (~> 3.2) + rdf (~> 3.2, >= 3.2.11) + rdf-aggregate-repo (~> 3.2, >= 3.2.1) rdf-xsd (~> 3.2) - sparql-client (~> 3.2, >= 3.2.1) - sxp (~> 1.2, >= 1.2.2) - sparql-client (3.2.1) - net-http-persistent (~> 4.0, >= 4.0.1) - rdf (~> 3.2, >= 3.2.6) - sprockets (3.7.2) + sparql-client (~> 3.2, >= 3.2.2) + sxp (~> 1.2, >= 1.2.4) + sparql-client (3.2.2) + net-http-persistent (~> 4.0, >= 4.0.2) + rdf (~> 3.2, >= 3.2.11) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - stringio (3.0.1) - swd (1.3.0) + stringio (3.0.8) + swd (2.0.2) activesupport (>= 3) attr_required (>= 0.0.5) - httpclient (>= 2.4) - sxp (1.2.3) + faraday (~> 2.0) + faraday-follow_redirects + sxp (1.2.4) matrix (~> 0.4) rdf (~> 3.2) - temple (0.8.2) + temple (0.10.2) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - terser (1.1.13) + terser (1.1.17) execjs (>= 0.3.0, < 3) - thor (1.2.1) - tilt (2.0.11) - time_diff (0.3.0) - activesupport - i18n - timeout (0.3.2) + thor (1.2.2) + tilt (2.2.0) + timeout (0.4.0) + turbo-rails (1.4.0) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -733,21 +705,21 @@ GEM ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - tzinfo-data (1.2022.1) + tzinfo-data (1.2023.3) tzinfo (>= 1.0.0) + unaccent (0.4.0) unf (0.1.4) unf_ext - unf_ext (0.0.8.1) - unicode-display_width (2.1.0) + unf_ext (0.0.8.2) + unicode-display_width (2.4.2) unicode-types (1.8.0) - unicode_utils (1.4.0) validate_email (0.1.6) activemodel (>= 3.0) mail (>= 2.2.5) - validate_url (1.0.13) + validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix - vcr (6.1.0) + vcr (6.2.0) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.0) @@ -755,81 +727,77 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webfinger (1.2.0) + webfinger (2.1.2) activesupport - httpclient (>= 2.4) + faraday (~> 2.0) + faraday-follow_redirects webmock (3.18.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) whenever (1.0.0) chronic (>= 0.6.3) - will_paginate (3.3.1) + will_paginate (4.0.0) yaml-ld (0.0.2) json-ld (~> 3.2, >= 3.2.3) psych (>= 3.3) rdf (~> 3.2, >= 3.2.9) rdf-xsd (~> 3.2) - zeitwerk (2.6.7) + zeitwerk (2.6.11) PLATFORMS ruby DEPENDENCIES - active_model_serializers (~> 0.10.13) + active_model_serializers activerecord-session_store ahoy_matey - auto_strip_attributes (~> 2.0) + auto_strip_attributes better_errors binding_of_caller - bootsnap (>= 1.4.4) - bootstrap-datepicker-rails (~> 1.6.4.1) - bootstrap-sass (>= 3.4.1) + bootsnap + bootstrap-datepicker-rails + bootstrap-sass bootstrap-tab-history-rails - by_star! byebug - committee (~> 4.4) - country_select (<= 4.0.0) + committee + country_select devise - devise_invitable (~> 2.0.5) + devise_invitable eventbrite_sdk font-awesome-sass (~> 4.7.0) - friendly_id (~> 5.2.4) + friendly_id geocoder - gravtastic (~> 3.2.6) - haml + gravtastic handlebars_assets httparty i18n_data - icalendar (~> 2.4.1) + icalendar iso_country_codes jbuilder jquery-qtip2-wrapper-rails jquery-rails jquery-simplecolorpicker-rails jquery-turbolinks - json (>= 2.3.0) - kt-paperclip (~> 7.0.0) + kt-paperclip linkeddata listen - lunchy - minitest (= 5.14.4) + minitest minitest-reporters money-rails omniauth-rails_csrf_protection omniauth_openid_connect pg private_address_check - progress_bar (~> 1.1.0) pry-byebug - public_activity (~> 2.0.2) + public_activity puma - pundit (~> 1.1.0) + pundit rack-cors - rails (~> 6.0) + rails (= 7.0.7.2) rails-assets-clipboard (~> 1.5.12)! rails-assets-devbridge-autocomplete (~> 1.4.9)! rails-assets-eonasdan-bootstrap-datetimepicker (~> 4.17.42)! @@ -838,40 +806,37 @@ DEPENDENCIES rails-assets-select2 (~> 4.0.8)! rails-controller-testing rails-i18n - rails_admin (~> 2.2.1) - rdoc (>= 6.3.1) + rails_admin recaptcha - redcarpet (~> 3.5.1) - redis (< 5.0.0) + redcarpet + redis rest-client reverse_markdown rss rubocop - sass-rails (~> 5.0) - sassc-rails (~> 2.1.2) - sdoc (>= 1.1.0) - sidekiq (< 8) - sidekiq-status (~> 3.0.2) + sass-rails + sassc-rails + sidekiq + sidekiq-status simple_form - simple_token_authentication (~> 1.0) + simple_token_authentication simplecov simplecov-lcov - sitemap-parser (~> 0.5.6) + sitemap-parser sitemap_generator slim sunspot_rails! terser tess_rdf_extractors! - time_diff turbolinks tzinfo tzinfo-data - validate_url (~> 1.0.2) - vcr (~> 6.1.0) + validate_url + vcr web-console - webmock (~> 3.18.1) - whenever (~> 1.0.0) + webmock + whenever will_paginate BUNDLED WITH - 2.2.33 + 2.4.19 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 000000000..8a9f8901e --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link application.css +//= link application.js \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c26300c56..cd31ba7a4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -25,7 +25,7 @@ class ApplicationController < ActionController::Base skip_before_action :verify_authenticity_token, :if => Proc.new { |c| c.request.format == 'application/json' } # Do some access control - see policies folder for individual policies on models - include Pundit + include Pundit::Authorization rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index d698866f2..c7de6fd6d 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -171,7 +171,7 @@ def redirect action: "#{controller_name}##{action_name}", data: @event.url, params: params) - redirect_to @event.url + redirect_to @event.url, allow_other_host: true end private diff --git a/app/controllers/materials_controller.rb b/app/controllers/materials_controller.rb index f79f1c2e0..07f09fdea 100644 --- a/app/controllers/materials_controller.rb +++ b/app/controllers/materials_controller.rb @@ -1,7 +1,8 @@ # The controller for actions related to the Materials model class MaterialsController < ApplicationController before_action :feature_enabled? - before_action :set_material, only: [:show, :edit, :update, :destroy, :update_collections, :add_term, :reject_term, :clone] + before_action :set_material, only: [:show, :edit, :update, :destroy, :update_collections, :clone, + :add_term, :reject_term, :add_data, :reject_data] before_action :set_breadcrumbs include SearchableIndex diff --git a/app/controllers/resolution_controller.rb b/app/controllers/resolution_controller.rb index 14030af11..cdf28a541 100644 --- a/app/controllers/resolution_controller.rb +++ b/app/controllers/resolution_controller.rb @@ -1,6 +1,7 @@ # The controller for actions related to Resolution actions class ResolutionController < ApplicationController + before_action :parse_identifier skip_before_action :authenticate_user!, :authenticate_user_from_token! def resolve @@ -8,17 +9,17 @@ def resolve if model respond_to do |format| - format.any { redirect_to send("#{model.name.underscore}_path", params[:id], format: params[:format]) } + format.any { redirect_to send("#{model.name.underscore}_path", @identifier[:id], format: params[:format]) } end else - handle_error(400, "Unrecognized type: '#{params[:type]}' (valid types are: e, m, p, w)") + handle_error(400, "Unrecognized type: '#{@identifier[:type]}' (valid types are: e, m, p, w)") end end private def resolve_model - case params[:type].downcase + case @identifier[:type].downcase when 'e' Event when 'm' @@ -29,4 +30,13 @@ def resolve_model Workflow end end + + def parse_identifier + matches = params[:id].match(/(?.+\:)?(?[a-zA-Z])(?\d+)/) + if matches + @identifier = matches + else + raise ActionController:RoutingError + end + end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4e72edf5a..e222f4404 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,7 +2,7 @@ class UsersController < ApplicationController before_action -> { feature_enabled?('invitation') }, only: [:invitees] prepend_before_action :set_user, only: [:show, :edit, :update, :destroy, :change_token] - prepend_before_action :init_user, only: [:new, :create] + prepend_before_action :init_user, only: [:create] before_action :set_breadcrumbs include ActionView::Helpers::TextHelper @@ -43,11 +43,6 @@ def show end end - # GET /users/new - def new - authorize User - end - # GET /users/1/edit def edit authorize @user diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 422ac62ea..620957a7b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,6 +2,8 @@ # The core application helper module ApplicationHelper + IGNORED_FILTERS = %w[user].freeze + # def bootstrap_class_for flash_type # { success: "alert-success", error: "alert-danger", alert: "alert-warning", notice: "alert-info" }[flash_type] || flash_type.to_s # end diff --git a/app/serializers/application_serializer.rb b/app/serializers/application_serializer.rb index 5218fe446..2837c33ab 100644 --- a/app/serializers/application_serializer.rb +++ b/app/serializers/application_serializer.rb @@ -1,6 +1,6 @@ class ApplicationSerializer < ActiveModel::Serializer include Rails.application.routes.url_helpers - include Pundit + include Pundit::Authorization def scientific_topics ontology_terms(:scientific_topics) diff --git a/app/workers/geocoding_worker.rb b/app/workers/geocoding_worker.rb index 23c20b351..638a60b9e 100644 --- a/app/workers/geocoding_worker.rb +++ b/app/workers/geocoding_worker.rb @@ -11,7 +11,6 @@ class GeocodingWorker def perform(arg_array) event_id, location = arg_array - #puts "GeocodingWorker.perform(#{event_id.to_s},#{location.to_s})" event = Event.find_by_id(event_id) unless event @@ -19,7 +18,6 @@ def perform(arg_array) return end - Redis.exists_returns_integer = true redis = Redis.new(url: TeSS::Config.redis_url) if redis.exists?(location) @@ -30,10 +28,5 @@ def perform(arg_array) event.save! end - - #def self.perform_async(i) - # code here - #end - end diff --git a/config/application.rb b/config/application.rb index 59d0fbe52..2072efde2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,7 +9,7 @@ module TeSS class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.0 + config.load_defaults 7.0 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff --git a/config/initializers/check_hidden_filters.rb b/config/initializers/check_hidden_filters.rb new file mode 100644 index 000000000..adc2d535c --- /dev/null +++ b/config/initializers/check_hidden_filters.rb @@ -0,0 +1,12 @@ +# frozen-string-literal: true + +Rails.configuration.after_initialize do + # check the filter lists for correctness + if TeSS::Config.solr_enabled && TeSS::Config.solr_facets.present? + TeSS::Config.solr_facets.each_pair do |name, keys| + unknown_facets = Set.new(keys) - name.classify.constantize.facet_keys + + raise "unknown facets defined for #{name}: #{unknown_facets}" if unknown_facets.any? + end + end +end diff --git a/config/initializers/zz_hidden_filters.rb b/config/initializers/zz_hidden_filters.rb deleted file mode 100644 index c1c3bb19a..000000000 --- a/config/initializers/zz_hidden_filters.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen-string-literal: true - -# this file has a name late in the alphabet because it needs to be loaded after -# (at least load_ontologies.rb), since it uses Event, Material and Trainer objects -# which may use these. - -# systemwide ignored facet on frontend -IGNORED_FILTERS = %w[user].freeze - -# check the filter lists for correctness -if TeSS::Config.solr_enabled && TeSS::Config.solr_facets.present? - TeSS::Config.solr_facets.each_pair do |name, keys| - unknown_facets = Set.new(keys) - name.classify.constantize.facet_keys - - raise "unknown facets defined for #{name}: #{unknown_facets}" if unknown_facets.any? - end -end diff --git a/config/routes.rb b/config/routes.rb index bef9fa78d..3cfb20214 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -48,7 +48,7 @@ get 'static/home' - resources :users do + resources :users, only: [:show, :index, :edit, :create, :update, :destroy] do resource :ban, only: [:create, :new, :destroy] end @@ -152,7 +152,7 @@ mount Sidekiq::Web, at: '/sidekiq' end - get 'resolve/:prefix:type:id' => 'resolution#resolve', constraints: { prefix: /(.+\:)?/, type: /[a-zA-Z]/, id: /\d+/ } + get 'resolve/:id' => 'resolution#resolve' get 'theme_showcase' => 'static#showcase' diff --git a/docs/production.md b/docs/production.md index a728a713d..fb4ca7624 100644 --- a/docs/production.md +++ b/docs/production.md @@ -74,7 +74,7 @@ and clone the TeSS repo (for this guide we will put it in the `tess` user's home ## Install Ruby -Enter the TeSS directory we just cloned, and install TeSS' current version (3.0.4 at time of writing) of Ruby via RVM: +Enter the TeSS directory we just cloned, and install TeSS' current version (3.2.2 at time of writing) of Ruby via RVM: cd TeSS @@ -207,6 +207,7 @@ ServerName appropriately): ServerName www.yourhost.com + PassengerPreloadBundler on PassengerRuby /usr/local/rvm/rubies/tess/bin/ruby DocumentRoot /home/tess/TeSS/public diff --git a/env.sample b/env.sample index 3678c7d4e..2a102b793 100644 --- a/env.sample +++ b/env.sample @@ -20,4 +20,4 @@ SOLR_URL=http://solr:8983/solr/tess # REDIS (redis is the docker container name) REDIS_URL=redis://redis:6379/1 -REDIS_TEST_URL: redis://redis:6379/0 +REDIS_TEST_URL=redis://redis:6379/0 diff --git a/lib/bootstrap_pagination/rails.rb b/lib/bootstrap_pagination/rails.rb index e8e5e810f..cea7db2eb 100644 --- a/lib/bootstrap_pagination/rails.rb +++ b/lib/bootstrap_pagination/rails.rb @@ -18,7 +18,7 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - +require 'will_paginate/view_helpers/action_view' module BootstrapPagination class Rails < WillPaginate::ActionView::LinkRenderer diff --git a/test/controllers/materials_controller_test.rb b/test/controllers/materials_controller_test.rb index 58abb7840..46a596371 100644 --- a/test/controllers/materials_controller_test.rb +++ b/test/controllers/materials_controller_test.rb @@ -303,11 +303,11 @@ class MaterialsControllerTest < ActionController::TestCase assert_equal test_material.syllabus, JSON.parse(response.body)['syllabus'], 'syllabus not matched' assert_equal test_material.learning_objectives, JSON.parse(response.body)['learning_objectives'], 'learning objectives not matched' - assert_equal test_material.date_created.to_s("%Y-%m-%d"), JSON.parse(response.body)['date_created'], + assert_equal test_material.date_created.to_fs('%Y-%m-%d'), JSON.parse(response.body)['date_created'], 'date created not matched' - assert_equal test_material.date_modified.to_s("%Y-%m-%d"), JSON.parse(response.body)['date_modified'], + assert_equal test_material.date_modified.to_fs('%Y-%m-%d'), JSON.parse(response.body)['date_modified'], 'date modified not matched' - assert_equal test_material.date_published.to_s("%Y-%m-%d"), JSON.parse(response.body)['date_published'], + assert_equal test_material.date_published.to_fs('%Y-%m-%d'), JSON.parse(response.body)['date_published'], 'date published not matched' # reload diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index 665277dd6..b0e4fda5a 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -36,14 +36,9 @@ class UsersControllerTest < ActionController::TestCase # User new is handled by devise test "should never allow user new route" do - get :new - assert_redirected_to new_user_session_path - sign_in users(:regular_user) - get :new - assert_response :forbidden - sign_in users(:admin) - get :new - assert_response :forbidden + assert_raises(ActionController::UrlGenerationError) do + get :new + end end test "should be able to create user whilst logged in as admin" do diff --git a/test/models/material_test.rb b/test/models/material_test.rb index 561fae8ec..5765680ba 100644 --- a/test/models/material_test.rb +++ b/test/models/material_test.rb @@ -44,9 +44,9 @@ class MaterialTest < ActiveSupport::TestCase assert_equal 'Podcast', m.other_types, 'old other_types not matched.' assert_equal '1.0.3', m.version, 'old version not matched.' assert_equal 'development', m.status, 'old status not matched.' - assert_equal '2021-07-12', m.date_created.to_s('%Y-%m-%d'), 'old date created not matched.' - assert_equal '2021-07-13', m.date_modified.to_s('%Y-%m-%d'), 'old date modified not matched.' - assert_equal '2021-07-14', m.date_published.to_s('%Y-%m-%d'), 'old date published not matched.' + assert_equal '2021-07-12', m.date_created.to_fs('%Y-%m-%d'), 'old date created not matched.' + assert_equal '2021-07-13', m.date_modified.to_fs('%Y-%m-%d'), 'old date modified not matched.' + assert_equal '2021-07-14', m.date_published.to_fs('%Y-%m-%d'), 'old date published not matched.' assert_not_nil m.subsets, 'old subsets is nil.' assert_equal 2, m.subsets.size, 'old subsets size not matched.' @@ -110,9 +110,9 @@ class MaterialTest < ActiveSupport::TestCase assert_equal 'Podcast, White Paper', m2.other_types, 'new other_types not matched.' assert_equal '1.0.4', m2.version, 'new version not matched.' assert_equal 'active', m2.status, 'new status not matched.' - assert_equal '2021-06-12', m2.date_created.to_s('%Y-%m-%d'), 'new date created not matched.' - assert_equal '2021-06-13', m2.date_modified.to_s('%Y-%m-%d'), 'new date modified not matched.' - assert_equal '2021-06-14', m2.date_published.to_s('%Y-%m-%d'), 'new date published not matched.' + assert_equal '2021-06-12', m2.date_created.to_fs('%Y-%m-%d'), 'new date created not matched.' + assert_equal '2021-06-13', m2.date_modified.to_fs('%Y-%m-%d'), 'new date modified not matched.' + assert_equal '2021-06-14', m2.date_published.to_fs('%Y-%m-%d'), 'new date published not matched.' assert_not_nil m2.subsets, 'new subsets is nil.' assert_equal 0, m2.subsets.size, 'new subsets size not matched.' diff --git a/test/schema_helper.rb b/test/schema_helper.rb index 46ac08380..9eabcf873 100644 --- a/test/schema_helper.rb +++ b/test/schema_helper.rb @@ -60,7 +60,8 @@ def committee_response_data def current_committee_options @current_committee_options ||= { - schema: Committee::Drivers::load_from_file('public/api/definitions/tess.yml'), + schema: Committee::Drivers::load_from_file('public/api/definitions/tess.yml', + parser_options: { strict_reference_validation: true }), query_hash_key: 'rack.request.query_hash', parse_response_by_content_type: false } @@ -68,7 +69,8 @@ def current_committee_options def legacy_committee_options @legacy_committee_options ||= { - schema: Committee::Drivers::load_from_file('public/api/definitions/tess_legacy.yml'), + schema: Committee::Drivers::load_from_file('public/api/definitions/tess_legacy.yml', + parser_options: { strict_reference_validation: true }), query_hash_key: 'rack.request.query_hash', parse_response_by_content_type: false }