hyrax 5.0.0.rc3 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CONTAINERS.md +1 -1
  3. data/app/assets/javascripts/hyrax/autocomplete/linked_data.es6 +3 -0
  4. data/app/assets/javascripts/hyrax/editor/controlled_vocabulary.es6 +38 -5
  5. data/app/assets/stylesheets/hyrax/_file_upload.scss +6 -0
  6. data/app/assets/stylesheets/hyrax/controlled_vocabulary.scss +2 -2
  7. data/app/controllers/hyrax/dashboard/collections_controller.rb +0 -3
  8. data/app/controllers/hyrax/file_sets_controller.rb +1 -1
  9. data/app/controllers/hyrax/single_use_links_viewer_controller.rb +9 -2
  10. data/app/models/collection.rb +13 -1
  11. data/app/models/hyrax/model_registry.rb +1 -1
  12. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +2 -2
  13. data/app/presenters/hyrax/work_show_presenter.rb +2 -2
  14. data/app/search_builders/hyrax/catalog_search_builder.rb +7 -1
  15. data/app/services/hyrax/file_set_file_service.rb +10 -1
  16. data/app/services/hyrax/listeners/file_listener.rb +39 -0
  17. data/app/services/hyrax/listeners/file_metadata_listener.rb +0 -30
  18. data/app/services/hyrax/lock_manager.rb +2 -2
  19. data/app/services/hyrax/valkyrie_upload.rb +5 -2
  20. data/app/views/hyrax/uploads/_js_templates.html.erb +9 -9
  21. data/app/views/hyrax/uploads/_js_templates_branding.html.erb +3 -3
  22. data/app/views/hyrax/uploads/_js_templates_versioning.html.erb +1 -1
  23. data/chart/hyrax/Chart.yaml +1 -1
  24. data/chart/hyrax/templates/_tmplvalues.tpl +38 -0
  25. data/chart/hyrax/templates/deployment-worker.yaml +6 -2
  26. data/chart/hyrax/templates/deployment.yaml +21 -3
  27. data/chart/hyrax/values.yaml +10 -0
  28. data/documentation/developing-your-hyrax-based-app.md +14 -9
  29. data/hyrax.gemspec +2 -8
  30. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +1 -1
  31. data/lib/hyrax/publisher.rb +11 -0
  32. data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_work.rb +11 -0
  33. data/lib/hyrax/transactions/steps/delete_all_file_metadata.rb +4 -5
  34. data/lib/hyrax/version.rb +1 -1
  35. data/template.rb +1 -1
  36. metadata +45 -78
  37. data/spec/support/book_resource.rb +0 -36
  38. data/spec/support/can_can_overrides.rb +0 -43
  39. data/spec/support/clean_solr.rb +0 -7
  40. data/spec/support/controller_level_helpers.rb +0 -27
  41. data/spec/support/factory_helpers.rb +0 -94
  42. data/spec/support/fakes/fake_actor.rb +0 -22
  43. data/spec/support/fakes/fake_authority.rb +0 -14
  44. data/spec/support/fakes/fake_search_builder_scope.rb +0 -44
  45. data/spec/support/fakes/indexing_adapter.rb +0 -17
  46. data/spec/support/fakes/test_hydra_group_service.rb +0 -55
  47. data/spec/support/features/batch_edit_actions.rb +0 -37
  48. data/spec/support/features/session_helpers.rb +0 -15
  49. data/spec/support/features/workflow.rb +0 -10
  50. data/spec/support/features.rb +0 -11
  51. data/spec/support/form_with_validations.rb +0 -15
  52. data/spec/support/input_support.rb +0 -12
  53. data/spec/support/logging_formatter.rb +0 -67
  54. data/spec/support/matchers/api_responses.rb +0 -27
  55. data/spec/support/matchers/collection_type_property_matchers.rb +0 -30
  56. data/spec/support/matchers/embargo.rb +0 -9
  57. data/spec/support/matchers/lease.rb +0 -9
  58. data/spec/support/matchers/match_valkyrie_ids_with_af_ids.rb +0 -12
  59. data/spec/support/matchers/pcdm_matchers.rb +0 -34
  60. data/spec/support/matchers/permission.rb +0 -31
  61. data/spec/support/matchers/response_matchers.rb +0 -8
  62. data/spec/support/optional_example.rb +0 -17
  63. data/spec/support/rake.rb +0 -42
  64. data/spec/support/selectors.rb +0 -112
  65. data/spec/support/shared_examples_for_collection_presenter.rb +0 -44
  66. data/spec/support/simple_work.rb +0 -28
  67. data/spec/support/spec_statistic.rb +0 -24
  68. data/spec/support/speedup.rb +0 -7
  69. data/spec/support/statistic_helper.rb +0 -10
  70. data/spec/support/valkyrie_indexing.rb +0 -2
  71. data/spec/support/wings_models.rb +0 -9
  72. /data/{spec → lib/hyrax/specs/shared_specs}/factories/access_control.rb +0 -0
  73. /data/{spec → lib/hyrax/specs/shared_specs}/factories/admin_sets.rb +0 -0
  74. /data/{spec → lib/hyrax/specs/shared_specs}/factories/admin_sets_lw.rb +0 -0
  75. /data/{spec → lib/hyrax/specs/shared_specs}/factories/administrative_sets.rb +0 -0
  76. /data/{spec → lib/hyrax/specs/shared_specs}/factories/api_items.rb +0 -0
  77. /data/{spec → lib/hyrax/specs/shared_specs}/factories/collection_branding_infos.rb +0 -0
  78. /data/{spec → lib/hyrax/specs/shared_specs}/factories/collection_type_participants.rb +0 -0
  79. /data/{spec → lib/hyrax/specs/shared_specs}/factories/collection_types.rb +0 -0
  80. /data/{spec → lib/hyrax/specs/shared_specs}/factories/collections.rb +0 -0
  81. /data/{spec → lib/hyrax/specs/shared_specs}/factories/collections_factory.rb +0 -0
  82. /data/{spec → lib/hyrax/specs/shared_specs}/factories/content_blocks.rb +0 -0
  83. /data/{spec → lib/hyrax/specs/shared_specs}/factories/counter_metrics.rb +0 -0
  84. /data/{spec → lib/hyrax/specs/shared_specs}/factories/featured_works.rb +0 -0
  85. /data/{spec → lib/hyrax/specs/shared_specs}/factories/file_sets.rb +0 -0
  86. /data/{spec → lib/hyrax/specs/shared_specs}/factories/generic_works.rb +0 -0
  87. /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_collection.rb +0 -0
  88. /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_default_admin_set.rb +0 -0
  89. /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_embargo.rb +0 -0
  90. /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_file_metadata.rb +0 -0
  91. /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_file_set.rb +0 -0
  92. /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_lease.rb +0 -0
  93. /data/{spec → lib/hyrax/specs/shared_specs}/factories/hyrax_resource.rb +0 -0
  94. /data/{spec → lib/hyrax/specs/shared_specs}/factories/object_id.rb +0 -0
  95. /data/{spec → lib/hyrax/specs/shared_specs}/factories/operations.rb +0 -0
  96. /data/{spec → lib/hyrax/specs/shared_specs}/factories/permission.rb +0 -0
  97. /data/{spec → lib/hyrax/specs/shared_specs}/factories/permission_template_accesses.rb +0 -0
  98. /data/{spec → lib/hyrax/specs/shared_specs}/factories/permission_templates.rb +0 -0
  99. /data/{spec → lib/hyrax/specs/shared_specs}/factories/proxy_deposit_requests.rb +0 -0
  100. /data/{spec → lib/hyrax/specs/shared_specs}/factories/single_use_links.rb +0 -0
  101. /data/{spec → lib/hyrax/specs/shared_specs}/factories/sipity_entities.rb +0 -0
  102. /data/{spec → lib/hyrax/specs/shared_specs}/factories/uploaded_files.rb +0 -0
  103. /data/{spec → lib/hyrax/specs/shared_specs}/factories/users.rb +0 -0
  104. /data/{spec → lib/hyrax/specs/shared_specs}/factories/workflow_actions.rb +0 -0
  105. /data/{spec → lib/hyrax/specs/shared_specs}/factories/workflow_states.rb +0 -0
  106. /data/{spec → lib/hyrax/specs/shared_specs}/factories/workflows.rb +0 -0
