diff --git a/Gemfile b/Gemfile index 258c40c6c..cc3dfa4a3 100644 --- a/Gemfile +++ b/Gemfile @@ -56,6 +56,8 @@ group :test do gem 'chromedriver-helper' gem 'database_cleaner' gem 'factory_girl_rails' + # rack-test >= 0.71 does not work with older Capybara versions (< 2.17). See #214 for more details + gem 'rack-test', '0.7.0' gem 'rails-controller-testing' gem 'selenium-webdriver' gem 'webmock' @@ -75,7 +77,7 @@ end gem 'blacklight', '~> 6.7' -gem 'hyrax', '2.0.2' +gem 'hyrax', '2.1.0' gem 'rsolr', '~> 2.0' gem 'devise' diff --git a/Gemfile.lock b/Gemfile.lock index b98512763..50b1762d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,25 +1,25 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.1.4) - actionpack (= 5.1.4) + actioncable (5.1.6) + actionpack (= 5.1.6) nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.1.4) - actionpack (= 5.1.4) - actionview (= 5.1.4) - activejob (= 5.1.4) + actionmailer (5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.4) - actionview (= 5.1.4) - activesupport (= 5.1.4) + actionpack (5.1.6) + actionview (= 5.1.6) + activesupport (= 5.1.6) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.4) - activesupport (= 5.1.4) + actionview (5.1.6) + activesupport (= 5.1.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -45,24 +45,20 @@ GEM rails (>= 4.2) active_encode (0.1.1) activesupport - active_fedora-noid (2.2.0) - active-fedora (>= 9.7, < 12) - noid (~> 0.9) - rails (>= 5.0.0, < 6) - activejob (5.1.4) - activesupport (= 5.1.4) + activejob (5.1.6) + activesupport (= 5.1.6) globalid (>= 0.3.6) - activemodel (5.1.4) - activesupport (= 5.1.4) - activerecord (5.1.4) - activemodel (= 5.1.4) - activesupport (= 5.1.4) + activemodel (5.1.6) + activesupport (= 5.1.6) + activerecord (5.1.6) + activemodel (= 5.1.6) + activesupport (= 5.1.6) arel (~> 8.0) - activerecord-import (0.22.0) + activerecord-import (0.24.0) activerecord (>= 3.2) - activesupport (5.1.4) + activesupport (5.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) + i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.5.2) @@ -77,17 +73,17 @@ GEM arel (8.0.0) ast (2.3.0) atomic (1.1.99) - autoprefixer-rails (7.1.6) + autoprefixer-rails (8.6.4) execjs awesome_nested_set (3.1.4) activerecord (>= 4.0.0, < 5.3) - aws-sdk (2.10.84) - aws-sdk-resources (= 2.10.84) - aws-sdk-core (2.10.84) + aws-sdk (2.11.76) + aws-sdk-resources (= 2.11.76) + aws-sdk-core (2.11.76) aws-sigv4 (~> 1.0) jmespath (~> 1.0) - aws-sdk-resources (2.10.84) - aws-sdk-core (= 2.10.84) + aws-sdk-resources (2.11.76) + aws-sdk-core (= 2.11.76) aws-sigv4 (1.0.2) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -97,7 +93,7 @@ GEM i18n bcrypt (3.1.11) bindex (0.5.0) - blacklight (6.12.0) + blacklight (6.15.0) bootstrap-sass (~> 3.2) deprecation globalid @@ -111,7 +107,7 @@ GEM blacklight (~> 6.0) cancancan (~> 1.8) deprecation (~> 1.0) - blacklight-gallery (0.9.0) + blacklight-gallery (0.10.0) blacklight (~> 6.3) bootstrap-sass (~> 3.0) openseadragon (>= 0.2.0) @@ -144,7 +140,7 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - carrierwave (1.2.1) + carrierwave (1.2.2) activemodel (>= 4.0.0) activesupport (>= 4.0.0) mime-types (>= 1.16) @@ -171,7 +167,7 @@ GEM activesupport (>= 3.0) deep_merge (~> 1.1.1) dry-validation (~> 0.10.4) - connection_pool (2.2.1) + connection_pool (2.2.2) coveralls (0.8.21) json (>= 1.8, < 3) simplecov (~> 0.14.1) @@ -181,7 +177,7 @@ GEM crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.4) - daemons (1.2.5) + daemons (1.2.6) database_cleaner (1.6.1) declarative (0.0.10) declarative-option (0.1.0) @@ -209,26 +205,26 @@ GEM dry-container (0.6.0) concurrent-ruby (~> 1.0) dry-configurable (~> 0.1, >= 0.1.3) - dry-core (0.4.1) + dry-core (0.4.7) concurrent-ruby (~> 1.0) - dry-equalizer (0.2.0) + dry-equalizer (0.2.1) + dry-inflector (0.1.2) dry-logic (0.4.2) dry-container (~> 0.2, >= 0.2.6) dry-core (~> 0.2) dry-equalizer (~> 0.2) - dry-struct (0.4.0) - dry-core (~> 0.4, >= 0.4.1) + dry-struct (0.5.0) + dry-core (~> 0.4, >= 0.4.3) dry-equalizer (~> 0.2) - dry-types (~> 0.12, >= 0.12.2) + dry-types (~> 0.13) ice_nine (~> 0.11) - dry-types (0.12.2) + dry-types (0.13.2) concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1) dry-container (~> 0.3) - dry-core (~> 0.2, >= 0.2.1) + dry-core (~> 0.4, >= 0.4.4) dry-equalizer (~> 0.2) + dry-inflector (~> 0.1, >= 0.1.2) dry-logic (~> 0.4, >= 0.4.2) - inflecto (~> 0.0.0, >= 0.0.2) dry-validation (0.10.7) concurrent-ruby (~> 1.0) dry-configurable (~> 0.1, >= 0.1.3) @@ -240,12 +236,12 @@ GEM json thread thread_safe - ebnf (1.1.1) - rdf (~> 2.2) + ebnf (1.1.2) + rdf (>= 2.2, < 4.0) sxp (~> 1.0) equivalent-xml (0.6.0) nokogiri (>= 1.4.3) - erubi (1.7.0) + erubi (1.7.1) erubis (2.7.0) execjs (2.7.0) factory_girl (4.8.0) @@ -262,23 +258,23 @@ GEM fcrepo_wrapper (0.9.0) ruby-progressbar ffi (1.9.18) - flipflop (2.3.1) + flipflop (2.4.0) activesupport (>= 4.0) flot-rails (0.0.7) jquery-rails - font-awesome-rails (4.7.0.3) - railties (>= 3.2, < 5.2) + font-awesome-rails (4.7.0.4) + railties (>= 3.2, < 6.0) globalid (0.4.1) activesupport (>= 4.2.0) - google-api-client (0.19.8) + google-api-client (0.23.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.5, < 0.7.0) httpclient (>= 2.8.1, < 3.0) mime-types (~> 3.0) representable (~> 3.0) retriable (>= 2.0, < 4.0) - google_drive (2.1.9) - google-api-client (>= 0.11.0, < 0.20.0) + google_drive (2.1.3) + google-api-client (>= 0.11.0, < 1.0.0) googleauth (>= 0.5.0, < 1.0.0) nokogiri (>= 1.5.3, < 2.0.0) googleauth (0.6.2) @@ -304,18 +300,18 @@ GEM mimemagic multipart-post http_logger (0.5.1) - httparty (0.16.1) + httparty (0.16.2) multi_xml (>= 0.5.2) httpclient (2.8.3) - hydra-access-controls (10.5.0) + hydra-access-controls (10.5.1) active-fedora (>= 10.0.0, < 12) activesupport (>= 4, < 6) blacklight (>= 5.16) blacklight-access_controls (~> 0.6) cancancan (~> 1.8) deprecation (~> 1.0) - hydra-core (10.5.0) - hydra-access-controls (= 10.5.0) + hydra-core (10.5.1) + hydra-access-controls (= 10.5.1) railties (>= 4.0.0, < 6) hydra-derivatives (3.4.1) active-fedora (>= 11.3.1, < 13) @@ -325,7 +321,7 @@ GEM deprecation mime-types (> 2.0, < 4.0) mini_magick (>= 3.2, < 5) - hydra-editor (3.3.2) + hydra-editor (4.0.2) active-fedora (>= 9.0.0) almond-rails (~> 0.1) cancancan (~> 1.8) @@ -334,9 +330,9 @@ GEM sprockets-es6 hydra-file_characterization (0.3.3) activesupport (>= 3.0.0) - hydra-head (10.5.0) - hydra-access-controls (= 10.5.0) - hydra-core (= 10.5.0) + hydra-head (10.5.1) + hydra-access-controls (= 10.5.1) + hydra-core (= 10.5.1) rails (>= 3.2.6) hydra-pcdm (0.11.0) active-fedora (>= 10, < 13) @@ -346,12 +342,11 @@ GEM hydra-file_characterization (~> 0.3, >= 0.3.3) hydra-pcdm (>= 0.9) om (~> 3.1) - hyrax (2.0.2) + hyrax (2.1.0) active-fedora (~> 11.5, >= 11.5.2) - active_fedora-noid (~> 2.0, >= 2.0.2) almond-rails (~> 0.1) awesome_nested_set (~> 3.1) - blacklight (~> 6.9) + blacklight (~> 6.14) blacklight-gallery (~> 0.7) breadcrumbs_on_rails (~> 3.0) browse-everything (>= 0.10.5) @@ -364,21 +359,24 @@ GEM flot-rails (~> 0.0.6) font-awesome-rails (~> 4.2) hydra-derivatives (~> 3.3) - hydra-editor (~> 3.3) + hydra-editor (>= 3.3, < 5.0) hydra-head (>= 10.5.0) hydra-works (~> 0.16) + iiif_manifest (>= 0.3, < 0.5) jquery-datatables-rails (~> 3.4) - jquery-ui-rails (~> 5.0) + jquery-ui-rails (~> 6.0) json-schema kaminari_route_prefix (~> 0.1.1) legato (~> 0.3) linkeddata mailboxer (~> 0.12) - nest (~> 2.0) + nest (~> 3.1) + noid-rails (~> 3.0.0) oauth oauth2 (~> 1.2) posix-spawn power_converter (~> 0.1, >= 0.1.2) + pul_uv_rails (~> 2.0) qa (~> 2.0) rails (~> 5.0) rails_autolink (~> 1.1) @@ -386,11 +384,12 @@ GEM redis-namespace (~> 1.5) redlock (>= 0.1.2) retriable (>= 2.9, < 4.0) + samvera-nesting_indexer (~> 2.0) select2-rails (~> 3.5) signet simple_form (~> 3.2, <= 3.5.0) tinymce-rails (~> 4.1) - i18n (0.9.1) + i18n (0.9.5) concurrent-ruby (~> 1.0) i18n-debug (1.1.0) i18n (< 1) @@ -412,33 +411,32 @@ GEM iiif_manifest (0.3.0) activesupport (>= 4) iiif-presentation (~> 0.2.0) - inflecto (0.0.2) io-like (0.3.0) is_it_working (1.1.0) iso-639 (0.2.8) jbuilder (2.7.0) activesupport (>= 4.2.0) multi_json (>= 1.2) - jmespath (1.3.1) + jmespath (1.4.0) jquery-datatables-rails (3.4.0) actionpack (>= 3.1) jquery-rails railties (>= 3.1) sass-rails - jquery-rails (4.3.1) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (5.0.5) + jquery-ui-rails (6.0.1) railties (>= 3.2.16) json (2.1.0) - json-ld (2.1.7) + json-ld (2.2.1) multi_json (~> 1.12) - rdf (~> 2.2, >= 2.2.8) - json-ld-preloaded (2.2.2) - json-ld (~> 2.1, >= 2.1.5) - multi_json (~> 1.11) - rdf (~> 2.2) + rdf (>= 2.2.8, < 4.0) + json-ld-preloaded (2.2.3) + json-ld (>= 2.2, < 4.0) + multi_json (~> 1.12) + rdf (>= 2.2, < 4.0) json-schema (2.8.0) addressable (>= 2.4) jwt (1.5.6) @@ -462,7 +460,7 @@ GEM rdf-xsd (>= 2.2, < 4.0) sparql (>= 2.2, < 4.0) sxp (~> 1.0) - ldp (0.7.0) + ldp (0.7.2) deprecation faraday http_logger @@ -528,21 +526,24 @@ GEM mini_magick (4.8.0) mini_mime (1.0.0) mini_portile2 (2.3.0) - minitest (5.10.3) + minitest (5.11.3) mods (2.1.0) iso-639 nokogiri nom-xml (~> 0.6.0) - multi_json (1.12.2) + multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.0.0) - nest (2.1.0) + nest (3.1.1) redic net-http-persistent (3.0.0) connection_pool (~> 2.2) - nio4r (2.1.0) + nio4r (2.3.1) noid (0.9.0) - nokogiri (1.8.2) + noid-rails (3.0.0) + actionpack (>= 5.0.0, < 6) + noid (~> 0.9) + nokogiri (1.8.3) mini_portile2 (~> 2.3.0) nom-xml (0.6.0) activesupport (>= 3.2.18) @@ -560,7 +561,7 @@ GEM activesupport nokogiri (>= 1.4.2) solrizer (~> 3.3) - openseadragon (0.4.0) + openseadragon (0.5.0) rails (> 3.2.0) orm_adapter (0.5.0) os (0.9.6) @@ -597,7 +598,8 @@ GEM posix-spawn (0.3.13) power_converter (0.1.2) powerpack (0.1.1) - public_suffix (3.0.1) + public_suffix (3.0.2) + pul_uv_rails (2.0.1) puma (3.9.1) qa (2.0.1) activerecord-import @@ -606,22 +608,22 @@ GEM nokogiri (~> 1.6) rails (~> 5.0) rdf - rack (2.0.3) + rack (2.0.5) rack-protection (2.0.0) rack rack-test (0.7.0) rack (>= 1.0, < 3) - rails (5.1.4) - actioncable (= 5.1.4) - actionmailer (= 5.1.4) - actionpack (= 5.1.4) - actionview (= 5.1.4) - activejob (= 5.1.4) - activemodel (= 5.1.4) - activerecord (= 5.1.4) - activesupport (= 5.1.4) + rails (5.1.6) + actioncable (= 5.1.6) + actionmailer (= 5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) + activemodel (= 5.1.6) + activerecord (= 5.1.6) + activesupport (= 5.1.6) bundler (>= 1.3.0) - railties (= 5.1.4) + railties (= 5.1.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -634,15 +636,15 @@ GEM loofah (~> 2.2, >= 2.2.2) rails_autolink (1.1.6) rails (> 3.1) - railties (5.1.4) - actionpack (= 5.1.4) - activesupport (= 5.1.4) + railties (5.1.6) + actionpack (= 5.1.6) + activesupport (= 5.1.6) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.2.2) rake - rake (12.3.0) + rake (12.3.1) rb-fsevent (0.9.8) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) @@ -651,8 +653,8 @@ GEM link_header (~> 0.0, >= 0.0.8) rdf-aggregate-repo (2.2.1) rdf (>= 2.2, < 4.0) - rdf-isomorphic (2.0.0) - rdf (~> 2.0) + rdf-isomorphic (2.2.0) + rdf (>= 2.0, < 4.0) rdf-json (2.2.0) rdf (>= 2.2, < 4.0) rdf-microdata (2.2.3) @@ -692,11 +694,11 @@ GEM rdf-turtle (>= 2.2, < 4.0) rdf-trix (2.2.1) rdf (>= 2.2, < 4.0) - rdf-turtle (2.2.1) + rdf-turtle (2.2.2) ebnf (~> 1.1) - rdf (~> 2.2) - rdf-vocab (2.2.8) - rdf (~> 2.2) + rdf (>= 2.2, < 4.0) + rdf-vocab (2.2.9) + rdf (>= 2.2, < 4.0) rdf-xsd (2.2.1) rdf (>= 2.2, < 4.0) redic (1.5.0) @@ -717,7 +719,7 @@ GEM riiif (1.4.4) railties (>= 4.2, < 6) rolify (5.1.0) - rsolr (2.1.0) + rsolr (2.2.1) builder (>= 2.1.2) faraday (>= 0.9.0) rspec (3.6.0) @@ -759,6 +761,8 @@ GEM ruby_dep (1.5.0) rubyzip (1.2.1) safe_yaml (1.0.4) + samvera-nesting_indexer (2.0.0) + dry-equalizer sass (3.4.25) sass-rails (5.0.7) railties (>= 4.0.0, < 6) @@ -776,13 +780,13 @@ GEM selenium-webdriver (3.4.2) childprocess (~> 0.5) rubyzip (~> 1.0) - shex (0.5.1) + shex (0.5.2) ebnf (~> 1.1) - json-ld (~> 2.1) - json-ld-preloaded (~> 2.1) - rdf (~> 2.2) - rdf-xsd (~> 2.2) - sparql (~> 2.2) + json-ld (>= 2.2, < 4.0) + json-ld-preloaded (>= 2.2, < 4.0) + rdf (>= 2.2, < 4.0) + rdf-xsd (>= 2.2, < 4.0) + sparql (>= 2.2, < 4.0) sxp (~> 1.0) sidekiq (5.0.3) concurrent-ruby (~> 1.0) @@ -807,7 +811,7 @@ GEM httmultiparty httparty (>= 0.11.0) oauth2 (>= 0.9.2) - slop (4.6.0) + slop (4.6.2) solr_wrapper (2.0.0) faraday retriable @@ -846,8 +850,8 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) stomp (1.4.4) - sxp (1.0.0) - rdf (~> 2.0) + sxp (1.0.1) + rdf (>= 2.2, < 4.0) temple (0.8.0) term-ansicolor (1.6.0) tins (~> 1.0) @@ -858,7 +862,7 @@ GEM thread_safe (0.3.6) tilt (2.0.8) tins (1.14.0) - tinymce-rails (4.7.9) + tinymce-rails (4.7.13) railties (>= 3.1.1) turbolinks (5.0.1) turbolinks-source (~> 5) @@ -867,7 +871,7 @@ GEM actionpack (>= 3.1) jquery-rails railties (>= 3.1) - tzinfo (1.2.4) + tzinfo (1.2.5) thread_safe (~> 0.1) uber (0.1.0) uglifier (3.2.0) @@ -919,7 +923,7 @@ DEPENDENCIES fcrepo_wrapper (~> 0.4) flipflop (~> 2.3) honeybadger (~> 3.0) - hyrax (= 2.0.2) + hyrax (= 2.1.0) i18n-debug i18n-tasks iiif_manifest (~> 0.3.0) @@ -938,6 +942,7 @@ DEPENDENCIES peek-sidekiq pg puma (~> 3.7) + rack-test (= 0.7.0) rails (~> 5.1.1) rails-controller-testing riiif (~> 1.1) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index ed808999f..bab830966 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -1,7 +1,7 @@ # TODO: move to hyrax? class AdminController < ApplicationController before_action :ensure_admin! - layout 'dashboard' + layout 'hyrax/dashboard' private diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1baf61a6a..0caa33765 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -20,6 +20,7 @@ class ApplicationController < ActionController::Base before_action :require_active_account!, if: :multitenant? before_action :set_account_specific_connections! + skip_after_action :discard_flash_if_xhr before_action :add_honeybadger_context diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 854694bb5..3d7d5bc12 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -3,7 +3,7 @@ # existing users class RolesController < ApplicationController load_and_authorize_resource :user, parent: false - layout 'dashboard' + layout 'hyrax/dashboard' before_action do authorize! :manage, Role diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 5dc6a3b3c..eb824538d 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -1,7 +1,7 @@ class SitesController < ApplicationController before_action :set_site load_and_authorize_resource instance_variable: :site, class: 'Site' # descendents still auth Site - layout 'dashboard' + layout 'hyrax/dashboard' def update params.require(:remove_banner_image) diff --git a/app/controllers/status_controller.rb b/app/controllers/status_controller.rb index a55b7fdf9..de5d5839a 100644 --- a/app/controllers/status_controller.rb +++ b/app/controllers/status_controller.rb @@ -1,5 +1,5 @@ class StatusController < ApplicationController - layout 'dashboard' + layout 'hyrax/dashboard' before_action do authorize! :read, :admin_dashboard diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 000000000..a009ace51 --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/jobs/import_work_from_purl_job.rb b/app/jobs/import_work_from_purl_job.rb index 675ee517d..bff4df934 100644 --- a/app/jobs/import_work_from_purl_job.rb +++ b/app/jobs/import_work_from_purl_job.rb @@ -42,6 +42,8 @@ def process_attributes(attributes) # rename :rights to :license attributes[:license] = attributes.delete(:rights) + attributes[:collection][:collection_type] ||= Hyrax::CollectionType.find_or_create_default_collection_type + process_collection(attributes) filenames = attributes.delete(:files) attributes[:remote_files] = filenames.map do |name| @@ -63,7 +65,8 @@ def process_attributes(attributes) visibility id collection - files] + files + collection_type] def process_collection(attributes) # rename :collection to :member_of_collection_ids diff --git a/app/views/_masthead.html.erb b/app/views/_masthead.html.erb index d58692b52..365e27a86 100644 --- a/app/views/_masthead.html.erb +++ b/app/views/_masthead.html.erb @@ -3,7 +3,6 @@ <%= render 'peek/bar' %> <% end %> -<%= render '/shared/select_work_type_modal' if create_work_presenter.many? %>