hyrax 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +19 -8
  3. data/.dassie/config/role_map.yml +2 -0
  4. data/.dassie/db/seeds.rb +1 -1
  5. data/.env +1 -1
  6. data/CONTAINERS.md +20 -0
  7. data/app/actors/hyrax/actors/file_set_actor.rb +10 -5
  8. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +0 -4
  9. data/app/forms/hyrax/forms/resource_form.rb +11 -1
  10. data/app/helpers/hyrax/dashboard_helper_behavior.rb +20 -5
  11. data/app/helpers/hyrax/embargo_helper.rb +4 -0
  12. data/app/helpers/hyrax/lease_helper.rb +4 -0
  13. data/app/helpers/hyrax/url_helper.rb +4 -1
  14. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +2 -0
  15. data/app/indexers/hyrax/valkyrie_work_indexer.rb +1 -1
  16. data/app/jobs/ingest_local_file_job.rb +18 -2
  17. data/app/models/collection_branding_info.rb +25 -9
  18. data/app/models/concerns/hyrax/embargoable.rb +24 -0
  19. data/app/models/concerns/hyrax/work_behavior.rb +1 -1
  20. data/app/presenters/hyrax/admin_set_options_presenter.rb +13 -1
  21. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +119 -0
  22. data/app/presenters/hyrax/work_show_presenter.rb +5 -1
  23. data/app/search_builders/hyrax/collection_member_search_builder.rb +6 -1
  24. data/app/search_builders/hyrax/my/collections_search_builder.rb +1 -1
  25. data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +1 -1
  26. data/app/search_builders/hyrax/single_collection_search_builder.rb +1 -1
  27. data/app/services/hyrax/contextual_path.rb +1 -1
  28. data/app/services/hyrax/edit_permissions_service.rb +47 -21
  29. data/app/services/hyrax/find_objects_via_solr_service.rb +27 -0
  30. data/app/services/hyrax/multiple_membership_checker.rb +6 -2
  31. data/app/services/hyrax/solr_query_builder_service.rb +17 -3
  32. data/app/services/hyrax/visibility_intention.rb +20 -2
  33. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
  34. data/app/views/hyrax/base/_form_visibility_error.html.erb +2 -0
  35. data/app/views/hyrax/base/_guts4form.html.erb +1 -1
  36. data/app/views/hyrax/base/_show_actions.html.erb +1 -1
  37. data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
  38. data/app/views/hyrax/batch_uploads/_form.html.erb +1 -1
  39. data/bin/db-migrate-seed.sh +3 -1
  40. data/bin/hyrax-entrypoint.sh +0 -14
  41. data/bin/solrcloud-assign-configset.sh +5 -0
  42. data/bin/solrcloud-upload-configset.sh +14 -5
  43. data/chart/hyrax/Chart.yaml +8 -4
  44. data/chart/hyrax/README.md +5 -4
  45. data/chart/hyrax/templates/_helpers.tpl +14 -0
  46. data/chart/hyrax/templates/branding-pvc.yaml +2 -2
  47. data/chart/hyrax/templates/configmap-env.yaml +7 -1
  48. data/chart/hyrax/templates/deployment-worker.yaml +39 -5
  49. data/chart/hyrax/templates/deployment.yaml +42 -0
  50. data/chart/hyrax/templates/derivatives-pvc.yaml +2 -2
  51. data/chart/hyrax/templates/ingress.yaml +13 -4
  52. data/chart/hyrax/templates/secrets.yaml +8 -0
  53. data/chart/hyrax/templates/uploads-pvc.yaml +2 -2
  54. data/chart/hyrax/values.yaml +71 -1
  55. data/config/initializers/valkryrie_storage.rb +7 -0
  56. data/docker-compose.yml +38 -8
  57. data/documentation/developing-your-hyrax-based-app.md +3 -3
  58. data/documentation/legacyREADME.md +4 -4
  59. data/lib/hyrax/configuration.rb +12 -0
  60. data/lib/hyrax/engine.rb +1 -0
  61. data/lib/hyrax/resource_name.rb +1 -0
  62. data/lib/hyrax/specs/capybara.rb +2 -2
  63. data/lib/hyrax/valkyrie_simple_path_generator.rb +20 -0
  64. data/lib/hyrax/version.rb +1 -1
  65. data/lib/wings.rb +0 -21
  66. data/lib/wings/active_fedora_converter/default_work.rb +15 -0
  67. data/lib/wings/model_transformer.rb +17 -1
  68. data/lib/wings/setup.rb +1 -0
  69. data/template.rb +1 -1
  70. metadata +8 -3