@@ -25,14 +25,14 @@
25
25
 
26
26
  A Hyrax-based application includes lots of dependencies. We provide a [Docker image for getting started with your Hyrax-based application](/CONTAINERS.md#docker-image-for-hyrax-based-applications).
27
27
 
28
- <aside><p><em><strong>Note:</em></strong> The Docker image describes the canonical dependencies. In a way, it is executable documentation. The following documentation is our best effort to transcribe that executable documentation into a narrative. In other words, this documentation may drift away from the Docker details.</p></aside>
28
+ **NOTE:** The Docker image describes the canonical dependencies. In a way, it is executable documentation. The following documentation is our best effort to transcribe that executable documentation into a narrative. In other words, this documentation may drift away from the Docker details.
29
29
 
30
30
  You can also try [Running Hyrax-based application in local VM](https://github.com/samvera/hyrax/wiki/Hyrax-Development-Guide#running-hyrax-based-application-in-local-vm) which uses Ubuntu.
31
31
 
32
32
  During development, running only the dependent services in a container environment may be beneficial. This avoids potential headaches concerning file permissions and eases the use of debugging tools. The application generation instructions below use [Lando](https://lando.dev) to achieve this setup.
33
33
 
34
34
  This document contains instructions specific to setting up an app with __Hyrax
35
- v5.0.0.rc3__. If you are looking for instructions on installing a different
35
+ v5.0.1__. If you are looking for instructions on installing a different
36
36
  version, be sure to select the appropriate branch or tag from the drop-down
37
37
  menu above.
38
38
 
@@ -54,7 +54,7 @@ Hyrax requires the following software to work:
54
54
  1. [LibreOffice](#derivatives)
55
55
  1. [ffmpeg](#transcoding)
56
56
 
57
- **NOTE: The [Hyrax Development Guide](https://github.com/samvera/hyrax/wiki/Hyrax-Development-Guide) has instructions for installing Solr and Fedora in a development environment.**
57
+ **NOTE:** The [Hyrax Development Guide](https://github.com/samvera/hyrax/wiki/Hyrax-Development-Guide) has instructions for installing Solr and Fedora in a development environment.
58
58
 
59
59
  ### Characterization
60
60
  #### Servlet FITS
@@ -96,7 +96,7 @@ Once ffmpeg has been installed, enable transcoding by setting `config.enable_ffm
96
96
 
97
97
  ## Environments
98
98
 
99
- Note here that the following commands assume you're setting up Hyrax in a development environment (using the Rails built-in development environment). If you're setting up a production or production-like environment, you may wish to tell Rails that by prepending `RAILS_ENV=production` to the commands that follow, e.g., `rails`, `rake`, `bundle`, and so on.
99
+ **NOTE:** The following commands assume you're setting up Hyrax in a development environment (using the Rails built-in development environment). If you're setting up a production or production-like environment, you may wish to tell Rails that by prepending `RAILS_ENV=production` to the commands that follow, e.g., `rails`, `rake`, `bundle`, and so on.
100
100
 
101
101
  ## Ruby
102
102
 
@@ -116,18 +116,21 @@ Hyrax requires Rails 6. We recommend the latest Rails 6.1 release.
116
116
 
117
117
  ```
118
118
  # If you don't already have Rails at your disposal...
119
- gem install rails -v 6.1.7.6
119
+ gem install rails -v 6.1.7.7
120
120
  ```
121
121
 
122
122
  ### JavaScript runtime
123
123
 
124
124
  Rails requires that you have a JavaScript runtime installed (e.g. nodejs or rubyracer). Either install nodejs or uncomment the `rubyracer` line in your Gemfile and run `bundle install` before running Hyrax's install generator.
125
125
 
126
- NOTE: [nodejs](https://nodejs.org/en/) is preinstalled on most Mac computers and doesn't require a gem. To test if nodejs is already installed, execute `node -v` in the terminal and the version of nodejs will be displayed if it is installed.
126
+ **NOTE:** [nodejs](https://nodejs.org/en/) is preinstalled on most Mac computers and doesn't require a gem. To test if nodejs is already installed, execute `node -v` in the terminal and the version of nodejs will be displayed if it is installed.
127
127
 
128
128
  ## Creating a Hyrax-based app
129
129
 
130
- NOTE: The steps need to be done in order to create a new Hyrax based app.
130
+ Create a new Hyrax-based application by following these steps in order.
131
+
132
+ **NOTE:** Starting with Hyrax v5, the generated application will use [Valkyrie](https://github.com/samvera/valkyrie) for repository persistence.
133
+ Use of [ActiveFedora](https://github.com/samvera/active_fedora) (instead of Valkyrie) is deprecated, but it should still be possible to reconfigure the generated application to use it.
131
134
 
132
135
  ### Development Prerequisites
133
136
 
@@ -142,8 +145,10 @@ These instructions assume the use of [Lando](https://lando.dev) and [Docker](htt
142
145
 
143
146
  Generate a new Rails application using the template.
144
147
 
148
+ **NOTE:** `HYRAX_SKIP_WINGS` is needed here to avoid loading the Wings compatibility layer during the application generation process.
149
+
145
150
  ```shell
146
- rails _6.1.7.6_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.0.0.rc3/template.rb
151
+ HYRAX_SKIP_WINGS=true rails _6.1.7.7_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.0.1/template.rb
147
152
  ```
148
153
 
149
154
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -207,7 +212,7 @@ rails s
207
212
 
208
213
  And now you should be able to browse to [localhost:3000](http://localhost:3000/) and see the application.
209
214
 
210
- Notes:
215
+ **NOTE:**
211
216
  * This web server is purely for development purposes. You will want to use a more fully featured [web server](https://github.com/samvera/hyrax/wiki/Hyrax-Management-Guide#web-server) for production-like environments.
212
217
  * For a fresh start, the data persisted in Lando can be wiped using `lando destroy`.
213
218
 
data/hyrax.gemspec CHANGED
@@ -18,13 +18,7 @@ SUMMARY
18
18
  spec.homepage = "http://github.com/samvera/hyrax"
19
19
 
20
20
  spec.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR).reject do |f|
21
- f == 'bin/rails' ||
22
- # We want for downstream implementations to be able to leverage the various Hyrax factories.
23
- # As such we need them to be available in the .gem file. See `./lib/hyrax/spec/factories.rb`
24
- # for more details.
25
- (File.dirname(f) =~ %r{\A"?spec\/?} &&
26
- File.dirname(f) !~ %r{\A"?spec\/(factories|assets|support)\/?}
27
- )
21
+ f == 'bin/rails' || File.dirname(f) =~ %r{\A"?spec\/?}
28
22
  end
29
23
  spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
30
24
  spec.name = "hyrax"
@@ -91,7 +85,7 @@ SUMMARY
91
85
  spec.add_dependency 'tinymce-rails', '~> 5.10'
92
86
  spec.add_dependency 'valkyrie', '~> 3.1.1'
93
87
  spec.add_dependency 'view_component', '~> 2.74.1' # Pin until blacklight is updated with workaround for https://github.com/ViewComponent/view_component/issues/1565
94
- spec.add_dependency 'sprockets', '~> 3.7'
88
+ spec.add_dependency 'sprockets', '3.7.2' # 3.7.3 fails feature specs
95
89
  spec.add_dependency 'sass-rails', '~> 6.0'
96
90
  spec.add_dependency 'select2-rails', '~> 3.5'
97
91
 
@@ -276,7 +276,7 @@ Hyrax.config do |config|
276
276
 
277
277
  ## Enable Valkyrie only mode
278
278
  config.use_valkyrie = true
279
- config.disable_wings true
279
+ config.disable_wings = true
280
280
 
281
281
  # When your application is ready to use the valkyrie index instead of the one
282
282
  # maintained by active fedora, you will need to set this to true. You will
@@ -124,6 +124,16 @@ module Hyrax
124
124
 
125
125
  # @since 3.5.0
126
126
  # @macro a_registered_event
127
+ # @note this event SHOULD be published file is characteried by the
128
+ # characterization service. Normally, this should happen close to
129
+ # when the `file.metadata.updated` event (since characterization
130
+ # typically involves updating the metadata). Listeners that intend
131
+ # to track updates to file metadata should listen on that event
132
+ # topic.
133
+ # The event payload MUST include a `:file_set` ({Hyrax::FileSet}),
134
+ # a `:file_id` (the id of the {Valkyrie::StorageAdapter::File}),
135
+ # and MAY have a `path_hint` for a local path / cache for the
136
+ # file.
127
137
  register_event('file.characterized')
128
138
 
129
139
  # @since 3.3.0
@@ -208,6 +218,7 @@ module Hyrax
208
218
  @default_listeners ||=
209
219
  [Hyrax::Listeners::ACLIndexListener.new,
210
220
  Hyrax::Listeners::BatchNotificationListener.new,
221
+ Hyrax::Listeners::FileListener.new,
211
222
  Hyrax::Listeners::FileMetadataListener.new,
212
223
  Hyrax::Listeners::FileSetLifecycleListener.new,
213
224
  Hyrax::Listeners::FileSetLifecycleNotificationListener.new,
@@ -66,6 +66,11 @@ FactoryBot.define do
66
66
  .assign_access_for(visibility: evaluator.visibility_setting)
67
67
  end
68
68
 
69
+ if evaluator.respond_to?(:admin_set) && evaluator.admin_set.present?
70
+ template = Hyrax::PermissionTemplate.find_by(source_id: evaluator.admin_set.id)
71
+ Hyrax::PermissionTemplateApplicator.apply(template).to(model: work) if template
72
+ end
73
+
69
74
  work.permission_manager.edit_groups = work.permission_manager.edit_groups.to_a + evaluator.edit_groups
70
75
  work.permission_manager.edit_users = work.permission_manager.edit_users.to_a + evaluator.edit_users
71
76
  work.permission_manager.read_users = work.permission_manager.read_users.to_a + evaluator.read_users
@@ -80,6 +85,12 @@ FactoryBot.define do
80
85
  .new(resource: work)
81
86
  .assign_access_for(visibility: evaluator.visibility_setting)
82
87
  end
88
+
89
+ if evaluator.respond_to?(:admin_set) && evaluator.admin_set.present?
90
+ template = Hyrax::PermissionTemplate.find_by(source_id: evaluator.admin_set.id)
91
+ Hyrax::PermissionTemplateApplicator.apply(template).to(model: work) if template
92
+ end
93
+
83
94
  work.permission_manager.edit_groups = work.permission_manager.edit_groups.to_a + evaluator.edit_groups
84
95
  work.permission_manager.edit_users = work.permission_manager.edit_users.to_a + evaluator.edit_users
85
96
  work.permission_manager.read_users = work.permission_manager.read_users.to_a + evaluator.read_users
@@ -14,8 +14,7 @@ module Hyrax
14
14
 
15
15
  ##
16
16
  # @params [#save] persister
17
- def initialize(property: :file_ids, query_service: Hyrax.query_service, persister: Hyrax.persister, publisher: Hyrax.publisher)
18
- @property = property
17
+ def initialize(query_service: Hyrax.query_service, persister: Hyrax.persister, publisher: Hyrax.publisher)
19
18
  @persister = persister
20
19
  @query_service = query_service
21
20
  @publisher = publisher
@@ -29,10 +28,10 @@ module Hyrax
29
28
  def call(resource)
30
29
  return Failure(:resource_not_persisted) unless resource.persisted?
31
30
 
32
- resource[@property].each do |file_id|
33
- return Failure[:failed_to_delete_file_metadata, file_id] unless
31
+ @query_service.custom_queries.find_files(file_set: resource).each do |file_metadata|
32
+ return Failure[:failed_to_delete_file_metadata, file_metadata.id] unless
34
33
  Hyrax::Transactions::Container['file_metadata.destroy']
35
- .call(@query_service.custom_queries.find_file_metadata_by(id: file_id))
34
+ .call(file_metadata)
36
35
  .success?
37
36
  rescue ::Ldp::Gone
38
37
  nil
data/lib/hyrax/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
- VERSION = '5.0.0.rc3'
3
+ VERSION = '5.0.1'
4
4
  end
data/template.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
- gem 'hyrax', '5.0.0.rc3'
2
+ gem 'hyrax', '5.0.1'
3
3
  run 'bundle install'
4
4
  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: 5.0.0.rc3
4
+ version: 5.0.1
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: 2024-02-23 00:00:00.000000000 Z
17
+ date: 2024-03-29 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -770,16 +770,16 @@ dependencies:
770
770
  name: sprockets
771
771
  requirement: !ruby/object:Gem::Requirement
772
772
  requirements:
773
- - - "~>"
773
+ - - '='
774
774
  - !ruby/object:Gem::Version
775
- version: '3.7'
775
+ version: 3.7.2
776
776
  type: :runtime
777
777
  prerelease: false
778
778
  version_requirements: !ruby/object:Gem::Requirement
779
779
  requirements:
780
- - - "~>"
780
+ - - '='
781
781
  - !ruby/object:Gem::Version
782
- version: '3.7'
782
+ version: 3.7.2
783
783
  - !ruby/object:Gem::Dependency
784
784
  name: sass-rails
785
785
  requirement: !ruby/object:Gem::Requirement
@@ -2387,6 +2387,7 @@ files:
2387
2387
  - app/services/hyrax/listeners/acl_index_listener.rb
2388
2388
  - app/services/hyrax/listeners/active_fedora_acl_index_listener.rb
2389
2389
  - app/services/hyrax/listeners/batch_notification_listener.rb
2390
+ - app/services/hyrax/listeners/file_listener.rb
2390
2391
  - app/services/hyrax/listeners/file_metadata_listener.rb
2391
2392
  - app/services/hyrax/listeners/file_set_lifecycle_listener.rb
2392
2393
  - app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb
@@ -2935,6 +2936,7 @@ files:
2935
2936
  - chart/hyrax/README.md
2936
2937
  - chart/hyrax/templates/NOTES.txt
2937
2938
  - chart/hyrax/templates/_helpers.tpl
2939
+ - chart/hyrax/templates/_tmplvalues.tpl
2938
2940
  - chart/hyrax/templates/branding-pvc.yaml
2939
2941
  - chart/hyrax/templates/configmap-env.yaml
2940
2942
  - chart/hyrax/templates/cron-embargo.yaml
@@ -3196,8 +3198,44 @@ files:
3196
3198
  - lib/hyrax/specs/shared_specs.rb
3197
3199
  - lib/hyrax/specs/shared_specs/change_set.rb
3198
3200
  - lib/hyrax/specs/shared_specs/derivative_service.rb
3201
+ - lib/hyrax/specs/shared_specs/factories/access_control.rb
3202
+ - lib/hyrax/specs/shared_specs/factories/admin_sets.rb
3203
+ - lib/hyrax/specs/shared_specs/factories/admin_sets_lw.rb
3204
+ - lib/hyrax/specs/shared_specs/factories/administrative_sets.rb
3205
+ - lib/hyrax/specs/shared_specs/factories/api_items.rb
3206
+ - lib/hyrax/specs/shared_specs/factories/collection_branding_infos.rb
3207
+ - lib/hyrax/specs/shared_specs/factories/collection_type_participants.rb
3208
+ - lib/hyrax/specs/shared_specs/factories/collection_types.rb
3209
+ - lib/hyrax/specs/shared_specs/factories/collections.rb
3210
+ - lib/hyrax/specs/shared_specs/factories/collections_factory.rb
3211
+ - lib/hyrax/specs/shared_specs/factories/content_blocks.rb
3212
+ - lib/hyrax/specs/shared_specs/factories/counter_metrics.rb
3213
+ - lib/hyrax/specs/shared_specs/factories/featured_works.rb
3214
+ - lib/hyrax/specs/shared_specs/factories/file_sets.rb
3215
+ - lib/hyrax/specs/shared_specs/factories/generic_works.rb
3216
+ - lib/hyrax/specs/shared_specs/factories/hyrax_collection.rb
3217
+ - lib/hyrax/specs/shared_specs/factories/hyrax_default_admin_set.rb
3218
+ - lib/hyrax/specs/shared_specs/factories/hyrax_embargo.rb
3219
+ - lib/hyrax/specs/shared_specs/factories/hyrax_file_metadata.rb
3220
+ - lib/hyrax/specs/shared_specs/factories/hyrax_file_set.rb
3221
+ - lib/hyrax/specs/shared_specs/factories/hyrax_lease.rb
3222
+ - lib/hyrax/specs/shared_specs/factories/hyrax_resource.rb
3223
+ - lib/hyrax/specs/shared_specs/factories/hyrax_work.rb
3224
+ - lib/hyrax/specs/shared_specs/factories/object_id.rb
3225
+ - lib/hyrax/specs/shared_specs/factories/operations.rb
3226
+ - lib/hyrax/specs/shared_specs/factories/permission.rb
3227
+ - lib/hyrax/specs/shared_specs/factories/permission_template_accesses.rb
3228
+ - lib/hyrax/specs/shared_specs/factories/permission_templates.rb
3229
+ - lib/hyrax/specs/shared_specs/factories/proxy_deposit_requests.rb
3230
+ - lib/hyrax/specs/shared_specs/factories/single_use_links.rb
3231
+ - lib/hyrax/specs/shared_specs/factories/sipity_entities.rb
3199
3232
  - lib/hyrax/specs/shared_specs/factories/strategies/json_strategy.rb
3200
3233
  - lib/hyrax/specs/shared_specs/factories/strategies/valkyrie_resource.rb
3234
+ - lib/hyrax/specs/shared_specs/factories/uploaded_files.rb
3235
+ - lib/hyrax/specs/shared_specs/factories/users.rb
3236
+ - lib/hyrax/specs/shared_specs/factories/workflow_actions.rb
3237
+ - lib/hyrax/specs/shared_specs/factories/workflow_states.rb
3238
+ - lib/hyrax/specs/shared_specs/factories/workflows.rb
3201
3239
  - lib/hyrax/specs/shared_specs/hydra_works.rb
3202
3240
  - lib/hyrax/specs/shared_specs/identifiers.rb
3203
3241
  - lib/hyrax/specs/shared_specs/indexers.rb
@@ -3298,77 +3336,6 @@ files:
3298
3336
  - lib/wings/valkyrizable.rb
3299
3337
  - package.json
3300
3338
  - samvera-fall-TM3.svg
3301
- - spec/factories/access_control.rb
3302
- - spec/factories/admin_sets.rb
3303
- - spec/factories/admin_sets_lw.rb
3304
- - spec/factories/administrative_sets.rb
3305
- - spec/factories/api_items.rb
3306
- - spec/factories/collection_branding_infos.rb
3307
- - spec/factories/collection_type_participants.rb
3308
- - spec/factories/collection_types.rb
3309
- - spec/factories/collections.rb
3310
- - spec/factories/collections_factory.rb
3311
- - spec/factories/content_blocks.rb
3312
- - spec/factories/counter_metrics.rb
3313
- - spec/factories/featured_works.rb
3314
- - spec/factories/file_sets.rb
3315
- - spec/factories/generic_works.rb
3316
- - spec/factories/hyrax_collection.rb
3317
- - spec/factories/hyrax_default_admin_set.rb
3318
- - spec/factories/hyrax_embargo.rb
3319
- - spec/factories/hyrax_file_metadata.rb
3320
- - spec/factories/hyrax_file_set.rb
3321
- - spec/factories/hyrax_lease.rb
3322
- - spec/factories/hyrax_resource.rb
3323
- - spec/factories/hyrax_work.rb
3324
- - spec/factories/object_id.rb
3325
- - spec/factories/operations.rb
3326
- - spec/factories/permission.rb
3327
- - spec/factories/permission_template_accesses.rb
3328
- - spec/factories/permission_templates.rb
3329
- - spec/factories/proxy_deposit_requests.rb
3330
- - spec/factories/single_use_links.rb
3331
- - spec/factories/sipity_entities.rb
3332
- - spec/factories/uploaded_files.rb
3333
- - spec/factories/users.rb
3334
- - spec/factories/workflow_actions.rb
3335
- - spec/factories/workflow_states.rb
3336
- - spec/factories/workflows.rb
3337
- - spec/support/book_resource.rb
3338
- - spec/support/can_can_overrides.rb
3339
- - spec/support/clean_solr.rb
3340
- - spec/support/controller_level_helpers.rb
3341
- - spec/support/factory_helpers.rb
3342
- - spec/support/fakes/fake_actor.rb
3343
- - spec/support/fakes/fake_authority.rb
3344
- - spec/support/fakes/fake_search_builder_scope.rb
3345
- - spec/support/fakes/indexing_adapter.rb
3346
- - spec/support/fakes/test_hydra_group_service.rb
3347
- - spec/support/features.rb
3348
- - spec/support/features/batch_edit_actions.rb
3349
- - spec/support/features/session_helpers.rb
3350
- - spec/support/features/workflow.rb
3351
- - spec/support/form_with_validations.rb
3352
- - spec/support/input_support.rb
3353
- - spec/support/logging_formatter.rb
3354
- - spec/support/matchers/api_responses.rb
3355
- - spec/support/matchers/collection_type_property_matchers.rb
3356
- - spec/support/matchers/embargo.rb
3357
- - spec/support/matchers/lease.rb
3358
- - spec/support/matchers/match_valkyrie_ids_with_af_ids.rb
3359
- - spec/support/matchers/pcdm_matchers.rb
3360
- - spec/support/matchers/permission.rb
3361
- - spec/support/matchers/response_matchers.rb
3362
- - spec/support/optional_example.rb
3363
- - spec/support/rake.rb
3364
- - spec/support/selectors.rb
3365
- - spec/support/shared_examples_for_collection_presenter.rb
3366
- - spec/support/simple_work.rb
3367
- - spec/support/spec_statistic.rb
3368
- - spec/support/speedup.rb
3369
- - spec/support/statistic_helper.rb
3370
- - spec/support/valkyrie_indexing.rb
3371
- - spec/support/wings_models.rb
3372
3339
  - tasks/benchmark.rake
3373
3340
  - tasks/hyrax_dev.rake
3374
3341
  - template.rb
@@ -3415,7 +3382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3415
3382
  - !ruby/object:Gem::Version
3416
3383
  version: '0'
3417
3384
  requirements: []
3418
- rubygems_version: 3.5.5
3385
+ rubygems_version: 3.5.7
3419
3386
  signing_key:
3420
3387
  specification_version: 4
3421
3388
  summary: Hyrax is a front-end based on the robust Samvera framework, providing a user
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
- module Hyrax
3
- module Test
4
- ##
5
- # A simple Hyrax::Resource with some metadata.
6
- #
7
- # Use this for testing valkyrie models generically, with Hyrax assumptions
8
- # but no PCDM modelling behavior.
9
- class BookResource < Hyrax::Resource
10
- attribute :author, Valkyrie::Types::String
11
- attribute :created, Valkyrie::Types::Date
12
- attribute :isbn, Valkyrie::Types::String
13
- attribute :publisher, Valkyrie::Types::String
14
- attribute :title, Valkyrie::Types::String
15
- end
16
-
17
- ##
18
- # A simple Hyrax::ChangeSet with one custom validation.
19
- #
20
- # Hyrax::Test::BookResource will use this based on naming convention by adding `ChangeSet`
21
- # to the end of the resource class name.
22
- class BookResourceChangeSet < Hyrax::ChangeSet
23
- validates :isbn, presence: true
24
- end
25
-
26
- class Book < ActiveFedora::Base
27
- property :author, predicate: ::RDF::URI('http://example.com/ns/author')
28
- property :created, predicate: ::RDF::URI('http://example.com/ns/created')
29
- property :isbn, predicate: ::RDF::URI('http://example.com/ns/isbn')
30
- property :publisher, predicate: ::RDF::URI('http://example.com/ns/publisher')
31
- property :title, predicate: ::RDF::URI("http://example.com/ns/title")
32
- end
33
- end
34
- end
35
-
36
- Wings::ModelRegistry.register(Hyrax::Test::BookResource, Hyrax::Test::Book) if defined?(Wings)
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
- ##
3
- # This monkey-patch shim is for both active_fedora and valkyrie resources for tests
4
- # This shim handles the case where controllers are loaded with an ActiveFedora collection class
5
- # different than a test mocks Hyrax.config.collection_class.
6
- # This override checks the value in Hyrax.config and uses it when it is a known collection or admin set class.
7
- # This override also memoizes the resource_class to avoid multiple lookups.
8
- CanCan::ControllerResource.class_eval do
9
- def resource_class
10
- return @resource_class if @resource_class.present?
11
- @resource_class = case @options[:class]
12
- when false then
13
- name.to_sym
14
- when nil then
15
- namespaced_name.to_s.camelize.constantize
16
- when String then
17
- @options[:class].constantize
18
- else
19
- @options[:class]
20
- end
21
- @resource_class = dynamically_resolve_class(@resource_class)
22
- end
23
-
24
- private
25
-
26
- def dynamically_resolve_class(resource_class)
27
- if collection_class?(resource_class)
28
- Hyrax.config.collection_class
29
- elsif admin_set_class?(resource_class)
30
- Hyrax.config.admin_set_class
31
- else
32
- resource_class
33
- end
34
- end
35
-
36
- def collection_class?(model_class)
37
- model_class == Hyrax::PcdmCollection || model_class < Hyrax::PcdmCollection || model_class == ::Collection || model_class < ::Collection
38
- end
39
-
40
- def admin_set_class?(model_class)
41
- model_class == Hyrax::AdministrativeSet || model_class < Hyrax::AdministrativeSet || model_class == AdminSet || model_class < AdminSet
42
- end
43
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
- RSpec.configure do |config|
3
- config.before(:each, clean_index: true) do
4
- client = Valkyrie::IndexingAdapter.find(:solr_index).connection
5
- client.delete_by_query("*:*", params: { softCommit: true })
6
- end
7
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ControllerLevelHelpers
4
- # This provides some common mock methods for view tests.
5
- # These are normally provided by the controller.
6
- module ControllerViewHelpers
7
- def search_state
8
- @search_state ||= CatalogController.search_state_class.new(params, blacklight_config, controller)
9
- end
10
-
11
- # This allows you to set the configuration
12
- # @example: view.blacklight_config = Blacklight::Configuration.new
13
- attr_writer :blacklight_config
14
-
15
- def blacklight_config
16
- @blacklight_config ||= CatalogController.blacklight_config
17
- end
18
-
19
- def blacklight_configuration_context
20
- @blacklight_configuration_context ||= Blacklight::Configuration::Context.new(controller)
21
- end
22
- end
23
-
24
- def initialize_controller_helpers(helper)
25
- helper.extend ControllerViewHelpers
26
- end
27
- end
@@ -1,94 +0,0 @@
1
- # frozen_string_literal: true
2
- module Hyrax
3
- module FactoryHelpers
4
- module_function
5
-
6
- FIELDS = { mime_type: 'text/plain',
7
- content: 'content',
8
- file_size: [],
9
- format_label: [],
10
- height: [],
11
- width: [],
12
- filename: [],
13
- well_formed: [],
14
- page_count: [],
15
- file_title: [],
16
- last_modified: [],
17
- original_checksum: [],
18
- alpha_channels: [],
19
- digest: [],
20
- duration: [],
21
- sample_rate: [],
22
- versions: [] }.freeze
23
-
24
- def mock_file_factory(opts = {})
25
- fields = FIELDS.each_with_object({}) do |(name, default), hsh|
26
- hsh[name] = opts.fetch(name, default)
27
- end
28
-
29
- mock_model('MockOriginal', fields)
30
- end
31
-
32
- # as defined in Hyrax::FileMetadata
33
- HYRAX_FILE_METADATA_FIELDS = { file_identifier: '',
34
- alternate_ids: [],
35
- file_set_id: '',
36
- label: [''],
37
- original_filename: '',
38
- mime_type: 'text/plain',
39
- type: [],
40
- format_label: [],
41
- size: [],
42
- well_formed: [],
43
- valid: [],
44
- date_created: [],
45
- fits_version: [],
46
- exif_version: [],
47
- checksum: [],
48
- frame_rate: [],
49
- bit_rate: [],
50
- duration: [],
51
- sample_rate: [],
52
- height: [],
53
- width: [],
54
- bit_depth: [],
55
- channels: [],
56
- data_format: [],
57
- offset: [],
58
- file_title: [],
59
- creator: [],
60
- page_count: [],
61
- language: [],
62
- word_count: [],
63
- character_count: [],
64
- line_count: [],
65
- character_set: [],
66
- markup_basis: [],
67
- markup_language: [],
68
- paragraph_count: [],
69
- table_count: [],
70
- graphics_count: [],
71
- byte_order: [],
72
- compression: [],
73
- color_space: [],
74
- profile_name: [],
75
- profile_version: [],
76
- orientation: [],
77
- color_map: [],
78
- image_producer: [],
79
- capture_device: [],
80
- scanning_software: [],
81
- gps_timestamp: [],
82
- latitude: [],
83
- longitude: [],
84
- aspect_ratio: [] }.freeze
85
-
86
- def mock_file_metadata_factory(opts = {})
87
- fields = HYRAX_FILE_METADATA_FIELDS.each_with_object({}) do |(name, default), hsh|
88
- hsh[name] = opts.fetch(name, default)
89
- end
90
-
91
- mock_model('MockFileMetadata', fields)
92
- end
93
- end
94
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
- class FakeActor < Hyrax::Actors::AbstractActor
3
- attr_accessor :created, :destroyed, :updated
4
-
5
- def create(env)
6
- self.created = env
7
-
8
- true
9
- end
10
-
11
- def destroy(env)
12
- self.destroyed = env
13
-
14
- true
15
- end
16
-
17
- def update(env)
18
- self.updated = env
19
-
20
- true
21
- end
22
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
- class FakeAuthority
3
- def initialize(map)
4
- @map = map
5
- end
6
-
7
- def all
8
- @map
9
- end
10
-
11
- def find(id)
12
- @map.detect { |item| item[:id] == id }
13
- end
14
- end