hyrax 2.9.2 → 2.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3bef3ee7def75c890f3e21ec1fa4efa746785d612873c2109b345b289d1a1e3
4
- data.tar.gz: 313f706adcc11793527a5f7200e37c18e8e4dc923bc8c0ce2ef2732b05438c2c
3
+ metadata.gz: eef9eee3ec09eb7e1d4ce28266b7a925c1d7a8b71a91c2d73241582c8023f6da
4
+ data.tar.gz: 10cd6ddbec25e1e76fb178eb6f58afd65e3d84567ffef55b370cc459424d0c75
5
5
  SHA512:
6
- metadata.gz: 70550f1faf082271fa8349b9b732f3e5b0c0b7ba1de61b00ab0c0c7a4ba349ff85ad5d2d6e115906222092d44eadf0dc144877bfd665ac8cbb4be7ea36a30bb9
7
- data.tar.gz: 9230d3532900a726c2e04078d6027b62e96e99ecfe5b133b633be858ffa775071060f36b91eb74edd53a3943621e54feb025ba0282357f9e923ed266af902087
6
+ metadata.gz: 7e626a4775a4d33d8a73bd758c24975884a54a3dddcfa5b4e4f25e454b68f3ea47f2414e16fe8dab6389f869810e67afc36a40a85861cde73c13c43f0e512818
7
+ data.tar.gz: 550869d00a885866fc5995e36982b862822c0325c2ab0a541e7902fb0b4d78cb7808f231ea330507d06de56e5ae0c3a428ef94600598074219c68415d89e3133
data/.circleci/config.yml CHANGED
@@ -12,7 +12,7 @@ jobs:
12
12
  default: 1.17.3
13
13
  rails_version:
14
14
  type: string
15
- default: '5.2.4.3'
15
+ default: '5.2.6'
16
16
  executor:
17
17
  name: 'samvera/ruby'
18
18
  ruby_version: << parameters.ruby_version >>
@@ -57,7 +57,7 @@ jobs:
57
57
  default: 1.17.3
58
58
  rails_version:
59
59
  type: string
60
- default: '5.2.4.3'
60
+ default: '5.2.6'
61
61
  executor:
62
62
  name: 'samvera/ruby'
63
63
  ruby_version: << parameters.ruby_version >>
@@ -101,7 +101,7 @@ jobs:
101
101
  - attach_workspace:
102
102
  at: ~/
103
103
  - samvera/install_solr_core:
104
- solr_config_path: .internal_test_app/solr/config
104
+ solr_config_path: .internal_test_app/solr/conf
105
105
  # Rerun bundler in case this is a different ruby version than bundle and build steps
106
106
  - samvera/bundle_for_gem:
107
107
  ruby_version: << parameters.ruby_version >>
@@ -136,10 +136,10 @@ workflows:
136
136
  jobs:
137
137
  - bundle:
138
138
  ruby_version: "2.5.8"
139
- rails_version: "5.2.4.3"
139
+ rails_version: "5.2.6"
140
140
  - build:
141
141
  ruby_version: "2.5.8"
142
- rails_version: "5.2.4.3"
142
+ rails_version: "5.2.6"
143
143
  requires:
144
144
  - bundle
145
145
  - test:
@@ -151,10 +151,10 @@ workflows:
151
151
  jobs:
152
152
  - bundle:
153
153
  ruby_version: "2.6.6"
154
- rails_version: "5.2.4.3"
154
+ rails_version: "5.2.6"
155
155
  - build:
156
156
  ruby_version: "2.6.6"
157
- rails_version: "5.2.4.3"
157
+ rails_version: "5.2.6"
158
158
  requires:
159
159
  - bundle
160
160
  - test:
@@ -166,11 +166,11 @@ workflows:
166
166
  jobs:
167
167
  - bundle:
168
168
  ruby_version: "2.7.1"
169
- rails_version: "5.2.4.3"
169
+ rails_version: "5.2.6"
170
170
  bundler_version: "2.1.2"
171
171
  - build:
172
172
  ruby_version: "2.7.1"
173
- rails_version: "5.2.4.3"
173
+ rails_version: "5.2.6"
174
174
  bundler_version: "2.1.2"
175
175
  requires:
176
176
  - bundle
data/.regen CHANGED
@@ -1 +1 @@
1
- 3
1
+ 3.http_method
data/README.md CHANGED
@@ -63,7 +63,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
63
63
  # Getting started
64
64
 
65
65
  This document contains instructions specific to setting up an app with __Hyrax
