hyrax 2.7.2 → 2.8.0

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: 15c66e9b0693579023f7f5a57cd17c64d8e954e5178c4df7a4ac8b0ed006c1cb
4
- data.tar.gz: 71707611232797f25219dd4f5bd6b7b8023d2a281fb1256dc04db210f1224d11
3
+ metadata.gz: 140c7caa34751f7a525eda269abcee6331a9e7d200863e2cbee29d315966de65
4
+ data.tar.gz: 7085c394edd0aa1e90baef7d13f90245d8fb0fb65659e54549cedda0487445e9
5
5
  SHA512:
6
- metadata.gz: 88013dcbe9f0d04ee28edde4dae28fe811137c6c0d4681ab078a474f9991416fbd165fb71379c636a48f8836bf1676e9d6a85b8ce46f13eabcf00f98e6ea1510
7
- data.tar.gz: e383285af351dd33e9141072201b264fbd4eb3947a6e9fce6fe75d9824357ba6813c27eba198569199469663504cc31453c1f1afaa49ea47ebd8f62ee5526a1c
6
+ metadata.gz: 691b84f363281552cbd84f85b767bb5b460ba749e0449aed0498594143767a6cd4dae187a5dd9c88bf3b7bd06a568375da70367b3b8faa674a59f39deaf4df06
7
+ data.tar.gz: e19605afaa51b569ea79e7e99d65fd0576b172cd6dfeb38f815c4dd3a7ac18678bb6b3ff4ac4a5af2b6358bf55c459baba0c4a98b393d20f7d64388f576c894f
@@ -6,16 +6,13 @@ jobs:
6
6
  parameters:
7
7
  ruby_version:
8
8
  type: string
9
- default: 2.5.5
9
+ default: 2.5.8
10
10
  bundler_version:
11
11
  type: string
12
12
  default: 1.17.3
13
13
  rails_version:
14
14
  type: string
15
- default: '5.2.2'
16
- cache_version:
17
- type: string
18
- default: '1-2.x'
15
+ default: '5.2.4.3'
19
16
  executor:
20
17
  name: 'samvera/ruby'
21
18
  ruby_version: << parameters.ruby_version >>
@@ -28,6 +25,7 @@ jobs:
28
25
  - samvera/bundle_for_gem:
29
26
  ruby_version: << parameters.ruby_version >>
30
27
  bundler_version: << parameters.bundler_version >>
28
+ cache_version: '{{ checksum ".regen" }}'
31
29
  project: hyrax
32
30
  - persist_to_workspace:
33
31
  root: ~/
@@ -40,9 +38,6 @@ jobs:
40
38
  ruby_version:
41
39
  type: string
42
40
  default: 2.5.5
43
- cache_version:
44
- type: string
45
- default: '1-2.x'
46
41
  executor:
47
42
  name: 'samvera/ruby'
48
43
  ruby_version: << parameters.ruby_version >>
@@ -56,16 +51,13 @@ jobs:
56
51
  parameters:
57
52
  ruby_version:
58
53
  type: string
59
- default: 2.5.5
54
+ default: 2.5.8
60
55
  bundler_version:
61
56
  type: string
62
57
  default: 1.17.3
63
58
  rails_version:
64
59
  type: string
65
- default: '5.2.2'
66
- cache_version:
67
- type: string
68
- default: '1-2.x'
60
+ default: '5.2.4.3'
69
61
  executor:
70
62
  name: 'samvera/ruby'
71
63
  ruby_version: << parameters.ruby_version >>
@@ -78,11 +70,11 @@ jobs:
78
70
  - attach_workspace:
79
71
  at: ~/
80
72
  - samvera/engine_cart_generate:
