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
@@ -1,113 +0,0 @@
1
- # frozen_string_literal: true
2
- module Hyrax
3
- module Collections
4
- ##
5
- # @deprecated this migration tool should no longer be useful after Hyrax 2.1.0; Removal is planned for 4.0
6
- # Responsible for migrating legacy collections. Legacy collections are those created before Hyrax 2.1.0 and
7
- # are identified by the lack of the collection having a collection type gid.
8
- class MigrationService
9
- # @api public
10
- #
11
- # Migrate all legacy collections to extended collections with collection type assigned. Legacy collections are those
12
- # created before Hyrax 2.1.0 and are identified by the lack of the collection having a collection type gid.
13
- def self.migrate_all_collections
14
- Deprecation.warn('This migration tool will be removed in Hyrax 4.0.0.')
15
-
16
- Hyrax.logger.info "*** Migrating #{::Collection.count} collections"
17
- ::Collection.all.each do |col|
18
- migrate_collection(col)
19
- Hyrax.logger.info " migrating collection - id: #{col.id}, title: #{col.title}"
20
- end
21
-
22
- AdminSet.all.each do |adminset|
23
- migrate_adminset(adminset)
24
- Hyrax.logger.info " migrating adminset - id: #{adminset.id}, title: #{adminset.title}"
25
- end
26
- Hyrax.logger.info "--- Migration Complete"
27
- end
28
-
29
- # @api private
30
- #
31
- # Migrate a single legacy collection to extended collections with collection type assigned. Legacy collections are those
32
- # created before Hyrax 2.1.0 and are identified by the lack of the collection having a collection type gid.
33
- #
34
- # @param collection [::Collection] collection object to be migrated
35
- def self.migrate_collection(collection)
36
- return if collection.collection_type_gid.present? # already migrated
37
- collection.collection_type_gid = Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id
38
- create_permissions(collection)
39
- collection.save
40
- end
41
- private_class_method :migrate_collection
42
-
43
- ##
44
- # @api private
45
- #
46
- # Migrate a single adminset to grant depositors and viewers read access to the admin set unless the grant is for
47
- # registered (authenticated users) or public (anyone) groups. The adjustment is being made to adminsets created
48
- # before Hyrax 2.1.0. Migrating twice will not adversely impact the adminset.
49
- #
50
- # @param adminset [AdminSet] adminset object to be migrated
51
- def self.migrate_adminset(adminset)
52
- Hyrax::PermissionTemplateAccess.find_or_create_by(permission_template_id: adminset.permission_template.id,
53
- agent_type: "group", agent_id: "admin", access: "manage")
54
-
55
- adminset.permission_template.reset_access_controls_for(collection: adminset)
56
- end
57
- private_class_method :migrate_adminset
58
-
59
- # @api public
60
- #
61
- # Validate that migrated collections have both the collection type gid assigned and the permission template with
62
- # access created and associated with the collection. Any collection without collection type gid as nil or assigned
63
- # the default collection type are ignored.
64
- def self.repair_migrated_collections
65
- Deprecation.warn('This migration tool will be removed in Hyrax 4.0.0.')
66
-
67
- Hyrax.logger.info "*** Repairing migrated collections"
68
- ::Collection.all.each do |col|
69
- repair_migrated_collection(col)
70
- Hyrax.logger.info " repairing collection - id: #{col.id}, title: #{col.title}"
71
- end
72
- AdminSet.all.each do |adminset|
73
- migrate_adminset(adminset)
74
- Hyrax.logger.info " repairing adminset - id: #{adminset.id}, title: #{adminset.title}"
75
- end
76
- Hyrax.logger.info "--- Repairing Complete"
77
- end
78
-
79
- # @api private
80
- #
81
- # Validate and repair a migrated collection if needed.
82
- #
83
- # @param collection [::Collection] collection object to be migrated/repaired
84
- def self.repair_migrated_collection(collection)
85
- return if collection.collection_type_gid.present? && collection.collection_type_gid != Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id
86
- collection.collection_type_gid = Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id
87
- permission_template = Hyrax::PermissionTemplate.find_by(source_id: collection.id)
88
- if permission_template.present?
89
- permission_template.reset_access_controls_for(collection: collection, interpret_visibility: true)
90
- else
91
- create_permissions(collection)
92
- end
93
- collection.save
94
- end
95
- private_class_method :repair_migrated_collection
96
-
97
- # @api private
98
- #
99
- # Determine if collection was already migrated.
100
- #
101
- # @param [Collection] collection object to be validated
102
- def self.create_permissions(collection)
103
- grants = []
104
- collection.edit_groups.each { |g| grants << { agent_type: 'group', agent_id: g, access: Hyrax::PermissionTemplateAccess::MANAGE } }
105
- collection.edit_users.each { |u| grants << { agent_type: 'user', agent_id: u, access: Hyrax::PermissionTemplateAccess::MANAGE } }
106
- collection.read_groups.each { |g| grants << { agent_type: 'group', agent_id: g, access: Hyrax::PermissionTemplateAccess::VIEW } }
107
- collection.read_users.each { |u| grants << { agent_type: 'user', agent_id: u, access: Hyrax::PermissionTemplateAccess::VIEW } }
108
- Hyrax::Collections::PermissionsCreateService.create_default(collection: collection, creating_user: ::User.find_by_user_key(collection.depositor), grants: grants)
109
- end
110
- private_class_method :create_permissions
111
- end
112
- end
113
- end
@@ -1 +0,0 @@
1
- <%= full_collections_errors(form: f) %>
@@ -1,3 +0,0 @@
1
- <% unless in_works_ids_errors_for(form: f.object).empty? %>
2
- <%= f.full_error(:in_works_ids) %>
3
- <% end %>
@@ -1,3 +0,0 @@
1
- <% unless ordered_member_ids_errors_for(form: f.object).empty? %>
2
- <%= f.full_error(:ordered_member_ids) %>
3
- <% end %>
@@ -1,19 +0,0 @@
1
- <% unless visibility_errors_for(form: f.object).empty? %>
2
- <%= f.full_error(:visibility) %>
3
- <% end %>
4
-
5
- <% unless embargo_release_date_errors_for(form: f.object).empty? %>
6
- <%= f.full_error(:embargo_release_date) %>
7
- <% end %>
8
-
9
- <% unless visibility_after_embargo_errors_for(form: f.object).empty? %>
10
- <%= f.full_error(:visibility_after_embargo) %>
11
- <% end %>
12
-
13
- <% unless lease_expiration_date_errors_for(form: f.object).empty? %>
14
- <%= f.full_error(:lease_expiration_date) %>
15
- <% end %>
16
-
17
- <% unless visibility_after_lease_errors_for(form: f.object).empty? %>
18
- <%= f.full_error(:visibility_after_lease) %>
19
- <% end %>