data/lib/hyrax/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
- VERSION = '3.0.1'
3
+ VERSION = '3.0.2'
4
4
  end
data/lib/wings.rb CHANGED
@@ -98,27 +98,6 @@ require 'wings/valkyrie/persister'
98
98
  require 'wings/valkyrie/storage'
99
99
  require 'wings/valkyrie/query_service'
100
100
 
101
- Hydra::AccessControl.send(:define_method, :valkyrie_resource) do
102
- attrs = attributes.symbolize_keys
103
- attrs[:new_record] = new_record?
104
- attrs[:created_at] = create_date
105
- attrs[:updated_at] = modified_date
106
-
107
- attrs[:permissions] = permissions.map do |permission|
108
- agent = permission.type == 'group' ? "group/#{permission.agent_name}" : permission.agent_name
109
-
110
- Hyrax::Permission.new(id: permission.id,
111
- mode: permission.access.to_sym,
112
- agent: agent,
113
- access_to: Valkyrie::ID.new(permission.access_to_id),
114
- new_record: permission.new_record?)
115
- end
116
-
117
- attrs[:access_to] = attrs[:permissions].find { |p| p.access_to&.id&.present? }&.access_to
118
-
119
- Hyrax::AccessControl.new(**attrs)
120
- end
121
-
122
101
  begin
123
102
  require 'wings/setup'
124
103
  rescue NameError, Hyrax::SimpleSchemaLoader::UndefinedSchemaError => err
@@ -100,6 +100,9 @@ module Wings
100
100
  include Hydra::AccessControls::Embargoable
101
101
  property :nested_resource, predicate: ::RDF::URI("http://example.com/nested_resource"), class_name: "Wings::ActiveFedoraConverter::NestedResource"
102
102
 
103
+ validates :lease_expiration_date, 'hydra/future_date': true, on: :create
104
+ validates :embargo_release_date, 'hydra/future_date': true, on: :create
105
+
103
106
  class_attribute :valkyrie_class
104
107
  self.valkyrie_class = Hyrax::Resource
105
108
 
@@ -121,6 +124,18 @@ module Wings
121
124
  alias to_s inspect
122
125
  end
123
126
 
127
+ ##
128
+ # Override aggressive Hydra::AccessControls validation
129
+ def enforce_future_date_for_embargo?
130
+ false
131
+ end
132
+
133
+ ##
134
+ # Override aggressive Hydra::AccessControls validation
135
+ def enforce_future_date_for_lease?
136
+ false
137
+ end
138
+
124
139
  def indexing_service
125
140
  Hyrax::ValkyrieIndexer.for(resource: valkyrie_resource)
126
141
  end
@@ -110,7 +110,7 @@ module Wings
110
110
  private
111
111
 
112
112
  def mint_id
113
- id = pcdm_object.assign_id
113
+ id = pcdm_object.try(:assign_id)
114
114
 
115
115
  pcdm_object.id = id if id.present?
116
116
  end
@@ -121,6 +121,7 @@ module Wings
121
121
 
122
122
  append_embargo(result)
123
123
  append_lease(result)
124
+ append_permissions(result)
124
125
 
125
126
  result
126
127
  end
@@ -168,5 +169,20 @@ module Wings
168
169
 
169
170
  attrs[:lease] = Hyrax::Lease.new(**lease_attrs)
170
171
  end
172
+
173
+ def append_permissions(attrs)
174
+ return unless pcdm_object.try(:permissions)
175
+ attrs[:permissions] = pcdm_object.permissions.map do |permission|
176
+ agent = permission.type == 'group' ? "group/#{permission.agent_name}" : permission.agent_name
177
+
178
+ Hyrax::Permission.new(id: permission.id,
179
+ mode: permission.access.to_sym,
180
+ agent: agent,
181
+ access_to: ::Valkyrie::ID.new(permission.access_to_id),
182
+ new_record: permission.new_record?)
183
+ end
184
+
185
+ attrs[:access_to] = attrs[:permissions].find { |p| p.access_to&.id&.present? }&.access_to
186
+ end
171
187
  end
