hyrax 4.0.0.rc3 → 5.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +116 -231
  3. data/.dassie/.env +3 -1
  4. data/.dassie/Gemfile +0 -2
  5. data/.dassie/config/analytics.yml +2 -2
  6. data/.dassie/config/environments/test.rb +1 -0
  7. data/.dassie/config/initializers/hyrax.rb +3 -1
  8. data/.dassie/config/initializers/redis_config.rb +0 -1
  9. data/.dassie/config/initializers/riiif.rb +13 -3
  10. data/.dassie/db/schema.rb +2 -2
  11. data/.dockerignore +6 -0
  12. data/.github/ISSUE_TEMPLATE.md +14 -9
  13. data/.github/PULL_REQUEST_TEMPLATE.md +25 -6
  14. data/.github/release.yml +5 -2
  15. data/.koppie/.env +3 -0
  16. data/.koppie/Gemfile +0 -2
  17. data/.koppie/README.md +11 -11
  18. data/.koppie/app/forms/collection_resource_form.rb +1 -0
  19. data/.koppie/app/indexers/collection_resource_indexer.rb +1 -0
  20. data/.koppie/app/models/collection_resource.rb +1 -0
  21. data/.koppie/config/analytics.yml +1 -0
  22. data/.koppie/config/environments/test.rb +1 -0
  23. data/.koppie/config/initializers/hyrax.rb +8 -2
  24. data/.koppie/config/initializers/redis_config.rb +0 -1
  25. data/.koppie/config/initializers/riiif.rb +13 -4
  26. data/.koppie/config/metadata/collection_resource.yaml +1 -128
  27. data/.koppie/yarn.lock +23 -23
  28. data/.regen +1 -1
  29. data/CONTAINERS.md +15 -15
  30. data/Dockerfile +6 -11
  31. data/app/actors/hyrax/actors/base_actor.rb +4 -3
  32. data/app/actors/hyrax/actors/embargo_actor.rb +5 -2
  33. data/app/actors/hyrax/actors/lease_actor.rb +5 -2
  34. data/app/assets/javascripts/hyrax/file_manager/sorting.es6 +3 -2
  35. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +1 -1
  36. data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +74 -0
  37. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +14 -5
  38. data/app/controllers/hyrax/admin/workflows_controller.rb +48 -3
  39. data/app/controllers/hyrax/batch_edits_controller.rb +33 -4
  40. data/app/controllers/hyrax/downloads_controller.rb +8 -1
  41. data/app/controllers/hyrax/file_sets_controller.rb +1 -0
  42. data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
  43. data/app/forms/hyrax/forms/permission_template_form.rb +2 -0
  44. data/app/forms/hyrax/forms/resource_batch_edit_form.rb +90 -0
  45. data/app/forms/hyrax/forms/work_embargo_form.rb +1 -0
  46. data/app/forms/hyrax/forms/work_form.rb +1 -1
  47. data/app/forms/hyrax/forms/work_lease_form.rb +1 -0
  48. data/app/helpers/hyrax/dashboard_helper_behavior.rb +17 -9
  49. data/app/helpers/hyrax/membership_helper.rb +13 -1
  50. data/app/helpers/hyrax/work_form_helper.rb +0 -107
  51. data/app/indexers/hyrax/file_set_indexer.rb +6 -0
  52. data/app/indexers/hyrax/pcdm_collection_indexer.rb +8 -0
  53. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +41 -5
  54. data/app/indexers/hyrax/valkyrie_work_indexer.rb +8 -2
  55. data/app/jobs/valkyrie_create_derivatives_job.rb +8 -7
  56. data/app/jobs/valkyrie_ingest_job.rb +0 -1
  57. data/app/models/admin_set.rb +1 -31
  58. data/app/models/concerns/hyrax/file_set/derivatives.rb +3 -2
  59. data/app/models/concerns/hyrax/solr_document_behavior.rb +1 -1
  60. data/app/models/hyrax/collection_type.rb +5 -14
  61. data/app/models/hyrax/file_metadata.rb +6 -7
  62. data/app/models/hyrax/file_set.rb +8 -0
  63. data/app/models/hyrax/resource.rb +30 -2
  64. data/app/presenters/hyrax/file_set_presenter.rb +6 -0
  65. data/app/presenters/hyrax/iiif_manifest_presenter.rb +3 -7
  66. data/app/presenters/hyrax/presenter_renderer.rb +0 -7
  67. data/app/presenters/hyrax/work_show_presenter.rb +6 -11
  68. data/app/search_builders/hyrax/file_set_search_builder.rb +1 -1
  69. data/app/search_builders/hyrax/valkyrie_abstract_type_relation.rb +37 -0
  70. data/app/search_builders/hyrax/valkyrie_work_relation.rb +9 -0
  71. data/app/services/hyrax/analytics/google.rb +23 -15
  72. data/app/services/hyrax/analytics/matomo.rb +4 -3
  73. data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +11 -9
  74. data/app/services/hyrax/custom_queries/find_by_date_range.rb +55 -0
  75. data/app/services/hyrax/custom_queries/find_count_by.rb +62 -0
  76. data/app/services/hyrax/custom_queries/find_file_metadata.rb +1 -1
  77. data/app/services/hyrax/custom_queries/find_models_by_access.rb +59 -0
  78. data/app/services/hyrax/derivative_bucketed_storage.rb +25 -0
  79. data/app/services/hyrax/derivative_path.rb +14 -4
  80. data/app/services/hyrax/embargo_manager.rb +76 -10
  81. data/app/services/hyrax/file_set_derivatives_service.rb +3 -2
  82. data/app/services/hyrax/lease_manager.rb +88 -8
  83. data/app/services/hyrax/listeners/file_metadata_listener.rb +2 -2
  84. data/app/services/hyrax/listeners/workflow_listener.rb +8 -11
  85. data/app/services/hyrax/persist_directly_contained_output_file_service.rb +24 -2
  86. data/app/services/hyrax/solr_query_service.rb +7 -6
  87. data/app/services/hyrax/statistics/depositors/summary.rb +1 -1
  88. data/app/services/hyrax/statistics/over_time.rb +1 -1
  89. data/app/services/hyrax/statistics/users/over_time.rb +3 -1
  90. data/app/services/hyrax/statistics/valkyrie_query_service.rb +49 -0
  91. data/app/services/hyrax/statistics/works/count.rb +1 -1
  92. data/app/services/hyrax/thumbnail_path_service.rb +5 -0
  93. data/app/services/hyrax/valkyrie_persist_derivatives.rb +16 -11
  94. data/app/services/hyrax/valkyrie_upload.rb +5 -3
  95. data/app/services/hyrax/versioning_service.rb +1 -0
  96. data/app/services/hyrax/visibility_intention.rb +1 -4
  97. data/app/services/hyrax/visibility_propagator.rb +1 -1
  98. data/app/services/hyrax/workflow/actionable_objects.rb +28 -3
  99. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +1 -1
  100. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +1 -1
  101. data/app/services/hyrax/workflow/permission_query.rb +23 -2
  102. data/app/views/hyrax/admin/workflows/_tabs.html.erb +9 -0
  103. data/app/views/hyrax/admin/workflows/index.html.erb +53 -76
  104. data/app/views/hyrax/base/_file_manager_members.html.erb +2 -2
  105. data/app/views/hyrax/base/_form.html.erb +0 -10
  106. data/app/views/hyrax/base/_form_files.html.erb +7 -2
  107. data/app/views/hyrax/base/_form_permission_embargo.html.erb +1 -1
  108. data/app/views/hyrax/base/_form_permission_lease.html.erb +1 -1
  109. data/app/views/hyrax/base/_form_visibility_component.html.erb +2 -2
  110. data/app/views/hyrax/base/_items.html.erb +1 -1
  111. data/app/views/hyrax/base/file_manager.html.erb +1 -1
  112. data/app/views/hyrax/base/show.json.jbuilder +2 -2
  113. data/app/views/hyrax/file_sets/_versioning.html.erb +1 -1
  114. data/app/views/hyrax/file_sets/show.html.erb +5 -3
  115. data/app/views/hyrax/homepage/_explore_collections.html.erb +1 -1
  116. data/chart/hyrax/Chart.yaml +18 -14
  117. data/chart/hyrax/README.md +34 -21
  118. data/chart/hyrax/templates/_helpers.tpl +26 -1
  119. data/chart/hyrax/templates/configmap-env.yaml +12 -2
  120. data/chart/hyrax/templates/secrets.yaml +1 -1
  121. data/chart/hyrax/values.yaml +36 -14
  122. data/config/initializers/listeners.rb +4 -10
  123. data/config/initializers/storage_adapter_initializer.rb +1 -1
  124. data/config/locales/hyrax.de.yml +11 -3
  125. data/config/locales/hyrax.en.yml +13 -2
  126. data/config/locales/hyrax.es.yml +4 -1
  127. data/config/locales/hyrax.fr.yml +4 -1
  128. data/config/locales/hyrax.it.yml +5 -2
  129. data/config/locales/hyrax.pt-BR.yml +9 -2
  130. data/config/locales/hyrax.zh.yml +4 -1
  131. data/config/metadata/file_set_metadata.yaml +1 -1
  132. data/docker-compose-koppie.yml +17 -4
  133. data/docker-compose.yml +19 -6
  134. data/documentation/developing-your-hyrax-based-app.md +6 -14
  135. data/documentation/legacyREADME.md +7 -5
  136. data/hyrax.gemspec +2 -2
  137. data/karma.conf.js +8 -9
  138. data/lib/generators/hyrax/templates/config/analytics.yml +1 -0
  139. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +1 -1
  140. data/lib/generators/hyrax/templates/config/initializers/redis_config.rb +0 -1
  141. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +15 -5
  142. data/lib/hyrax/active_fedora_dummy_model.rb +6 -1
  143. data/lib/hyrax/configuration.rb +6 -0
  144. data/lib/hyrax/engine.rb +2 -0
  145. data/lib/hyrax/publisher.rb +19 -3
  146. data/lib/hyrax/specs/capybara.rb +9 -4
  147. data/lib/hyrax/transactions/container.rb +5 -0
  148. data/lib/hyrax/transactions/steps/add_file_sets.rb +6 -0
  149. data/lib/hyrax/transactions/steps/apply_permission_template.rb +40 -0
  150. data/lib/hyrax/transactions/steps/save.rb +21 -0
  151. data/lib/hyrax/transactions/work_create.rb +1 -0
  152. data/lib/hyrax/version.rb +1 -1
  153. data/lib/hyrax.rb +1 -0
  154. data/lib/wings/active_fedora_converter/default_work.rb +7 -2
  155. data/lib/wings/active_fedora_converter/file_metadata_node.rb +1 -1
  156. data/lib/wings/active_fedora_converter.rb +47 -11
  157. data/lib/wings/model_transformer.rb +23 -4
  158. data/lib/wings/setup.rb +21 -1
  159. data/lib/wings/valkyrie/persister.rb +4 -2
  160. data/package.json +3 -1
  161. data/template.rb +1 -1
  162. metadata +15 -10
  163. data/app/forms/hyrax/forms/file_manager_form.rb +0 -35
  164. data/app/services/hyrax/collections/migration_service.rb +0 -113
  165. data/app/views/hyrax/base/_form_collections_error.html.erb +0 -1
  166. data/app/views/hyrax/base/_form_in_works_error.html.erb +0 -3
  167. data/app/views/hyrax/base/_form_ordered_members_error.html.erb +0 -3
  168. data/app/views/hyrax/base/_form_visibility_error.html.erb +0 -19