81
- cache_key: v<< parameters.cache_version >>--internal-test-app-{{ checksum "hyrax.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-{{ checksum "lib/generators/hyrax/install_generator.rb" }}-<< parameters.rails_version >>-<< parameters.ruby_version >>
73
+ cache_key: v1-2.x-internal-test-app-{{ checksum "hyrax.gemspec" }}-{{ checksum ".regen" }}-<< parameters.rails_version >>-<< parameters.ruby_version >>
82
74
  - samvera/bundle_for_gem:
83
75
  ruby_version: << parameters.ruby_version >>
84
76
  bundler_version: << parameters.bundler_version >>
85
- cache_version: << parameters.cache_version >>
77
+ cache_version: '{{ checksum ".regen" }}'
86
78
  project: hyrax
87
79
  - persist_to_workspace:
88
80
  root: ~/
@@ -94,13 +86,10 @@ jobs:
94
86
  parameters:
95
87
  ruby_version:
96
88
  type: string
97
- default: 2.5.5
89
+ default: 2.5.8
98
90
  bundler_version:
99
91
  type: string
100
92
  default: 1.17.3
101
- cache_version:
102
- type: string
103
- default: '1-2.x'
104
93
  executor:
105
94
  name: 'samvera/ruby_fcrepo_solr_redis'
106
95
  ruby_version: << parameters.ruby_version >>
@@ -117,39 +106,77 @@ jobs:
117
106
  - samvera/bundle_for_gem:
118
107
  ruby_version: << parameters.ruby_version >>
119
108
  bundler_version: << parameters.bundler_version >>
120
- cache_version: << parameters.cache_version >>
109
+ cache_version: '{{ checksum ".regen" }}'
121
110
  project: hyrax
122
111
  - samvera/parallel_rspec
123
112
 
124
113
  workflows:
125
114
  version: 2
126
- ci:
115
+ ruby2-5rails5-1:
127
116
  jobs:
128
117
  - bundle:
129
- ruby_version: "2.5.5"
118
+ ruby_version: "2.5.8"
130
119
  rails_version: "5.1.7"
131
- cache_version: "1-2.x"
132
120
  - lint:
133
- ruby_version: "2.5.5"
134
- cache_version: "1-2.x"
121
+ ruby_version: "2.5.8"
135
122
  requires:
136
123
  - bundle
137
124
  - build:
138
- ruby_version: "2.5.5"
125
+ ruby_version: "2.5.8"
139
126
  rails_version: "5.1.7"
140
- cache_version: "1-2.x"
141
127
  requires:
142
128
  - bundle
143
129
  - test:
144
- name: "ruby2-5-5"
145
- ruby_version: "2.5.5"
130
+ name: "rails5-1"
131
+ ruby_version: "2.5.8"
146
132
  requires:
147
133
  - build
148
134
  - lint
135
+ ruby2-5rails5-2:
136
+ jobs:
137
+ - bundle:
138
+ ruby_version: "2.5.8"
139
+ rails_version: "5.2.4.3"
140
+ - build:
141
+ ruby_version: "2.5.8"
142
+ rails_version: "5.2.4.3"
143
+ requires:
144
+ - bundle
149
145
  - test:
150
- name: "ruby2-6-2"
151
- ruby_version: "2.6.2"
152
- cache_version: "1-2.x"
146
+ name: "ruby2-5-8"
147
+ ruby_version: "2.5.8"
148
+ requires:
149
+ - build
150
+ ruby2-6rails5-2:
151
+ jobs:
152
+ - bundle:
153
+ ruby_version: "2.6.6"
154
+ rails_version: "5.2.4.3"
155
+ - build:
156
+ ruby_version: "2.6.6"
157
+ rails_version: "5.2.4.3"
158
+ requires:
159
+ - bundle
160
+ - test:
161
+ name: "ruby2-6-6"
162
+ ruby_version: "2.6.6"
163
+ requires:
164
+ - build
165
+ ruby2-7rails5-2:
166
+ jobs:
167
+ - bundle:
168
+ ruby_version: "2.7.1"
169
+ rails_version: "5.2.4.3"
170
+ bundler_version: "2.1.2"
171
+ - build:
172
+ ruby_version: "2.7.1"
173
+ rails_version: "5.2.4.3"
174
+ bundler_version: "2.1.2"
175
+ requires:
176
+ - bundle
177
+ - test:
178
+ name: "ruby2-7-1"
179
+ ruby_version: "2.7.1"
180
+ bundler_version: "2.1.2"
153
181
  requires:
154
182
  - build
155
- - lint
data/.regen ADDED
@@ -0,0 +1 @@
1
+ 3
data/README.md CHANGED
@@ -128,7 +128,7 @@ Note here that the following commands assume you're setting up Hyrax in a develo
128
128
 
129
129
  First, you'll need a working Ruby installation. You can install this via your operating system's package manager -- you are likely to get farther with OSX, Linux, or UNIX than Windows but your mileage may vary -- but we recommend using a Ruby version manager such as [RVM](https://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv).
130
130
 
131
- Hyrax supports Ruby 2.3, 2.4 and 2.5. When starting a new project, we recommend using the latest Ruby 2.5 version.
131
+ Hyrax supports Ruby 2.3 and up. When starting a new project, we recommend using the latest Ruby 2.7 version.
132
132
 
133
133
  ## Redis
134
134
 
@@ -138,11 +138,11 @@ Starting up Redis will depend on your operating system, and may in fact already
138
138
 
139
139
  ## Rails
140
140
 
141
- Hyrax requires Rails 5. We recommend the latest Rails 5.1 release.
141
+ Hyrax 2.x supports Rails 5.1 and 5.2. We recommend the latest Rails 5.2 release.
142
142
 
143
143
  ```
144
144
  # If you don't already have Rails at your disposal...
145
- gem install rails -v 5.1.6
145
+ gem install rails -v '5.2.4.3'
146
146
  ```
147
147
 
148
148
  ### JavaScript runtime
@@ -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.1.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.6.0/template.rb
161
+ rails _5.2.4.3_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v2.8.0/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:
@@ -29,6 +29,7 @@ module Hyrax
29
29
  end
30
30
 
31
31
  def send_local_file_contents
32
+ return unless stale?(last_modified: local_file_last_modified, template: false)
32
33
  self.status = 200
33
34
  prepare_local_file_headers
34
35
  # For derivatives stored on the local file system
@@ -65,7 +66,7 @@ module Hyrax
65
66
  response.headers['Content-Type'] = local_file_mime_type
66
67
  response.headers['Content-Length'] ||= local_file_size.to_s
67
68
  # Prevent Rack::ETag from calculating a digest over body
68
- response.headers['Last-Modified'] = local_file_last_modified.utc.strftime("%a, %d %b %Y %T GMT")
69
+ response.headers['Last-Modified'] ||= local_file_last_modified.httpdate
69
70
  self.content_type = local_file_mime_type
70
71
  end
71
72
 
@@ -67,13 +67,13 @@ module Hyrax
67
67
  # @param [Array] val an array of two elements, first is a string (the uri) and the second is a hash with one key: `:label`
68
68
  def append_label_and_uri(solr_doc, solr_field_key, field_info, val)
69
69
  val = val.solrize
70
- self.class.create_and_insert_terms(solr_field_key,
71
- val.first,
72
- field_info.behaviors, solr_doc)
70
+ create_and_insert_terms_handler.create_and_insert_terms(solr_field_key,
71
+ val.first,
72
+ field_info.behaviors, solr_doc)
73
73
  return unless val.last.is_a? Hash
74
- self.class.create_and_insert_terms("#{solr_field_key}_label",
75
- label(val),
76
- field_info.behaviors, solr_doc)
74
+ create_and_insert_terms_handler.create_and_insert_terms("#{solr_field_key}_label",
75
+ label(val),
76
+ field_info.behaviors, solr_doc)
77
77
  end
78
78
 
79
79
  # Use this method to append a string value from a controlled vocabulary field
@@ -83,12 +83,12 @@ module Hyrax
83
83
  # @param [Hash] field_info
84
84
  # @param [String] val
85
85
  def append_label(solr_doc, solr_field_key, field_info, val)
86
- self.class.create_and_insert_terms(solr_field_key,
87
- val,
88
- field_info.behaviors, solr_doc)
89
- self.class.create_and_insert_terms("#{solr_field_key}_label",
90
- val,
91
- field_info.behaviors, solr_doc)
86
+ create_and_insert_terms_handler.create_and_insert_terms(solr_field_key,
87
+ val,
88
+ field_info.behaviors, solr_doc)
89
+ create_and_insert_terms_handler.create_and_insert_terms("#{solr_field_key}_label",
90
+ val,
91
+ field_info.behaviors, solr_doc)
92
92
  end
93
93
 
94
94
  # Return a label for the solrized term:
@@ -98,5 +98,14 @@ module Hyrax
98
98
  def label(val)
99
99
  val.last[:label].split('$').first
100
100
  end
101
+
102
+ # create_and_insert_terms was moved to ActiveFedora::Indexing::Inserter
103
+ # in ActiveFedora 12. broker calls to it through here to ensure an
104
+ # implementation is available
105
+ def create_and_insert_terms_handler
106
+ return self.class if self.class.respond_to?(:create_and_insert_terms)
107
+
108
+ 'ActiveFedora::Indexing::Inserter'.constantize
109
+ end
101
110
  end
102
111
  end
@@ -27,6 +27,7 @@ module Hyrax
27
27
  solr_doc['duration_tesim'] = object.duration
28
28
  solr_doc['sample_rate_tesim'] = object.sample_rate
29
29
  solr_doc['original_checksum_tesim'] = object.original_checksum
30
+ solr_doc['alpha_channels_ssi'] = object.try(:alpha_channels)
30
31
  solr_doc['original_file_id_ssi'] = original_file_id
31
32
  end
32
33
  end
@@ -40,7 +41,11 @@ module Hyrax
40
41
 
41
42
  def original_file_id
42
43
  return unless object.original_file
43
- object.original_file.id
44
+ if object.original_file.versions.present?
45
+ ActiveFedora::File.uri_to_id(object.current_content_version_uri)
46
+ else
47
+ object.original_file.id
48
+ end
44
49
  end
45
50
 
46
51
  def file_format
@@ -99,7 +99,11 @@ module Hyrax
99
99
  end
100
100
 
101
101
  def original_checksum
102
- self[Solrizer.solr_name("original_checksum")]
102
+ self["original_checksum_tesim"]
103
+ end
104
+
105
+ def alpha_channels
106
+ self["alpha_channels_ssi"]
103
107
  end
104
108
  end
105
109
  end
@@ -75,14 +75,15 @@ module Hyrax
75
75
  attribute :rendering_ids, Solr::Array, solr_name(Hyrax.config.rendering_predicate.value.split(/#|\/|,/).last, :symbol)
76
76
  attribute :thumbnail_id, Solr::String, solr_name('hasRelatedImage', :symbol)
77
77
  attribute :thumbnail_path, Solr::String, CatalogController.blacklight_config.index.thumbnail_field
78
- attribute :label, Solr::String, solr_name('label')
79
- attribute :file_format, Solr::String, solr_name('file_format')
80
- attribute :suppressed?, Solr::String, solr_name('suppressed', Solrizer::Descriptor.new(:boolean, :stored, :indexed))
81
78
 
82
- attribute :date_modified, Solr::Date, solr_name('date_modified', :stored_sortable, type: :date)
83
- attribute :date_uploaded, Solr::Date, solr_name('date_uploaded', :stored_sortable, type: :date)
84
- attribute :create_date, Solr::Date, solr_name('system_create', :stored_sortable, type: :date)
85
- attribute :modified_date, Solr::Date, solr_name('system_modified', :stored_sortable, type: :date)
79
+ attribute :label, Solr::String, "label_tesim"
80
+ attribute :file_format, Solr::String, "file_format_tesim"
81
+ attribute :suppressed?, Solr::String, "suppressed_bsi"
82
+ attribute :original_file_id, Solr::String, "original_file_id_ssi"
83
+ attribute :date_modified, Solr::Date, "date_modified_dtsi"
84
+ attribute :date_uploaded, Solr::Date, "date_uploaded_dtsi"
85
+ attribute :create_date, Solr::Date, "system_create_dtsi"
86
+ attribute :modified_date, Solr::Date, "system_modified_dtsi"
86
87
  attribute :embargo_release_date, Solr::Date, Hydra.config.permissions.embargo.release_date
87
88
  attribute :lease_expiration_date, Solr::Date, Hydra.config.permissions.lease.expiration_date
88
89
  end
@@ -10,7 +10,5 @@ module Hyrax
10
10
  class_name: 'JobIoWrapper',
11
11
  dependent: :destroy
12
12
  belongs_to :user, class_name: '::User'
13
-
14
- before_destroy :remove_file!
15
13
  end
16
14
  end
@@ -10,20 +10,24 @@ module Hyrax
10
10
  #
11
11
  # @return [IIIFManifest::DisplayImage] the display image required by the manifest builder.
12
12
  def display_image
13
- return nil unless ::FileSet.exists?(id) && solr_document.image? && current_ability.can?(:read, id)
14
- # @todo this is slow, find a better way (perhaps index iiif url):
15
- original_file = ::FileSet.find(id).original_file
13
+ return nil unless solr_document.image? && current_ability.can?(:read, solr_document)
14
+
15
+ latest_file_id = lookup_original_file_id
16
+
17
+ return nil unless latest_file_id
16
18
 
17
19
  url = Hyrax.config.iiif_image_url_builder.call(
18
- original_file.id,
20
+ latest_file_id,
19
21
  request.base_url,
20
22
  Hyrax.config.iiif_image_size_default
21
23
  )
24
+
22
25
  # @see https://github.com/samvera-labs/iiif_manifest
23
26
  IIIFManifest::DisplayImage.new(url,
24
- width: 640,
25
- height: 480,
26
- iiif_endpoint: iiif_endpoint(original_file.id))
27
+ format: image_format([]),
28
+ width: width,
29
+ height: height,
30
+ iiif_endpoint: iiif_endpoint(latest_file_id))
27
31
  end
28
32
 
29
33
  private
@@ -35,5 +39,23 @@ module Hyrax
35
39
  profile: Hyrax.config.iiif_image_compliance_level_uri
36
40
  )
37
41
  end
42
+
43
+ def image_format(channels)
44
+ channels.find { |c| c.include?('rgba') }.nil? ? 'jpg' : 'png'
45
+ end
46
+
47
+ def unindexed_current_file_version
48
+ Rails.logger.warn "Indexed current_file_version for #{id} not found, falling back to Fedora."
49
+ ActiveFedora::File.uri_to_id(::FileSet.find(id).current_content_version_uri)
50
+ end
51
+
52
+ def lookup_original_file_id
53
+ result = original_file_id
54
+ if result.blank?
55
+ Rails.logger.warn "original_file_id for #{id} not found, falling back to Fedora."
56
+ result = ActiveFedora::File.uri_to_id(::FileSet.find(id).current_content_version_uri)
57
+ end
58
+ result
59
+ end
38
60
  end
39
61
  end
@@ -30,8 +30,13 @@ module Hyrax
30
30
  :embargo_release_date, :lease_expiration_date,
31
31
  :depositor, :keyword, :title_or_label, :keyword,
32
32
  :date_created, :date_modified, :itemtype,
33
+ :original_file_id,
33
34
  to: :solr_document
34
35
 
36
+ def alpha_channels
37
+ []
38
+ end
39
+
35
40
  def single_use_links
36
41
  @single_use_links ||= SingleUseLink.where(itemId: id).map { |link| link_presenter_class.new(link) }
37
42
  end
@@ -14,7 +14,7 @@ module Hyrax
14
14
 
15
15
  def only_active_embargoes(solr_params)
16
16
  solr_params[:fq] ||= []
17
- solr_params[:fq] = 'embargo_release_date_dtsi:*'
17
+ solr_params[:fq] = 'embargo_release_date_dtsi:[* TO *]'
18
18
  end
19
19
  end
20
20
  end
@@ -14,7 +14,7 @@ module Hyrax
14
14
 
15
15
  def only_active_leases(solr_params)
16
16
  solr_params[:fq] ||= []
17
- solr_params[:fq] = 'lease_expiration_date_dtsi:*'
17
+ solr_params[:fq] = 'lease_expiration_date_dtsi:[* TO *]'
18
18
  end
19
19
  end
20
20
  end
@@ -14,47 +14,107 @@ module Hyrax
14
14
  # @see Sipity::Notification
15
15
  # @see Sipity::Method
16
16
  # @see ./lib/generators/hyrax/templates/workflow.json.erb
17
- WorkflowSchema = Dry::Validation.Schema do
18
- configure do
19
- def self.messages
20
- Dry::Validation::Messages.default.merge(
21
- en: { errors: { constant_name?: 'must be an initialized Ruby constant' } }
22
- )
17
+
18
+ # If using dry-validation < 1, create a Dry::Validation::Schema for backwards-compatibility.
19
+ # This schema should never ever change. If you need to modify it, upgrade to dry-validation >= 1
20
+ # and use the Dry::Validation::Contract subclass below.
21
+ if defined? Dry::Validation::Schema
22
+ Deprecation.warn(self, 'The Dry::Validation::Schema implemenation of Hyrax::Workflow::WorkflowSchema is deprecated. ' \
23
+ 'Please upgrade to dry-validation >= 1 to use the Dry::Validation::Contract implementation which will be part of Hyrax 3.0')
24
+ WorkflowSchema = Dry::Validation.Schema do
25
+ configure do
26
+ def self.messages
27
+ Dry::Validation::Messages.default.merge(
28
+ en: { errors: { constant_name?: 'must be an initialized Ruby constant' } }
29
+ )
30
+ end
31
+
32
+ def constant_name?(value)
33
+ value.constantize
34
+ true
35
+ rescue NameError
36
+ false
37
+ end
23
38
  end
24
39
 
25
- def constant_name?(value)
26
- value.constantize
27
- true
28
- rescue NameError
29
- false
40
+ required(:workflows).each do
41
+ required(:name).filled(:str?) # Sipity::Workflow#name
42
+ optional(:label).filled(:str?) # Sipity::Workflow#label
43
+ optional(:description).filled(:str?) # Sipity::Workflow#description
44
+ optional(:allows_access_grant).filled(:bool?) # Sipity::Workflow#allows_access_grant?
45
+ required(:actions).each do
46
+ schema do
47
+ required(:name).filled(:str?) # Sipity::WorkflowAction#name
48
+ required(:from_states).each do
49
+ schema do
50
+ required(:names) { array? { each(:str?) } } # Sipity::WorkflowState#name
51
+ required(:roles) { array? { each(:str?) } } # Sipity::Role#name
52
+ end
53
+ end
54
+ optional(:transition_to).filled(:str?) # Sipity::WorkflowState#name
55
+ optional(:notifications).each do
56
+ schema do
57
+ required(:name).value(:constant_name?) # Sipity::Notification#name
58
+ required(:notification_type).value(included_in?: Sipity::Notification.valid_notification_types)
59
+ required(:to) { array? { each(:str?) } }
60
+ optional(:cc) { array? { each(:str?) } }
61
+ optional(:bcc) { array? { each(:str?) } }
62
+ end
63
+ end
64
+ optional(:methods) { array? { each(:str?) } } # See it_behaves_like "a Hyrax workflow method"
65
+ end
66
+ end
30
67
  end
31
68
  end
69
+ elsif defined? Dry::Validation::Contract
70
+ # For dry-validation >= 1
71
+ class WorkflowSchema < Dry::Validation::Contract
72
+ class Types
73
+ include Dry::Types()
32
74
 
33
- required(:workflows).each do
34
- required(:name).filled(:str?) # Sipity::Workflow#name
35
- optional(:label).filled(:str?) # Sipity::Workflow#label
36
- optional(:description).filled(:str?) # Sipity::Workflow#description
37
- optional(:allows_access_grant).filled(:bool?) # Sipity::Workflow#allows_access_grant?
38
- required(:actions).each do
39
- schema do
40
- required(:name).filled(:str?) # Sipity::WorkflowAction#name
41
- required(:from_states).each do
42
- schema do
43
- required(:names) { array? { each(:str?) } } # Sipity::WorkflowState#name
44
- required(:roles) { array? { each(:str?) } } # Sipity::Role#name
45
- end
75
+ Constant = Types::Class.constructor do |v|
76
+ begin
77
+ v.constantize
78
+ rescue NameError => _err
79
+ v
46
80
  end
47
- optional(:transition_to).filled(:str?) # Sipity::WorkflowState#name
48
- optional(:notifications).each do
49
- schema do
50
- required(:name).value(:constant_name?) # Sipity::Notification#name
81
+ end
82
+ end
83
+
84
+ # Wrap the result for backwards-compatibility. This will be removed in Hyrax 3.0.
85
+ class ResultWrapper < SimpleDelegator
86
+ def messages(opts = {})
87
+ errors(opts)
88
+ end
89
+ end
90
+
91
+ # Provide a class method for backwards-compatibility. This will be removed in Hyrax 3.0.
92
+ def self.call(data)
93
+ ResultWrapper.new(new.call(data))
94
+ end
95
+
96
+ params do
97
+ required(:workflows).array(:hash) do
98
+ required(:name).filled(:string) # Sipity::Workflow#name
99
+ optional(:label).filled(:string) # Sipity::Workflow#label
100
+ optional(:description).filled(:string) # Sipity::Workflow#description
101
+ optional(:allows_access_grant).filled(:bool) # Sipity::Workflow#allows_access_grant?
102
+ required(:actions).array(:hash) do
103
+ required(:name).filled(:string) # Sipity::WorkflowAction#name
104
+ required(:from_states).array(:hash) do
105
+ required(:names) { array? { each(:string) } } # Sipity::WorkflowState#name
106
+ required(:roles) { array? { each(:string) } } # Sipity::Role#name
107
+ end
108
+ optional(:transition_to).filled(:string) # Sipity::WorkflowState#name
109
+ optional(:notifications).array(:hash) do
110
+ required(:name).value(Types::Constant) # Sipity::Notification#name
51
111
  required(:notification_type).value(included_in?: Sipity::Notification.valid_notification_types)
52
- required(:to) { array? { each(:str?) } }
53
- optional(:cc) { array? { each(:str?) } }
54
- optional(:bcc) { array? { each(:str?) } }
112
+ required(:to) { array? { each(:string) } }
113
+ optional(:cc) { array? { each(:string) } }
114
+ optional(:bcc) { array? { each(:string) } }
55
115
  end
56
116
  end
57
- optional(:methods) { array? { each(:str?) } } # See it_behaves_like "a Hyrax workflow method"
117
+ optional(:methods) { array? { each(:string) } } # See it_behaves_like "a Hyrax workflow method"
58
118
  end
59
119
  end
60
120
  end
@@ -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', '>= 11.5.2'
33
+ spec.add_dependency 'active-fedora', '>= 11.5.2', '< 12.2'
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'
@@ -40,9 +40,9 @@ SUMMARY
40
40
  spec.add_dependency 'carrierwave', '~> 1.0'
41
41
  spec.add_dependency 'clipboard-rails', '~> 1.5'
42
42
  spec.add_dependency 'dry-equalizer', '~> 0.2'
43
- spec.add_dependency 'dry-struct', '~> 0.1'
43
+ spec.add_dependency 'dry-struct', '>= 0.1', '< 2.0'
44
44
  spec.add_dependency 'dry-transaction', '~> 0.11'
45
- spec.add_dependency 'dry-validation', '~> 0.9'
45
+ spec.add_dependency 'dry-validation', '>= 0.9', '< 2.0'
46
46
  spec.add_dependency 'flipflop', '~> 2.3'
47
47
  # Pin more tightly because 0.x gems are potentially unstable
48
48
  spec.add_dependency 'flot-rails', '~> 0.0.6'
@@ -58,7 +58,7 @@ SUMMARY
58
58
  # Pin more tightly because 0.x gems are potentially unstable
59
59
  spec.add_dependency 'kaminari_route_prefix', '~> 0.1.1'
60
60
  spec.add_dependency 'legato', '~> 0.3'
61
- spec.add_dependency 'linkeddata' # Required for getting values from geonames
61
+ spec.add_dependency 'linkeddata', '~> 3.1' # Required for getting values from geonames
62
62
  spec.add_dependency 'mailboxer', '~> 0.12'
63
63
  spec.add_dependency 'nest', '~> 3.1'
64
64
  spec.add_dependency 'noid-rails', '~> 3.0.0'
@@ -70,12 +70,14 @@ SUMMARY
70
70
  spec.add_dependency 'qa', '~> 2.0' # questioning_authority
71
71
  spec.add_dependency 'rails_autolink', '~> 1.1'
72
72
  spec.add_dependency 'rdf-rdfxml' # controlled vocabulary importer
73
+ spec.add_dependency 'rdf-vocab', '< 3.1.5'
73
74
  spec.add_dependency 'redis-namespace', '~> 1.5'
74
75
  spec.add_dependency 'redlock', '>= 0.1.2'
75
76
  spec.add_dependency 'retriable', '>= 2.9', '< 4.0'
76
77
  spec.add_dependency 'samvera-nesting_indexer', '~> 2.0'
77
78
  spec.add_dependency 'select2-rails', '~> 3.5'
78
79
  spec.add_dependency 'signet'
80
+ spec.add_dependency 'solrizer', '>= 3.4', '< 5'
79
81
  spec.add_dependency 'tinymce-rails', '~> 4.1'
80
82
 
81
83
  # temporary pin to 2.17 due to failures caused in 2.18.0
@@ -17,6 +17,7 @@ require 'hyrax/engine'
17
17
  require 'hyrax/version'
18
18
  require 'hyrax/inflections'
19
19
  require 'kaminari_route_prefix'
20
+ require 'solrizer'
20
21
 
21
22
  module Hyrax
22
23
  extend ActiveSupport::Autoload
@@ -1,3 +1,3 @@
1
1
  module Hyrax
2
- VERSION = '2.7.2'.freeze
2
+ VERSION = '2.8.0'.freeze
3
3
  end
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.7.2
4
+ version: 2.8.0
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: 2020-05-07 00:00:00.000000000 Z
17
+ date: 2020-06-26 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -34,22 +34,22 @@ dependencies:
34
34
  name: active-fedora
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '11.5'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
39
  version: 11.5.2
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '12.2'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '11.5'
50
47
  - - ">="
51
48
  - !ruby/object:Gem::Version
52
49
  version: 11.5.2
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '12.2'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: almond-rails
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -180,16 +180,22 @@ dependencies:
180
180
  name: dry-struct
181
181
  requirement: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - "~>"
183
+ - - ">="
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0.1'
186
+ - - "<"
187
+ - !ruby/object:Gem::Version
188
+ version: '2.0'
186
189
  type: :runtime
187
190
  prerelease: false
188
191
  version_requirements: !ruby/object:Gem::Requirement
189
192
  requirements:
190
- - - "~>"
193
+ - - ">="
191
194
  - !ruby/object:Gem::Version
192
195
  version: '0.1'
196
+ - - "<"
197
+ - !ruby/object:Gem::Version
198
+ version: '2.0'
193
199
  - !ruby/object:Gem::Dependency
194
200
  name: dry-transaction
195
201
  requirement: !ruby/object:Gem::Requirement
@@ -208,16 +214,22 @@ dependencies:
208
214
  name: dry-validation
209
215
  requirement: !ruby/object:Gem::Requirement
210
216
  requirements:
211
- - - "~>"
217
+ - - ">="
212
218
  - !ruby/object:Gem::Version
213
219
  version: '0.9'
220
+ - - "<"
221
+ - !ruby/object:Gem::Version
222
+ version: '2.0'
214
223
  type: :runtime
215
224
  prerelease: false
216
225
  version_requirements: !ruby/object:Gem::Requirement
217
226
  requirements:
218
- - - "~>"
227
+ - - ">="
219
228
  - !ruby/object:Gem::Version
220
229
  version: '0.9'
230
+ - - "<"
231
+ - !ruby/object:Gem::Version
232
+ version: '2.0'
221
233
  - !ruby/object:Gem::Dependency
222
234
  name: flipflop
223
235
  requirement: !ruby/object:Gem::Requirement
@@ -422,16 +434,16 @@ dependencies:
422
434
  name: linkeddata
423
435
  requirement: !ruby/object:Gem::Requirement
424
436
  requirements:
425
- - - ">="
437
+ - - "~>"
426
438
  - !ruby/object:Gem::Version
427
- version: '0'
439
+ version: '3.1'
428
440
  type: :runtime
429
441
  prerelease: false
430
442
  version_requirements: !ruby/object:Gem::Requirement
431
443
  requirements:
432
- - - ">="
444
+ - - "~>"
433
445
  - !ruby/object:Gem::Version
434
- version: '0'
446
+ version: '3.1'
435
447
  - !ruby/object:Gem::Dependency
436
448
  name: mailboxer
437
449
  requirement: !ruby/object:Gem::Requirement
@@ -592,6 +604,20 @@ dependencies:
592
604
  - - ">="
593
605
  - !ruby/object:Gem::Version
594
606
  version: '0'
607
+ - !ruby/object:Gem::Dependency
608
+ name: rdf-vocab
609
+ requirement: !ruby/object:Gem::Requirement
610
+ requirements:
611
+ - - "<"
612
+ - !ruby/object:Gem::Version
613
+ version: 3.1.5
614
+ type: :runtime
615
+ prerelease: false
616
+ version_requirements: !ruby/object:Gem::Requirement
617
+ requirements:
618
+ - - "<"
619
+ - !ruby/object:Gem::Version
620
+ version: 3.1.5
595
621
  - !ruby/object:Gem::Dependency
596
622
  name: redis-namespace
597
623
  requirement: !ruby/object:Gem::Requirement
@@ -682,6 +708,26 @@ dependencies:
682
708
  - - ">="
683
709
  - !ruby/object:Gem::Version
684
710
  version: '0'
711
+ - !ruby/object:Gem::Dependency
712
+ name: solrizer
713
+ requirement: !ruby/object:Gem::Requirement
714
+ requirements:
715
+ - - ">="
716
+ - !ruby/object:Gem::Version
717
+ version: '3.4'
718
+ - - "<"
719
+ - !ruby/object:Gem::Version
720
+ version: '5'
721
+ type: :runtime
722
+ prerelease: false
723
+ version_requirements: !ruby/object:Gem::Requirement
724
+ requirements:
725
+ - - ">="
726
+ - !ruby/object:Gem::Version
727
+ version: '3.4'
728
+ - - "<"
729
+ - !ruby/object:Gem::Version
730
+ version: '5'
685
731
  - !ruby/object:Gem::Dependency
686
732
  name: tinymce-rails
687
733
  requirement: !ruby/object:Gem::Requirement
@@ -1104,6 +1150,7 @@ files:
1104
1150
  - ".github/stale.yml"
1105
1151
  - ".gitignore"
1106
1152
  - ".hound.yml"
1153
+ - ".regen"
1107
1154
  - ".rspec"
1108
1155
  - ".rubocop.yml"
1109
1156
  - ".rubocop_fixme.yml"
@@ -2387,7 +2434,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2387
2434
  - !ruby/object:Gem::Version
2388
2435
  version: '0'
2389
2436
  requirements: []
2390
- rubygems_version: 3.1.2
2437
+ rubygems_version: 3.0.3
2391
2438
  signing_key:
2392
2439
  specification_version: 4
2393
2440
  summary: Hyrax is a front-end based on the robust Samvera framework, providing a user