66
- v2.5.0__. If you are looking for instructions on installing a different
66
+ v2.9.6__. If you are looking for instructions on installing a different
67
67
  version, be sure to select the appropriate branch or tag from the drop-down
68
68
  menu above.
69
69
 
@@ -158,7 +158,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
158
158
  Generate a new Rails application using the template.
159
159
 
160
160
  ```
161
- rails _5.2.4.4_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.9.2/template.rb
161
+ rails _5.2.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.9.6/template.rb
162
162
  ```
163
163
 
164
164
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -4,7 +4,7 @@ Blacklight.onLoad(function () {
4
4
  $(".skip-to-content").click(function(event) {
5
5
  event.preventDefault();
6
6
  // element to focus on
7
- let skipTo = '#' + $(this)[0].firstElementChild.hash.split('#')[1];
7
+ var skipTo = '#' + $(this)[0].firstElementChild.hash.split('#')[1];
8
8
 
9
9
  // Setting 'tabindex' to -1 takes an element out of normal
10
10
  // tab flow but allows it to be focused via javascript
@@ -10,11 +10,12 @@ module Hyrax
10
10
  with_themed_layout :decide_layout
11
11
  copy_blacklight_config_from(::CatalogController)
12
12
 
13
- class_attribute :_curation_concern_type, :show_presenter, :work_form_service, :search_builder_class, :iiif_manifest_builder
13
+ class_attribute :_curation_concern_type, :show_presenter, :work_form_service, :search_builder_class
14
+ class_attribute :iiif_manifest_builder, instance_accessor: false
14
15
  self.show_presenter = Hyrax::WorkShowPresenter
15
16
  self.work_form_service = Hyrax::WorkFormService
16
17
  self.search_builder_class = WorkSearchBuilder
17
- self.iiif_manifest_builder = (Flipflop.cache_work_iiif_manifest? ? Hyrax::CachingIiifManifestBuilder.new : Hyrax::ManifestBuilderService.new)
18
+ self.iiif_manifest_builder = nil
18
19
  attr_accessor :curation_concern
19
20
  helper_method :curation_concern, :contextual_path
20
21
 
@@ -140,7 +141,8 @@ module Hyrax
140
141
  private
141
142
 
142
143
  def iiif_manifest_builder
143
- self.class.iiif_manifest_builder
144
+ self.class.iiif_manifest_builder ||
145
+ (Flipflop.cache_work_iiif_manifest? ? Hyrax::CachingIiifManifestBuilder.new : Hyrax::ManifestBuilderService.new)
144
146
  end
145
147
 
146
148
  def iiif_manifest_presenter
@@ -85,13 +85,18 @@ module Hyrax
85
85
  actor.revert_content(params[:revision])
86
86
  elsif params.key?(:file_set)
87
87
  if params[:file_set].key?(:files)
88
- actor.update_content(params[:file_set][:files].first)
88
+ actor.update_content(uploaded_file_from_path)
89
89
  else
90
90
  update_metadata
91
91
  end
92
92
  end
93
93
  end
94
94
 
95
+ def uploaded_file_from_path
96
+ uploaded_file = CarrierWave::SanitizedFile.new(params[:file_set][:files].first)
97
+ Hyrax::UploadedFile.create(user_id: current_user.id, file: uploaded_file)
98
+ end
99
+
95
100
  def after_update_response
96
101
  respond_to do |wants|
97
102
  wants.html do
@@ -73,7 +73,7 @@ module Hyrax
73
73
  ids = PermissionTemplateAccess.for_user(ability: self,
74
74
  access: ['deposit', 'manage'])
75
75
  .joins(:permission_template)
76
- .pluck('DISTINCT source_id')
76
+ .pluck(Arel.sql('DISTINCT source_id'))
77
77
  query = "_query_:\"{!raw f=has_model_ssim}AdminSet\" AND {!terms f=id}#{ids.join(',')}"
78
78
  ActiveFedora::SolrService.count(query).positive?
79
79
  end
@@ -67,7 +67,7 @@ module Hyrax
67
67
  end
68
68
 
69
69
  def file_size
70
- self[Solrizer.solr_name("file_size")]
70
+ self["file_size_lts"]
71
71
  end
72
72
 
73
73
  def filename
@@ -13,7 +13,7 @@ module Hyrax
13
13
  # If calling from Abilities, pass the ability. If you try to get the ability from the user, you end up in an infinit loop.
14
14
  def self.collection_type_ids_for_user(roles:, user: nil, ability: nil)
15
15
  return false unless user.present? || ability.present?
16
- return Hyrax::CollectionType.all.pluck('DISTINCT id') if user_admin?(user, ability)
16
+ return Hyrax::CollectionType.all.pluck(Arel.sql('DISTINCT id')) if user_admin?(user, ability)
17
17
  Hyrax::CollectionTypeParticipant.where(agent_type: Hyrax::CollectionTypeParticipant::USER_TYPE,
18
18
  agent_id: user_id(user, ability),
19
19
  access: roles)
@@ -21,7 +21,7 @@ module Hyrax
21
21
  Hyrax::CollectionTypeParticipant.where(agent_type: Hyrax::CollectionTypeParticipant::GROUP_TYPE,
22
22
  agent_id: user_groups(user, ability),
23
23
  access: roles)
24
- ).pluck('DISTINCT hyrax_collection_type_id')
24
+ ).pluck(Arel.sql('DISTINCT hyrax_collection_type_id'))
25
25
  end
26
26
 
27
27
  # @api public
@@ -174,7 +174,7 @@ module Hyrax
174
174
  def self.agent_ids_for(collection_type:, agent_type:, access:)
175
175
  Hyrax::CollectionTypeParticipant.where(hyrax_collection_type_id: collection_type.id,
176
176
  agent_type: agent_type,
177
- access: access).pluck('DISTINCT agent_id')
177
+ access: access).pluck(Arel.sql('DISTINCT agent_id'))
178
178
  end
179
179
  private_class_method :agent_ids_for
180
180
 
@@ -13,7 +13,7 @@ module Hyrax
13
13
  def self.source_ids_for_user(access:, ability:, source_type: nil, exclude_groups: [])
14
14
  scope = PermissionTemplateAccess.for_user(ability: ability, access: access, exclude_groups: exclude_groups)
15
15
  .joins(:permission_template)
16
- ids = scope.pluck('DISTINCT source_id')
16
+ ids = scope.pluck(Arel.sql('DISTINCT source_id'))
17
17
  return ids unless source_type
18
18
  filter_source(source_type: source_type, ids: ids)
19
19
  end
@@ -10,7 +10,7 @@ module Hyrax
10
10
 
11
11
  def show
12
12
  if parent_presenter
13
- polymorphic_path([:hyrax, :parent, presenter.model_name.singular],
13
+ polymorphic_path([:hyrax, :parent, presenter.model_name.singular.to_sym],
14
14
  parent_id: parent_presenter.id,
15
15
  id: presenter.id)
16
16
  else
@@ -35,9 +35,9 @@
35
35
  <%= link_to t("hyrax.search.form.option.my_collections.label_long"), "#",
36
36
  data: { "search-option" => hyrax.my_collections_path, "search-label" => t("hyrax.search.form.option.my_collections.label_short") } %>
37
37
  </li>
38
- <% end %>
38
+ </ul>
39
+ <% end %>
39
40
 
40
- </ul>
41
41
  </div><!-- /.input-group-btn -->
42
42
  </div><!-- /.input-group -->
43
43
 
@@ -24,7 +24,7 @@ HTML Properties:
24
24
  </div>
25
25
  <div class="message has-warning hidden"></div>
26
26
  <div style="margin-top: 10px">
27
- <%= link_to t('.attach_new_work'), polymorphic_path([main_app, :new, :hyrax, :parent, curation_concern.model_name.singular], parent_id: curation_concern.id), target: "_blank", class: 'btn btn-primary' %>
27
+ <%= link_to t('.attach_new_work'), polymorphic_path([main_app, :new, :hyrax, :parent, curation_concern.model_name.singular.to_sym], parent_id: curation_concern.id), target: "_blank", class: 'btn btn-primary' %>
28
28
  </div>
29
29
  <table class="table table-striped">
30
30
  <caption><%= t('.caption') %></caption>
@@ -1,3 +1,5 @@
1
1
  <%= f.full_error(:visibility) %>
2
2
  <%= f.full_error(:embargo_release_date) %>
3
3
  <%= f.full_error(:visibility_after_embargo) %>
4
+ <%= f.full_error(:lease_expiration_date) %>
5
+ <%= f.full_error(:visibility_after_lease) %>
@@ -15,7 +15,7 @@
15
15
  <ul class="dropdown-menu">
16
16
  <% presenter.valid_child_concerns.each do |concern| %>
17
17
  <li>
18
- <%= link_to "Attach #{concern.human_readable_type}", polymorphic_path([main_app, :new, :hyrax, :parent, concern.model_name.singular], parent_id: presenter.id) %>
18
+ <%= link_to "Attach #{concern.human_readable_type}", polymorphic_path([main_app, :new, :hyrax, :parent, concern.model_name.singular.to_sym], parent_id: presenter.id) %>
19
19
  </li>
20
20
  <% end %>
21
21
  </ul>
@@ -7,7 +7,7 @@
7
7
  <% provide :files_tab do %>
8
8
  <p class="instructions"><%= t("hyrax.batch_uploads.files.instructions") %></p>
9
9
  <p class="switch-upload-type"><%= t("hyrax.batch_uploads.files.upload_type_instructions") %>
10
- <%= link_to t("hyrax.batch_uploads.files.button_label"), [main_app, :new, Hyrax.primary_work_type.model_name.singular_route_key] %>
10
+ <%= link_to t("hyrax.batch_uploads.files.button_label"), [main_app, :new, Hyrax.primary_work_type.model_name.singular_route_key.to_sym] %>
11
11
  </p>
12
12
  <% end %>
13
13
  <%= render 'hyrax/base/guts4form', f: f, tabs: form_tabs_for(form: f.object) %>
data/hyrax.gemspec CHANGED
@@ -30,7 +30,7 @@ SUMMARY
30
30
  # http://guides.rubyonrails.org/maintenance_policy.html
31
31
  spec.add_dependency 'rails', '~> 5.0'
32
32
 
33
- spec.add_dependency 'active-fedora', '>= 11.5.2', '< 12.2'
33
+ spec.add_dependency 'active-fedora', '>= 11.5.2', '< 13'
34
34
  spec.add_dependency 'almond-rails', '~> 0.1'
35
35
  spec.add_dependency 'awesome_nested_set', '~> 3.1'
36
36
  spec.add_dependency 'blacklight', '~> 6.14'
@@ -34,7 +34,7 @@ module Hyrax
34
34
 
35
35
  def run_required_generators
36
36
  say_status('info', '[Hyrax] GENERATING BLACKLIGHT', :blue)
37
- generate 'blacklight:install --devise'
37
+ generate 'blacklight:install --devise --skip-solr'
38
38
  say_status('info', '[Hyrax] GENERATING HYDRA-HEAD', :blue)
39
39
  generate 'hydra:head -f'
40
40
  generate "hyrax:models#{options[:force] ? ' -f' : ''}"
@@ -20,6 +20,10 @@ class CatalogController < ApplicationController
20
20
  config.view.gallery.partials = [:index_header, :index]
21
21
  config.view.slideshow.partials = [:index]
22
22
 
23
+ # Because too many times on Samvera tech people raise a problem regarding a failed query to SOLR.
24
+ # Often, it's because they inadvertantly exceeded the character limit of a GET request.
25
+ config.http_method = :post
26
+
23
27
  ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
24
28
  config.default_solr_params = {
25
29
  qt: "search",
data/lib/hyrax/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hyrax
2
- VERSION = '2.9.2'.freeze
2
+ VERSION = '2.9.6'.freeze
3
3
  end
data/lib/hyrax.rb CHANGED
@@ -19,6 +19,7 @@ require 'hyrax/version'
19
19
  require 'hyrax/inflections'
20
20
  require 'kaminari_route_prefix'
21
21
  require 'solrizer'
22
+ require 'retriable'
22
23
 
23
24
  module Hyrax
24
25
  extend ActiveSupport::Autoload
data/template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # Hack for https://github.com/rails/rails/issues/35153
2
2
  gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"'
3
- gem 'hyrax', '2.9.2'
3
+ gem 'hyrax', '2.9.6'
4
4
  run 'bundle install'
5
5
  generate 'hyrax:install', '-f'
6
6
  rails_command 'db:migrate'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.2
4
+ version: 2.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2021-01-04 00:00:00.000000000 Z
17
+ date: 2021-09-10 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 11.5.2
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '12.2'
42
+ version: '13'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 11.5.2
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '12.2'
52
+ version: '13'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: almond-rails
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -2473,7 +2473,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2473
2473
  - !ruby/object:Gem::Version
2474
2474
  version: '0'
2475
2475
  requirements: []
2476
- rubygems_version: 3.1.2
2476
+ rubygems_version: 3.1.6
2477
2477
  signing_key:
2478
2478
  specification_version: 4
2479
2479
  summary: Hyrax is a front-end based on the robust Samvera framework, providing a user