data/.koppie/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # Koppie
2
2
 
3
- > Isolated granite outcrops in Southern Africa that are a favored habitat for hyraxes.
3
+ > Isolated granite outcrops in Southern Africa that are a favored habitat for hyraxes.
4
4
 
5
5
  Koppie is an application used for testing the state of [Hyrax](https://github.com/samvera/hyrax)
6
- using Postgres as the metadata store for objects. This is similar to the Dassie test application
6
+ using Postgres as the metadata store for objects. This is similar to the Dassie test application
7
7
  that lives in `.dassie`, however in this application Fedora is
8
- not used for storing object metadata or files. The Hyrax gem is sourced from the local hyrax
8
+ not used for storing object metadata or files. The Hyrax gem is sourced from the local hyrax
9
9
  directory one level up from `.koppie` for development purposes.
10
10
 
11
11
  ## Known Issues
12
12
 
13
13
  Collection model
14
14
  * `/app/models/collection.rb` - is_a `ActiveFedora::Base`
15
- * if `Collection` is changed to `Valkyrie::Resource`, there is an infinite loop while loading
15
+ * if `Collection` is changed to `Valkyrie::Resource`, there is an infinite loop while loading
16
16
  due to reference to ::Collection in `lib/hyrax/collection_name.rb` in the hyrax engine
17
17
 
18
18
  Default Admin Set
@@ -21,14 +21,14 @@ Default Admin Set
21
21
 
22
22
  ## Questions
23
23
 
24
- Please direct questions about this code or the servers where it runs to the `#hyrax-valkyrie`
24
+ Please direct questions about this code or the servers where it runs to the `#hyrax-valkyrie`
25
25
  channel on Samvera slack.
26
26
 
27
27
  ## Contributing
28
28
 
29
29
  If you're working on a PR for this project, create a feature branch off of `main`.
30
30
 
31
- This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct)
31
+ This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct)
32
32
  and [language recommendations](https://github.com/samvera/maintenance/blob/master/templates/CONTRIBUTING.md#language).
33
33
  Please ***do not*** create a branch called `master` for this repository or as part of your pull request; the branch will
34
34
  either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository.
@@ -46,10 +46,10 @@ git clone https://github.com/samvera/hyrax.git
46
46
  Execute the following commands from the hyrax root to start the app using Docker.
47
47
 
48
48
  ```
49
- docker-compose -f docker-compose-koppie.yml build
50
- docker-compose -f docker-compose-koppie.yml up
49
+ docker compose -f docker-compose-koppie.yml build
50
+ docker compose -f docker-compose-koppie.yml up
51
51
  ```
52
52
 
53
- You can find help with additional commands in Hyrax' [FAQ-for-Dassie-Docker-Test-App](https://github.com/samvera/hyrax/wiki/FAQ-for-Dassie-Docker-Test-App).
54
- Most commands can be used directly as described in the FAQ. A few might require
55
- a slight adjustment to work with koppie as a Docker app.
53
+ You can find help with additional commands in Hyrax' [FAQ-for-Dassie-Docker-Test-App](https://github.com/samvera/hyrax/wiki/FAQ-for-Dassie-Docker-Test-App).
54
+ Most commands can be used directly as described in the FAQ. A few might require
55
+ a slight adjustment to work with koppie as a Docker app.
@@ -3,5 +3,6 @@
3
3
  # Generated via
4
4
  # `rails generate hyrax:collection_resource CollectionResource`
5
5
  class CollectionResourceForm < Hyrax::Forms::PcdmCollectionForm
6
+ include Hyrax::FormFields(:basic_metadata)
6
7
  include Hyrax::FormFields(:collection_resource)
7
8
  end
@@ -3,5 +3,6 @@
3
3
  # Generated via
4
4
  # `rails generate hyrax:collection_resource CollectionResource`
5
5
  class CollectionResourceIndexer < Hyrax::PcdmCollectionIndexer
6
+ include Hyrax::Indexer(:basic_metadata)
6
7
  include Hyrax::Indexer(:collection_resource)
7
8
  end
@@ -27,5 +27,6 @@ class CollectionResource < Hyrax::PcdmCollection
27
27
  # * add Valkyrie attributes to this class
28
28
  # * update form and indexer to process the attributes
29
29
  #
30
+ include Hyrax::Schema(:basic_metadata)
30
31
  include Hyrax::Schema(:collection_resource)
31
32
  end
@@ -3,6 +3,7 @@ analytics:
3
3
  analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
4
4
  app_name: <%= ENV.fetch('GOOGLE_OAUTH_APP_NAME', 'nurax-pg') %>
5
5
  app_version: <%= ENV.fetch['GOOGLE_OAUTH_APP_VERSION'] %>
6
+ privkey_value: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'] %>
6
7
  privkey_path: <%= ENV.fetch['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
7
8
  privkey_secret: <%= ENV.fetch['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
8
9
  client_email: <%= ENV.fetch['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
@@ -1,5 +1,6 @@
1
1
  Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
+ config.assets.debug = true
3
4
 
4
5
  # The test environment is used exclusively to run your application's
5
6
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,6 +7,8 @@ Hyrax.config do |config|
7
7
 
8
8
  config.disable_wings = true # not needed if ENV includes HYRAX_SKIP_WINGS=true
9
9
 
10
+ config.characterization_options = { ch12n_tool: ENV.fetch('CH12N_TOOL', 'fits').to_sym }
11
+
10
12
  # Register roles that are expected by your implementation.
11
13
  # @see Hyrax::RoleRegistry for additional details.
12
14
  # @note there are magical roles as defined in Hyrax::RoleRegistry::MAGIC_ROLES
@@ -104,7 +106,7 @@ Hyrax.config do |config|
104
106
 
105
107
  # Location autocomplete uses geonames to search for named regions
106
108
  # Username for connecting to geonames
107
- # config.geonames_username = ''
109
+ config.geonames_username = ENV['GEONAMES_USERNAME'] || ''
108
110
 
109
111
  # Should the acceptance of the licence agreement be active (checkbox), or
110
112
  # implied when the save button is pressed? Set to true for active
@@ -320,12 +322,16 @@ custom_queries = [Hyrax::CustomQueries::Navigators::CollectionMembers,
320
322
  Hyrax::CustomQueries::Navigators::ParentCollectionsNavigator,
321
323
  Hyrax::CustomQueries::Navigators::ChildFileSetsNavigator,
322
324
  Hyrax::CustomQueries::Navigators::ChildWorksNavigator,
325
+ Hyrax::CustomQueries::Navigators::ParentWorkNavigator,
323
326
  Hyrax::CustomQueries::Navigators::FindFiles,
324
327
  Hyrax::CustomQueries::FindAccessControl,
325
328
  Hyrax::CustomQueries::FindCollectionsByType,
326
329
  Hyrax::CustomQueries::FindFileMetadata,
327
330
  Hyrax::CustomQueries::FindIdsByModel,
328
- Hyrax::CustomQueries::FindManyByAlternateIds]
331
+ Hyrax::CustomQueries::FindManyByAlternateIds,
332
+ Hyrax::CustomQueries::FindModelsByAccess,
333
+ Hyrax::CustomQueries::FindCountBy,
334
+ Hyrax::CustomQueries::FindByDateRange]
329
335
  custom_queries.each do |handler|
330
336
  Hyrax.query_service.custom_queries.register_query_handler(handler)
331
337
  end
@@ -2,7 +2,6 @@
2
2
  require 'redis'
3
3
  require 'connection_pool'
4
4
  config = YAML.safe_load(ERB.new(IO.read(Rails.root.join('config', 'redis.yml'))).result)[Rails.env].with_indifferent_access
5
- config[:thread_safe] = true
6
5
 
7
6
  size = ENV.fetch("HYRAX_REDIS_POOL_SIZE", 5)
8
7
  timeout = ENV.fetch("HYRAX_REDIS_TIMEOUT", 5)
@@ -14,12 +14,21 @@ ActiveSupport::Reloader.to_prepare do
14
14
  { height: doc['height_is'], width: doc['width_is'], format: doc['mime_type_ssi'], channels: doc['alpha_channels_ssi'] }
15
15
  end
16
16
 
17
- Riiif::Image.file_resolver.id_to_uri = lambda do |id|
18
- Hyrax::Base.id_to_uri(CGI.unescape(id)).tap do |url|
19
- Rails.logger.info "Riiif resolved #{id} to #{url}"
17
+ if Hyrax.config.use_valkyrie?
18
+ # Use Valkyrie adapter to make sure file is available locally. Riiif will just open it then
19
+ # id comes in with the format "FILE_SET_ID/files/FILE_ID"
20
+ Riiif::Image.file_resolver.id_to_uri = lambda do |id|
21
+ file_metadata = Hyrax.query_service.find_by(id: id.split('/').last)
22
+ file = Hyrax.storage_adapter.find_by(id: file_metadata.file_identifier)
23
+ file.disk_path.to_s
24
+ end
25
+ else
26
+ Riiif::Image.file_resolver.id_to_uri = lambda do |id|
27
+ Hyrax::Base.id_to_uri(CGI.unescape(id)).tap do |url|
28
+ Rails.logger.info "Riiif resolved #{id} to #{url}"
29
+ end
20
30
  end
21
31
  end
22
-
23
32
  Riiif::Image.authorization_service = Hyrax::IiifAuthorizationService
24
33
 
25
34
  Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
@@ -19,131 +19,4 @@
19
19
  # Generated via
20
20
  # `rails generate hyrax:collection_resource CollectionResource`
21
21
 
22
- attributes:
23
- description:
24
- type: string
25
- multiple: true
26
- form:
27
- primary: true
28
- index_keys:
29
- - "description_tesim"
30
- creator:
31
- type: string
32
- multiple: true
33
- form:
34
- required: false
35
- primary: false
36
- index_keys:
37
- - "creator_tesim"
38
- rights_statement:
39
- type: string
40
- multiple: true
41
- form:
42
- primary: false
43
- abstract:
44
- type: string
45
- multiple: true
46
- form:
47
- primary: false
48
- access_right:
49
- type: string
50
- multiple: true
51
- form:
52
- primary: false
53
- alternative_title:
54
- type: string
55
- multiple: true
56
- form:
57
- primary: false
58
- based_near:
59
- type: string
60
- multiple: true
61
- form:
62
- primary: false
63
- index_keys:
64
- - "based_near_sim"
65
- - "based_near_tesim"
66
- bibliographic_citation:
67
- type: string
68
- multiple: true
69
- contributor:
70
- type: string
71
- multiple: true
72
- form:
73
- primary: false
74
- date_created:
75
- type: date_time
76
- multiple: true
77
- form:
78
- primary: false
79
- index_keys:
80
- - "date_created_tesim"
81
- identifier:
82
- type: string
83
- multiple: true
84
- form:
85
- primary: false
86
- import_url:
87
- type: string
88
- keyword:
89
- type: string
90
- multiple: true
91
- index_keys:
92
- - "keyword_sim"
93
- - "keyword_tesim"
94
- form:
95
- primary: false
96
- publisher:
97
- type: string
98
- multiple: true
99
- form:
100
- primary: false
101
- label:
102
- type: string
103
- form:
104
- primary: false
105
- language:
106
- type: string
107
- multiple: true
108
- form:
109
- primary: false
110
- license:
111
- type: string
112
- multiple: true
113
- form:
114
- primary: false
115
- relative_path:
116
- type: string
117
- related_url:
118
- type: string
119
- multiple: true
120
- form:
121
- primary: false
122
- index_keys:
123
- - "related_url_tesim"
124
- resource_type:
125
- type: string
126
- multiple: true
127
- form:
128
- primary: false
129
- index_keys:
130
- - "resource_type_sim"
131
- - "resource_type_tesim"
132
- rights_notes:
133
- type: string
134
- multiple: true
135
- form:
136
- primary: false
137
- source:
138
- type: string
139
- multiple: true
140
- form:
141
- primary: false
142
- subject:
143
- type: string
144
- multiple: true
145
- index_keys:
146
- - "subject_sim"
147
- - "subject_tesim"
148
- form:
149
- primary: false
22
+ attributes: {}
data/.koppie/yarn.lock CHANGED
@@ -706,7 +706,7 @@ iconv-lite@^0.6.2:
706
706
  immediate@~3.0.5:
707
707
  version "3.0.6"
708
708
  resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
709
- integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=
709
+ integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
710
710
 
711
711
  imsc@^1.0.1-rc.1:
712
712
  version "1.1.2"
@@ -757,7 +757,7 @@ is-typedarray@~1.0.0:
757
757
  isarray@~1.0.0:
758
758
  version "1.0.0"
759
759
  resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
760
- integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
760
+ integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==
761
761
 
762
762
  isexe@^2.0.0:
763
763
  version "2.0.0"
@@ -818,9 +818,9 @@ json-stringify-safe@~5.0.1:
818
818
  integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
819
819
 
820
820
  json5@^1.0.1:
821
- version "1.0.1"
822
- resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
823
- integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
821
+ version "1.0.2"
822
+ resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
823
+ integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==
824
824
  dependencies:
825
825
  minimist "^1.2.0"
826
826
 
@@ -840,14 +840,14 @@ jsviews@0.9.83:
840
840
  integrity sha1-BpsFEigz0jFVzDziwtn7LPeJqYo=
841
841
 
842
842
  jszip@*, jszip@^3.1.5, jszip@^3.2.2:
843
- version "3.7.1"
844
- resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.7.1.tgz#bd63401221c15625a1228c556ca8a68da6fda3d9"
845
- integrity sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==
843
+ version "3.10.1"
844
+ resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2"
845
+ integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==
846
846
  dependencies:
847
847
  lie "~3.3.0"
848
848
  pako "~1.0.2"
849
849
  readable-stream "~2.3.6"
850
- set-immediate-shim "~1.0.1"
850
+ setimmediate "^1.0.5"
851
851
 
852
852
  lie@3.1.1:
853
853
  version "3.1.1"
@@ -864,9 +864,9 @@ lie@~3.3.0:
864
864
  immediate "~3.0.5"
865
865
 
866
866
  loader-utils@^1.0.0:
867
- version "1.4.0"
868
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
869
- integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==
867
+ version "1.4.2"
868
+ resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3"
869
+ integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==
870
870
  dependencies:
871
871
  big.js "^5.2.2"
872
872
  emojis-list "^3.0.0"
@@ -953,9 +953,9 @@ minimist@1.2.0:
953
953
  integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=
954
954
 
955
955
  minimist@^1.2.0:
956
- version "1.2.5"
957
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
958
- integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
956
+ version "1.2.7"
957
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
958
+ integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
959
959
 
960
960
  mute-stream@0.0.7:
961
961
  version "0.0.7"
@@ -1100,9 +1100,9 @@ punycode@^2.1.0, punycode@^2.1.1:
1100
1100
  integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
1101
1101
 
1102
1102
  qs@~6.5.2:
1103
- version "6.5.2"
1104
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
1105
- integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
1103
+ version "6.5.3"
1104
+ resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
1105
+ integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==
1106
1106
 
1107
1107
  readable-stream@^2.0.2, readable-stream@~2.3.6:
1108
1108
  version "2.3.7"
@@ -1209,10 +1209,10 @@ schema-utils@^0.4.0:
1209
1209
  ajv "^6.1.0"
1210
1210
  ajv-keywords "^3.1.0"
1211
1211
 
1212
- set-immediate-shim@~1.0.1:
1213
- version "1.0.1"
1214
- resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
1215
- integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=
1212
+ setimmediate@^1.0.5:
1213
+ version "1.0.5"
1214
+ resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
1215
+ integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==
1216
1216
 
1217
1217
  shebang-command@^2.0.0:
1218
1218
  version "2.0.0"
@@ -1419,7 +1419,7 @@ url-toolkit@^2.1.2:
1419
1419
  util-deprecate@~1.0.1:
1420
1420
  version "1.0.2"
1421
1421
  resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
1422
- integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
1422
+ integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
1423
1423
 
1424
1424
  uuid@^3.3.2:
1425
1425
  version "3.4.0"
data/.regen CHANGED
@@ -1,2 +1,2 @@
1
1
  # When updating CI regen seed, set to current date.
2
- 2023-05-15T10:04:07
2
+ 2023-08-09T14:34:59
data/CONTAINERS.md CHANGED
@@ -13,7 +13,7 @@ There are two options for development environments to run:
13
13
  <!-- NOTE: This title is referenced in the top-level README.md. Keep that in mind if you change it. -->
14
14
  ## Hyrax Engine Development
15
15
 
16
- We support a `docker-compose`-based development environment for folks working on
16
+ We support a `docker compose`-based development environment for folks working on
17
17
  the Hyrax engine. This environment is substantially more like a Hyrax production
18
18
  setup than the older `fedora_wrapper`/`solr_wrapper` approach.
19
19
 
@@ -24,8 +24,8 @@ First, make sure you have installed [Docker](https://www.docker.com/). Then clo
24
24
  Within your cloned repository, tell Docker to get started installing your development environment:
25
25
 
26
26
  ```sh
27
- docker-compose build
28
- docker-compose up
27
+ docker compose build
28
+ docker compose up
29
29
  ```
30
30
 
31
31
  This starts containers for:
@@ -40,24 +40,24 @@ This starts containers for:
40
40
 
41
41
  It also runs database migrations. This will also bring up a development application on `http://localhost:3000`.
42
42
 
43
- To stop the containers for the Hyrax-based application, type <kbd>Ctrl</kbd>+<kbd>c</kbd>. To restart the containers you need only run `docker-compose up`.
43
+ To stop the containers for the Hyrax-based application, type <kbd>Ctrl</kbd>+<kbd>c</kbd>. To restart the containers you need only run `docker compose up`.
44
44
 
45
45
  _**Note:** Starting and stopping Docker in this way will preserve your data between restarts._
46
46
 
47
47
  #### Code Changes and Testing
48
48
 
49
- With `docker-compose up` running, any changes you make to your cloned Hyrax code-base should show up in `http://localhost:3000`; There may be cases where you need to restart your test application (e.g. stop the containers and start them up again).
49
+ With `docker compose up` running, any changes you make to your cloned Hyrax code-base should show up in `http://localhost:3000`; There may be cases where you need to restart your test application (e.g. stop the containers and start them up again).
50
50
 
51
51
  Any changes you make to Hyrax should be tested. You can run the full test suite using the following command:
52
52
 
53
53
  ```sh
54
- docker-compose exec -w /app/samvera/hyrax-engine app sh -c "bundle exec rspec"
54
+ docker compose exec -w /app/samvera/hyrax-engine app sh -c "bundle exec rspec"
55
55
  ```
56
56
 
57
57
  Let's break down the above command:
58
58
 
59
59
  <dl>
60
- <dt><code>docker-compose exec</code></dt>
60
+ <dt><code>docker compose exec</code></dt>
61
61
  <dd>Tell docker to run the following:</dd>
62
62
  <dt><code>-w /app/samvera/hyrax-engine</code></dt>
63
63
  <dd>In the working directory "/app/samvera/hyrax-engine" (e.g. your cloned Hyrax repository)</dd>
@@ -86,13 +86,13 @@ bind mount to `/app/samvera/hyrax-webapp`, and your local development copy of Hy
86
86
  What does this structure mean? Let's look at an example. The following command will list the rake tasks for the Hyrax-based application running in Docker:
87
87
 
88
88
  ```sh
89
- docker-compose exec -w /app/samvera/hyrax-webapp app sh -c "bundle exec rake -T"
89
+ docker compose exec -w /app/samvera/hyrax-webapp app sh -c "bundle exec rake -T"
90
90
  ```
91
91
 
92
92
  And this command lists the rake tasks for the Hyrax engine that is in Docker:
93
93
 
94
94
  ```sh
95
- docker-compose exec -w /app/samvera/hyrax-engine app sh -c "bundle exec rake -T"
95
+ docker compose exec -w /app/samvera/hyrax-engine app sh -c "bundle exec rake -T"
96
96
  ```
97
97
 
98
98
  In the two examples, note the difference in the `-w` switch. In the first case, it's referencing the Hyrax-based application. In the latter case, it's referencing the Hyrax engine.
@@ -101,7 +101,7 @@ In the two examples, note the difference in the `-w` switch. In the first case,
101
101
 
102
102
  If you are interested in running Hyrax in debug mode, this requires a somewhat different approach than running Hyrax bare-metal. You need to use `docker attach` to debug the running docker instance.
103
103
 
104
- 1. With `docker-compose up` running open a new Terminal session.
104
+ 1. With `docker compose up` running open a new Terminal session.
105
105
  2. In that new Terminal session, using `docker container ls` find the "CONTAINER ID" for the `hyrax-engine-dev`.
106
106
  3. With the "CONTAINER ID", run `docker attach <CONTAINER ID>`.
107
107
 
@@ -111,7 +111,7 @@ This advice comes from [Debugging Rails App With Docker Compose: How to use Byeb
111
111
 
112
112
  ##### Bad Address SOLR
113
113
 
114
- With `docker-compose up` running, if you see the following, then there may be issues with file permissions:
114
+ With `docker compose up` running, if you see the following, then there may be issues with file permissions:
115
115
 
116
116
  ```
117
117
  db_migrate_1 | waiting for solr:8983
@@ -125,15 +125,15 @@ Executing /opt/docker-solr/scripts/precreate-core hyrax_test /opt/solr/server/co
125
125
  cp: cannot create directory '/var/solr/data/hyrax_test': Permission denied
126
126
  ```
127
127
 
128
- The solution that appears to work is to `docker-compose down --volumes`; This will tear down the docker instance, and remove the volumes. You can then run `docker-compose up` to get back to work. _**Note:** the `--volumes` switch will remove all custom data._
128
+ The solution that appears to work is to `docker compose down --volumes`; This will tear down the docker instance, and remove the volumes. You can then run `docker compose up` to get back to work. _**Note:** the `--volumes` switch will remove all custom data._
129
129
 
130
130
  ##### Errors building the Docker image
131
131
 
132
- If you encounter errors running `docker-compose build`, try running `bundle update` in `./hyrax` as well as within `./hyrax/.dassie`. That can help clear up the problem of a failure to build a particular gem.
132
+ If you encounter errors running `docker compose build`, try running `bundle update` in `./hyrax` as well as within `./hyrax/.dassie`. That can help clear up the problem of a failure to build a particular gem.
133
133
 
134
134
  ##### Containers do not all start
135
135
 
136
- If any of the services fail to start on `docker-compose up`, try clearing out any `Gemfile.lock` files that might exist in `./hyrax` or `./hyrax/.dassie` and run `docker-compose build` again, then `docker-compose up` again.
136
+ If any of the services fail to start on `docker compose up`, try clearing out any `Gemfile.lock` files that might exist in `./hyrax` or `./hyrax/.dassie` and run `docker compose build` again, then `docker compose up` again.
137
137
 
138
138
  ### Koppie Internal Test App with Valkyrie Connector to Postgres
139
139
 
@@ -191,7 +191,7 @@ We publish several Hyrax images to the [GitHub container registry][ghcr] under
191
191
  the [Samvera organization][samvera-packages]. To build them:
192
192
 
193
193
  ```sh
194
- export HYRAX_VERSION=v4.0.0.rc3 # or desired version
194
+ export HYRAX_VERSION=v5.0.0.rc1 # or desired version
195
195
  git checkout hyrax-$HYRAX_VERSION
196
196
 
197
197
  docker build --target hyrax-base --tag ghcr.io/samvera/hyrax/hyrax-base:$(git rev-parse HEAD) .
data/Dockerfile CHANGED
@@ -1,15 +1,10 @@
1
- ARG RUBY_VERSION=3.2.1
1
+ ARG ALPINE_VERSION=3.18
2
+ ARG RUBY_VERSION=3.2.2
2
3
 
3
- # Replace with official jemalloc package in alpine 3.17
4
- FROM ruby:$RUBY_VERSION-alpine3.16 as builder
5
- RUN apk add build-base curl
6
- RUN curl -sL https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \
7
- cd jemalloc-5.3.0 && \
8
- ./configure && \
9
- make && \
10
- make install
4
+ FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as builder
5
+ RUN apk add build-base curl jemalloc
11
6
 
12
- FROM ruby:$RUBY_VERSION-alpine3.16 as hyrax-base
7
+ FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as hyrax-base
13
8
 
14
9
  ARG DATABASE_APK_PACKAGE="postgresql-dev"
15
10
  ARG EXTRA_APK_PACKAGES="git"
@@ -43,7 +38,7 @@ ENV PATH="/app/samvera:$PATH"
43
38
  ENV RAILS_ROOT="/app/samvera/hyrax-webapp"
44
39
  ENV RAILS_SERVE_STATIC_FILES="1"
45
40
 
46
- COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/
41
+ COPY --from=builder /usr/lib/libjemalloc.so.2 /usr/local/lib/
47
42
  ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
48
43
 
49
44
  ENTRYPOINT ["hyrax-entrypoint.sh"]
@@ -71,7 +71,8 @@ module Hyrax
71
71
  def save(env, use_valkyrie: false)
72
72
  return env.curation_concern.save unless use_valkyrie
73
73
 
74
- resource = valkyrie_save(resource: env.curation_concern.valkyrie_resource)
74
+ # don't run validations again on the converted object if they've already passed
75
+ resource = valkyrie_save(resource: env.curation_concern.valkyrie_resource, is_valid: env.curation_concern.save)
75
76
 
76
77
  # we need to manually set the id and reload, because the actor stack requires
77
78
  # `env.curation_concern` to be the exact same instance throughout.
@@ -115,9 +116,9 @@ module Hyrax
115
116
  attributes.select { |_, v| v.respond_to?(:select) && !v.respond_to?(:read) }
116
117
  end
117
118
 
118
- def valkyrie_save(resource:)
119
+ def valkyrie_save(resource:, is_valid:)
119
120
  permissions = resource.permission_manager.acl.permissions
120
- resource = Hyrax.persister.save(resource: resource)
121
+ resource = Hyrax.persister.save(resource: resource, perform_af_validation: !is_valid)
121
122
 
122
123
  resource.permission_manager.acl.permissions = permissions
123
124
  resource.permission_manager.acl.save
@@ -15,8 +15,11 @@ module Hyrax
15
15
  case work
16
16
  when Valkyrie::Resource
17
17
  embargo_manager = Hyrax::EmbargoManager.new(resource: work)
18
- embargo_manager.release && Hyrax::AccessControlList(work).save
19
- embargo_manager.nullify
18
+ return if embargo_manager.embargo.embargo_release_date.blank?
19
+
20
+ embargo_manager.deactivate!
21
+ work.embargo = Hyrax.persister.save(resource: embargo_manager.embargo)
22
+ Hyrax::AccessControlList(work).save
20
23
  else
21
24
  work.embargo_visibility! # If the embargo has lapsed, update the current visibility.
22
25
  work.deactivate_embargo!
@@ -15,8 +15,11 @@ module Hyrax
15
15
  case work
16
16
  when Valkyrie::Resource
17
17
  lease_manager = Hyrax::LeaseManager.new(resource: work)
18
- lease_manager.release && Hyrax::AccessControlList(work).save
19
- lease_manager.nullify
18
+ return if lease_manager.lease.lease_expiration_date.blank?
19
+
20
+ lease_manager.deactivate!
21
+ work.lease = Hyrax.persister.save(resource: lease_manager.lease)
22
+ Hyrax::AccessControlList(work).save
20
23
  else
21
24
  work.lease_visibility! # If the lease has lapsed, update the current visibility.
22
25
  work.deactivate_lease!
@@ -4,6 +4,7 @@ export default class SortManager {
4
4
  this.sorting_info = {}
5
5
  this.initialize_sort()
6
6
  this.element.data("current-order", this.order)
7
+ this.sort_property = this.element.data("sort-property")
7
8
  this.save_manager = save_manager
8
9
  this.initialize_alpha_sort_button()
9
10
  }
@@ -38,9 +39,9 @@ export default class SortManager {
38
39
  params() {
39
40
  let params = {}
40
41
  params[this.singular_class_name] = {
41
- "version": this.version,
42
- "ordered_member_ids": this.order
42
+ "version": this.version
43
43
  }
44
+ params[this.singular_class_name][this.sort_property] = this.order
44
45
  params["_method"] = "PATCH"
45
46
  return params
46
47
  }
@@ -15,7 +15,7 @@ module Hyrax
15
15
  # Removes a single embargo
16
16
  def destroy
17
17
  Hyrax::Actors::EmbargoActor.new(curation_concern).destroy
18
- flash[:notice] = embargo_history(curation_concern)
18
+ flash[:notice] = embargo_history(curation_concern).last
19
19
  if curation_concern.work? && work_has_file_set_members?(curation_concern)
20
20
  redirect_to confirm_permission_path
21
21
  else