172
188
  end
data/lib/wings/setup.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ActiveFedora::Base.include Wings::Valkyrizable
4
4
  ActiveFedora::File.include Wings::Valkyrizable
5
+ Hydra::AccessControl.include Wings::Valkyrizable
5
6
 
6
7
  module ActiveTriples
7
8
  class NodeConfig
data/template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  # Hack for https://github.com/rails/rails/issues/35153
3
3
  gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"'
4
- gem 'hyrax', '3.0.1'
4
+ gem 'hyrax', '3.0.2'
5
5
  run 'bundle install'
6
6
  generate 'hyrax:install', '-f'
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: 3.0.1
4
+ version: 3.0.2
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-03-31 00:00:00.000000000 Z
17
+ date: 2021-05-07 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -1835,6 +1835,7 @@ files:
1835
1835
  - app/models/concerns/hyrax/collection_behavior.rb
1836
1836
  - app/models/concerns/hyrax/collection_nesting.rb
1837
1837
  - app/models/concerns/hyrax/core_metadata.rb
1838
+ - app/models/concerns/hyrax/embargoable.rb
1838
1839
  - app/models/concerns/hyrax/file_set/belongs_to_works.rb
1839
1840
  - app/models/concerns/hyrax/file_set/characterization.rb
1840
1841
  - app/models/concerns/hyrax/file_set/derivatives.rb
@@ -1959,6 +1960,7 @@ files:
1959
1960
  - app/presenters/hyrax/model_icon.rb
1960
1961
  - app/presenters/hyrax/model_proxy.rb
1961
1962
  - app/presenters/hyrax/page_title_decorator.rb
1963
+ - app/presenters/hyrax/pcdm_member_presenter_factory.rb
1962
1964
  - app/presenters/hyrax/permission_badge.rb
1963
1965
  - app/presenters/hyrax/presenter_factory.rb
1964
1966
  - app/presenters/hyrax/presenter_renderer.rb
@@ -2085,6 +2087,7 @@ files:
2085
2087
  - app/services/hyrax/file_set_fixity_check_service.rb
2086
2088
  - app/services/hyrax/file_set_type_service.rb
2087
2089
  - app/services/hyrax/file_set_visibility_propagator.rb
2090
+ - app/services/hyrax/find_objects_via_solr_service.rb
2088
2091
  - app/services/hyrax/fixity/active_fedora_fixity_service.rb
2089
2092
  - app/services/hyrax/fixity/missing_content_error.rb
2090
2093
  - app/services/hyrax/fixity_check_failure_service.rb
@@ -2633,6 +2636,7 @@ files:
2633
2636
  - config/initializers/listeners.rb
2634
2637
  - config/initializers/nesting_indexer_initializer.rb
2635
2638
  - config/initializers/simple_form.rb
2639
+ - config/initializers/valkryrie_storage.rb
2636
2640
  - config/initializers/valkyrie_id_equality.rb
2637
2641
  - config/locales/hyrax.de.yml
2638
2642
  - config/locales/hyrax.en.yml
@@ -2873,6 +2877,7 @@ files:
2873
2877
  - lib/hyrax/transactions/work_create.rb
2874
2878
  - lib/hyrax/transactions/work_destroy.rb
2875
2879
  - lib/hyrax/valkyrie_can_can_adapter.rb
2880
+ - lib/hyrax/valkyrie_simple_path_generator.rb
2876
2881
  - lib/hyrax/version.rb
2877
2882
  - lib/hyrax/zotero.rb
2878
2883
  - lib/hyrax/zotero/config.rb
@@ -2958,7 +2963,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2958
2963
  - !ruby/object:Gem::Version
2959
2964
  version: '0'
2960
2965
  requirements: []
2961
- rubygems_version: 3.1.4
2966
+ rubygems_version: 3.1.6
2962
2967
  signing_key:
2963
2968
  specification_version: 4
2964
2969
  summary: Hyrax is a front-end based on the robust Samvera framework, providing a user