hyrax 3.0.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (287) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +46 -13
  3. data/.dassie/Gemfile +11 -6
  4. data/.dassie/app/controllers/catalog_controller.rb +6 -0
  5. data/.dassie/config/initializers/hyrax.rb +5 -0
  6. data/.dassie/config/initializers/riiif.rb +22 -20
  7. data/.dassie/config/role_map.yml +2 -0
  8. data/.dassie/db/seeds.rb +1 -1
  9. data/.dassie/package.json +3 -5
  10. data/.dockerignore +3 -0
  11. data/.env +1 -2
  12. data/.rubocop.yml +4 -0
  13. data/CONTAINERS.md +21 -1
  14. data/Dockerfile +42 -17
  15. data/Gemfile +21 -27
  16. data/app/actors/hyrax/actors/base_actor.rb +2 -2
  17. data/app/actors/hyrax/actors/collections_membership_actor.rb +3 -3
  18. data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +85 -63
  19. data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +7 -42
  20. data/app/actors/hyrax/actors/file_set_actor.rb +12 -5
  21. data/app/assets/stylesheets/hyrax/_styles.scss +5 -0
  22. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +30 -10
  23. data/app/controllers/concerns/hyrax/controller.rb +13 -2
  24. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +21 -9
  25. data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +14 -5
  26. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +22 -3
  27. data/app/controllers/hyrax/admin/admin_sets_controller.rb +2 -19
  28. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +5 -6
  29. data/app/controllers/hyrax/admin/workflows_controller.rb +8 -2
  30. data/app/controllers/hyrax/collections_controller.rb +3 -1
  31. data/app/controllers/hyrax/dashboard/collection_members_controller.rb +24 -17
  32. data/app/controllers/hyrax/dashboard/collections_controller.rb +99 -35
  33. data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +75 -39
  34. data/app/controllers/hyrax/file_sets_controller.rb +49 -13
  35. data/app/controllers/hyrax/my_controller.rb +4 -4
  36. data/app/controllers/hyrax/permissions_controller.rb +3 -4
  37. data/app/controllers/hyrax/workflow_actions_controller.rb +11 -6
  38. data/app/forms/hyrax/forms/administrative_set_form.rb +62 -0
  39. data/app/forms/hyrax/forms/collection_form.rb +14 -8
  40. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +38 -6
  41. data/app/forms/hyrax/forms/file_set_form.rb +46 -0
  42. data/app/forms/hyrax/forms/pcdm_collection_form.rb +64 -0
  43. data/app/forms/hyrax/forms/permission.rb +23 -0
  44. data/app/forms/hyrax/forms/permission_template_form.rb +8 -2
  45. data/app/forms/hyrax/forms/resource_form.rb +34 -26
  46. data/app/forms/hyrax/forms/work_form.rb +5 -2
  47. data/app/forms/hyrax/forms/workflow_action_form.rb +4 -0
  48. data/app/helpers/hyrax/batch_edits_helper.rb +3 -1
  49. data/app/helpers/hyrax/collections_helper.rb +88 -2
  50. data/app/helpers/hyrax/dashboard_helper_behavior.rb +16 -5
  51. data/app/helpers/hyrax/embargo_helper.rb +4 -0
  52. data/app/helpers/hyrax/file_set_helper.rb +25 -6
  53. data/app/helpers/hyrax/hyrax_helper_behavior.rb +9 -0
  54. data/app/helpers/hyrax/lease_helper.rb +4 -0
  55. data/app/helpers/hyrax/url_helper.rb +4 -1
  56. data/app/helpers/hyrax/work_form_helper.rb +53 -0
  57. data/app/indexers/hyrax/administrative_set_indexer.rb +18 -0
  58. data/app/indexers/hyrax/pcdm_collection_indexer.rb +2 -0
  59. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +2 -0
  60. data/app/indexers/hyrax/valkyrie_indexer.rb +4 -3
  61. data/app/indexers/hyrax/valkyrie_work_indexer.rb +1 -1
  62. data/app/inputs/controlled_vocabulary_input.rb +2 -5
  63. data/app/jobs/attach_files_to_work_job.rb +19 -10
  64. data/app/jobs/attach_files_to_work_with_ordered_members_job.rb +6 -5
  65. data/app/jobs/ingest_local_file_job.rb +18 -2
  66. data/app/jobs/inherit_permissions_job.rb +9 -5
  67. data/app/models/admin_set.rb +22 -30
  68. data/app/models/collection_branding_info.rb +25 -9
  69. data/app/models/concerns/hyrax/ability/admin_set_ability.rb +31 -7
  70. data/app/models/concerns/hyrax/ability/collection_ability.rb +35 -20
  71. data/app/models/concerns/hyrax/ability/collection_type_ability.rb +1 -1
  72. data/app/models/concerns/hyrax/ability.rb +5 -3
  73. data/app/models/concerns/hyrax/collection_behavior.rb +17 -44
  74. data/app/models/concerns/hyrax/embargoable.rb +24 -0
  75. data/app/models/concerns/hyrax/file_set/characterization.rb +18 -12
  76. data/app/models/concerns/hyrax/solr_document_behavior.rb +11 -54
  77. data/app/models/concerns/hyrax/suppressible.rb +5 -0
  78. data/app/models/concerns/hyrax/user.rb +9 -3
  79. data/app/models/concerns/hyrax/work_behavior.rb +1 -1
  80. data/app/models/hyrax/administrative_set.rb +7 -1
  81. data/app/models/hyrax/file_set.rb +6 -0
  82. data/app/models/hyrax/pcdm_collection.rb +1 -0
  83. data/app/models/hyrax/permission.rb +1 -1
  84. data/app/models/hyrax/permission_template.rb +112 -12
  85. data/app/models/hyrax/virus_scanner.rb +27 -18
  86. data/app/models/hyrax/work.rb +1 -0
  87. data/app/models/hyrax/workflow_action_info.rb +16 -0
  88. data/app/models/sipity/agent.rb +1 -0
  89. data/app/models/sipity/comment.rb +17 -0
  90. data/app/models/sipity/entity.rb +30 -8
  91. data/app/models/sipity/workflow.rb +1 -0
  92. data/app/models/sipity.rb +53 -2
  93. data/app/presenters/hyrax/admin_set_options_presenter.rb +12 -8
  94. data/app/presenters/hyrax/admin_set_presenter.rb +13 -4
  95. data/app/presenters/hyrax/admin_set_selection_presenter.rb +116 -0
  96. data/app/presenters/hyrax/collection_presenter.rb +44 -23
  97. data/app/presenters/hyrax/file_set_presenter.rb +6 -1
  98. data/app/presenters/hyrax/file_usage.rb +3 -2
  99. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +119 -0
  100. data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
  101. data/app/presenters/hyrax/trophy_presenter.rb +33 -4
  102. data/app/presenters/hyrax/user_profile_presenter.rb +11 -1
  103. data/app/presenters/hyrax/version_list_presenter.rb +19 -0
  104. data/app/presenters/hyrax/version_presenter.rb +3 -2
  105. data/app/presenters/hyrax/work_show_presenter.rb +32 -6
  106. data/app/presenters/hyrax/work_usage.rb +5 -3
  107. data/app/renderers/hyrax/renderers/attribute_renderer.rb +10 -2
  108. data/app/search_builders/hyrax/abstract_type_relation.rb +4 -2
  109. data/app/search_builders/hyrax/admin_set_search_builder.rb +1 -1
  110. data/app/search_builders/hyrax/collection_member_search_builder.rb +6 -1
  111. data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +1 -1
  112. data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
  113. data/app/search_builders/hyrax/filter_by_type.rb +1 -2
  114. data/app/search_builders/hyrax/my/collections_search_builder.rb +2 -2
  115. data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +1 -1
  116. data/app/search_builders/hyrax/single_collection_search_builder.rb +1 -1
  117. data/app/services/hyrax/admin_set_create_service.rb +136 -52
  118. data/app/services/hyrax/collection_types/permissions_service.rb +1 -1
  119. data/app/services/hyrax/collections/collection_member_search_service.rb +72 -0
  120. data/app/services/hyrax/collections/collection_member_service.rb +122 -27
  121. data/app/services/hyrax/collections/migration_service.rb +4 -2
  122. data/app/services/hyrax/collections/nested_collection_persistence_service.rb +12 -13
  123. data/app/services/hyrax/collections/nested_collection_query_service.rb +2 -0
  124. data/app/services/hyrax/collections/permissions_create_service.rb +82 -78
  125. data/app/services/hyrax/collections/permissions_service.rb +1 -1
  126. data/app/services/hyrax/contextual_path.rb +24 -1
  127. data/app/services/hyrax/curation_concern.rb +24 -2
  128. data/app/services/hyrax/custom_queries/find_file_metadata.rb +7 -5
  129. data/app/services/hyrax/custom_queries/navigators/parent_collections_navigator.rb +46 -0
  130. data/app/services/hyrax/default_middleware_stack.rb +11 -0
  131. data/app/services/hyrax/edit_permissions_service.rb +74 -41
  132. data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +3 -3
  133. data/app/services/hyrax/find_objects_via_solr_service.rb +31 -0
  134. data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +1 -0
  135. data/app/services/hyrax/listeners/member_cleanup_listener.rb +26 -0
  136. data/app/services/hyrax/listeners/metadata_index_listener.rb +25 -9
  137. data/app/services/hyrax/listeners/object_lifecycle_listener.rb +1 -1
  138. data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +17 -0
  139. data/app/services/hyrax/listeners.rb +2 -0
  140. data/app/services/hyrax/multiple_membership_checker.rb +53 -29
  141. data/app/services/hyrax/permission_manager.rb +4 -4
  142. data/app/services/hyrax/persist_derivatives.rb +3 -1
  143. data/app/services/hyrax/resource_status.rb +7 -0
  144. data/app/services/hyrax/search_service.rb +4 -2
  145. data/app/services/hyrax/solr_query_builder_service.rb +45 -8
  146. data/app/services/hyrax/solr_query_service.rb +224 -0
  147. data/app/services/hyrax/solr_service.rb +9 -2
  148. data/app/services/hyrax/statistics/collections/over_time.rb +2 -1
  149. data/app/services/hyrax/statistics/depositors/summary.rb +2 -1
  150. data/app/services/hyrax/thumbnail_path_service.rb +1 -1
  151. data/app/services/hyrax/visibility_intention.rb +20 -2
  152. data/app/services/hyrax/visibility_propagator.rb +30 -1
  153. data/app/services/hyrax/work_uploads_handler.rb +17 -2
  154. data/app/services/hyrax/workflow/abstract_notification.rb +2 -2
  155. data/app/services/hyrax/workflow/action_taken_service.rb +16 -4
  156. data/app/services/hyrax/workflow/actionable_objects.rb +70 -0
  157. data/app/services/hyrax/workflow/activate_object.rb +5 -4
  158. data/app/services/hyrax/workflow/changes_required_notification.rb +5 -4
  159. data/app/services/hyrax/workflow/deactivate_object.rb +7 -5
  160. data/app/services/hyrax/workflow/deposited_notification.rb +8 -4
  161. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +7 -3
  162. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +10 -3
  163. data/app/services/hyrax/workflow/object_in_workflow_decorator.rb +31 -0
  164. data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +8 -2
  165. data/app/services/hyrax/workflow/status_list_service.rb +43 -13
  166. data/app/services/hyrax/workflow/workflow_action_service.rb +4 -1
  167. data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
  168. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
  169. data/app/views/hyrax/base/_form_relationships.html.erb +1 -2
  170. data/app/views/hyrax/base/_form_rendering.html.erb +1 -1
  171. data/app/views/hyrax/base/_form_representative.html.erb +1 -1
  172. data/app/views/hyrax/base/_form_thumbnail.html.erb +1 -1
  173. data/app/views/hyrax/base/_form_visibility_error.html.erb +2 -0
  174. data/app/views/hyrax/base/_guts4form.html.erb +3 -3
  175. data/app/views/hyrax/base/_representative_media.html.erb +1 -1
  176. data/app/views/hyrax/base/_show_actions.html.erb +2 -2
  177. data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
  178. data/app/views/hyrax/batch_uploads/_form.html.erb +1 -1
  179. data/app/views/hyrax/collections/show.html.erb +1 -1
  180. data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +1 -1
  181. data/app/views/hyrax/dashboard/collections/_form.html.erb +4 -4
  182. data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +1 -1
  183. data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
  184. data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
  185. data/app/views/hyrax/dashboard/collections/edit.html.erb +4 -2
  186. data/app/views/hyrax/dashboard/collections/new.html.erb +4 -2
  187. data/app/views/hyrax/dashboard/collections/show.html.erb +1 -1
  188. data/app/views/hyrax/file_sets/_actions.html.erb +10 -0
  189. data/app/views/hyrax/file_sets/edit.html.erb +1 -1
  190. data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
  191. data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
  192. data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -1
  193. data/app/views/hyrax/file_sets/media_display/_office_document.html.erb +1 -1
  194. data/app/views/hyrax/file_sets/media_display/_pdf.html.erb +1 -1
  195. data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
  196. data/app/views/hyrax/file_sets/show.html.erb +1 -1
  197. data/app/views/hyrax/homepage/index.html.erb +1 -1
  198. data/app/views/hyrax/my/_admin_set_action_menu.html.erb +0 -11
  199. data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -2
  200. data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
  201. data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -5
  202. data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +1 -1
  203. data/app/views/layouts/hyrax/dashboard.html.erb +1 -0
  204. data/app/views/layouts/hyrax.html.erb +1 -0
  205. data/app/views/shared/_read_only.html.erb +5 -0
  206. data/bin/db-migrate-seed.sh +3 -1
  207. data/bin/hyrax-entrypoint.sh +0 -14
  208. data/bin/solrcloud-assign-configset.sh +11 -3
  209. data/bin/solrcloud-upload-configset.sh +17 -6
  210. data/chart/hyrax/Chart.yaml +9 -5
  211. data/chart/hyrax/README.md +52 -5
  212. data/chart/hyrax/templates/_helpers.tpl +23 -1
  213. data/chart/hyrax/templates/branding-pvc.yaml +14 -0
  214. data/chart/hyrax/templates/configmap-env.yaml +14 -3
  215. data/chart/hyrax/templates/deployment-worker.yaml +129 -0
  216. data/chart/hyrax/templates/deployment.yaml +95 -0
  217. data/chart/hyrax/templates/derivatives-pvc.yaml +14 -0
  218. data/chart/hyrax/templates/ingress.yaml +13 -4
  219. data/chart/hyrax/templates/secrets.yaml +9 -0
  220. data/chart/hyrax/templates/uploads-pvc.yaml +14 -0
  221. data/chart/hyrax/values.yaml +114 -1
  222. data/config/brakeman.ignore +2 -2
  223. data/config/features.rb +50 -43
  224. data/config/initializers/1_healthz.rb +1 -0
  225. data/config/initializers/listeners.rb +4 -1
  226. data/config/initializers/valkryrie_storage.rb +7 -0
  227. data/config/locales/hyrax.de.yml +1 -1
  228. data/config/locales/hyrax.en.yml +2 -1
  229. data/config/locales/hyrax.es.yml +1 -1
  230. data/config/locales/hyrax.fr.yml +1 -1
  231. data/config/locales/hyrax.it.yml +1 -1
  232. data/config/locales/hyrax.pt-BR.yml +1 -1
  233. data/config/locales/hyrax.zh.yml +1 -1
  234. data/db/seeds.rb +1 -1
  235. data/docker-compose.yml +39 -8
  236. data/documentation/developing-your-hyrax-based-app.md +3 -3
  237. data/documentation/legacyREADME.md +3 -3
  238. data/hyrax.gemspec +1 -1
  239. data/lib/generators/hyrax/templates/catalog_controller.rb +3 -1
  240. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +15 -0
  241. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +22 -20
  242. data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
  243. data/lib/generators/hyrax/work_resource/templates/indexer_spec.rb.erb +1 -0
  244. data/lib/hyrax/active_fedora_dummy_model.rb +62 -0
  245. data/lib/hyrax/collection_name.rb +6 -2
  246. data/lib/hyrax/configuration.rb +56 -0
  247. data/lib/hyrax/engine.rb +3 -1
  248. data/lib/hyrax/errors.rb +2 -0
  249. data/lib/hyrax/form_fields.rb +1 -0
  250. data/lib/hyrax/publisher.rb +12 -0
  251. data/lib/hyrax/resource_name.rb +1 -0
  252. data/lib/hyrax/resource_sync/change_list_writer.rb +2 -2
  253. data/lib/hyrax/resource_sync/resource_list_writer.rb +2 -2
  254. data/lib/hyrax/specs/capybara.rb +5 -3
  255. data/lib/hyrax/specs/shared_specs/hydra_works.rb +2 -0
  256. data/lib/hyrax/specs/shared_specs/indexers.rb +6 -0
  257. data/lib/hyrax/specs/shared_specs/valkyrie_storage_versions.rb +9 -0
  258. data/lib/hyrax/transactions/collection_create.rb +25 -0
  259. data/lib/hyrax/transactions/collection_update.rb +20 -0
  260. data/lib/hyrax/transactions/container.rb +47 -0
  261. data/lib/hyrax/transactions/file_set_destroy.rb +21 -0
  262. data/lib/hyrax/transactions/steps/add_file_sets.rb +3 -2
  263. data/lib/hyrax/transactions/steps/add_to_collections.rb +13 -1
  264. data/lib/hyrax/transactions/steps/add_to_parent.rb +36 -0
  265. data/lib/hyrax/transactions/steps/apply_collection_type_permissions.rb +29 -0
  266. data/lib/hyrax/transactions/steps/remove_file_set_from_work.rb +47 -0
  267. data/lib/hyrax/transactions/steps/save.rb +18 -6
  268. data/lib/hyrax/transactions/steps/set_collection_type_gid.rb +35 -0
  269. data/lib/hyrax/transactions/work_create.rb +2 -1
  270. data/lib/hyrax/valkyrie_can_can_adapter.rb +3 -0
  271. data/lib/hyrax/valkyrie_simple_path_generator.rb +20 -0
  272. data/lib/hyrax/version.rb +1 -1
  273. data/lib/hyrax.rb +9 -0
  274. data/lib/tasks/collection_type_global_id.rake +1 -1
  275. data/lib/tasks/default_admin_set.rake +12 -11
  276. data/lib/tasks/regenerate_derivatives.rake +12 -0
  277. data/lib/wings/active_fedora_converter/default_work.rb +15 -0
  278. data/lib/wings/converter_value_mapper.rb +2 -2
  279. data/lib/wings/model_transformer.rb +17 -1
  280. data/lib/wings/orm_converter.rb +18 -2
  281. data/lib/wings/setup.rb +2 -0
  282. data/lib/wings/valkyrie/persister.rb +7 -5
  283. data/lib/wings/valkyrie/query_service.rb +60 -17
  284. data/lib/wings/valkyrie/storage.rb +56 -1
  285. data/lib/wings.rb +0 -21
  286. data/template.rb +1 -1
  287. metadata +42 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92a018038d9094f92a85088a61ff697aba139a326cfa96a95a7d4cdbeca98a0a
4
- data.tar.gz: 8ca7c54444ba58ba89f2fc977ddcb8597122b985c9d7a7dda21d64fdcc87e648
3
+ metadata.gz: d1dfd66c313400a16a149d5bdb7a2495164c18bce86b9bd8f079970b68e328cf
4
+ data.tar.gz: 66c678a483a9f2822712dea5f8448e55d9019dbdc47605b9a03177d0465ab775
5
5
  SHA512:
6
- metadata.gz: d5a60ae3e20bead1941c72d241bfa4fbee221eb6bf4637ad1bf58a53edd07eaaa741108707d06ece69b096b83132512875555fc64c6128b3a0c1046b079cbf9a
7
- data.tar.gz: 64b2ef5c948183fa190b4f20adfae67ef22a8abc83df98c4e4581cbe83d960b3dc8d67b0453c062da5940d76f915a496fcb16f3b3a29aa63ffdeb2f0b443dab3
6
+ metadata.gz: 8309e7eb25d84767fd2395e04326df0c1f925bef0a2618818b0430327ac623f0f4078abbd45b5a966ccb6ccbc4c6bc233823e7d1b00d08b5e977771c97be4306
7
+ data.tar.gz: dd759280930d7cbc3448b3fafbfae5bbb631f9eb8fb93a9dca2e9ee73b3226f71d5b453ec29a40ac087dacf076059b752e8e72b2b9e35c5efab1b54743a1e958
data/.circleci/config.yml CHANGED
@@ -12,7 +12,7 @@ jobs:
12
12
  default: 1.17.3
13
13
  rails_version:
14
14
  type: string
15
- default: '5.2.2'
15
+ default: '5.2.6'
16
16
  executor:
17
17
  name: 'samvera/ruby'
18
18
  ruby_version: << parameters.ruby_version >>
@@ -22,6 +22,17 @@ jobs:
22
22
  NOKOGIRI_USE_SYSTEM_LIBRARIES: true
23
23
  steps:
24
24
  - samvera/cached_checkout
25
+
26
+ - run:
27
+ name: Check for a branch named 'master'
28
+ command: |
29
+ git fetch --all --quiet --prune --prune-tags
30
+ if [[ -n "$(git branch --all --list master */master)" ]]; then
31
+ echo "A branch named 'master' was found. Please remove it."
32
+ echo "$(git branch --all --list master */master)"
33
+ fi
34
+ [[ -z "$(git branch --all --list master */master)" ]]
35
+
25
36
  - samvera/bundle_for_gem:
26
37
  ruby_version: << parameters.ruby_version >>
27
38
  bundler_version: << parameters.bundler_version >>
@@ -63,7 +74,7 @@ jobs:
63
74
  default: 1.17.3
64
75
  rails_version:
65
76
  type: string
66
- default: '5.2.2'
77
+ default: '5.2.6'
67
78
  executor:
68
79
  name: 'samvera/ruby_fcrepo_solr_redis_postgres'
69
80
  ruby_version: << parameters.ruby_version >>
@@ -125,16 +136,31 @@ jobs:
125
136
  command: bundle exec rake app:db:migrate
126
137
  - samvera/parallel_rspec
127
138
 
139
+ # Trigger a workflow on the nurax repository that will deploy the most recent hyrax gem code to https://nurax-dev.curationexperts.com/
140
+ deploy:
141
+ docker:
142
+ - image: ubuntu
143
+ steps:
144
+ - run:
145
+ name: Install curl
146
+ command: apt-get update && apt-get install -y curl
147
+ - run:
148
+ name: "Trigger Nurax deploy"
149
+ command: |
150
+ curl -X POST https://circleci.com/api/v2/project/gh/curationexperts/nurax/pipeline \
151
+ --header "Circle-Token: $NURAX_CIRCLECI_TOKEN" \
152
+ --header 'Accept: text/plain' \
153
+ --header 'Content-Type: application/json'
128
154
  workflows:
129
155
  version: 2
130
156
  ruby2-5-8:
131
157
  jobs:
132
158
  - bundle:
133
159
  ruby_version: "2.5.8"
134
- rails_version: "5.2.4.3"
160
+ rails_version: "5.2.6"
135
161
  - build:
136
162
  ruby_version: "2.5.8"
137
- rails_version: "5.2.4.3"
163
+ rails_version: "5.2.6"
138
164
  requires:
139
165
  - bundle
140
166
  - test:
@@ -146,10 +172,10 @@ workflows:
146
172
  jobs:
147
173
  - bundle:
148
174
  ruby_version: "2.6.6"
149
- rails_version: "5.2.4.3"
175
+ rails_version: "5.2.6"
150
176
  - build:
151
177
  ruby_version: "2.6.6"
152
- rails_version: "5.2.4.3"
178
+ rails_version: "5.2.6"
153
179
  requires:
154
180
  - bundle
155
181
  - test:
@@ -163,21 +189,28 @@ workflows:
163
189
  hyrax_valkyrie: "true"
164
190
  requires:
165
191
  - build
166
- ruby2-7-2:
192
+ ruby2-7-4:
167
193
  jobs:
168
194
  - bundle:
169
- ruby_version: "2.7.2"
170
- rails_version: "5.2.4.3"
195
+ ruby_version: "2.7.4"
196
+ rails_version: "5.2.6"
171
197
  bundler_version: "2.1.4"
172
198
  - build:
173
- ruby_version: "2.7.2"
174
- rails_version: "5.2.4.3"
199
+ ruby_version: "2.7.4"
200
+ rails_version: "5.2.6"
175
201
  bundler_version: "2.1.4"
176
202
  requires:
177
203
  - bundle
178
204
  - test:
179
- name: "ruby2-7-2"
180
- ruby_version: "2.7.2"
205
+ name: "ruby2-7-4"
206
+ ruby_version: "2.7.4"
181
207
  bundler_version: "2.1.4"
182
208
  requires:
183
209
  - build
210
+ nurax-dev_deploy:
211
+ jobs:
212
+ - deploy:
213
+ filters:
214
+ branches:
215
+ only:
216
+ - main
data/.dassie/Gemfile CHANGED
@@ -1,14 +1,21 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+ # Attempts to determine if a global gem source has ready been added by another Gemfile
3
+ if @sources.global_rubygems_source == Bundler::SourceList.new.global_rubygems_source
4
+ Bundler.ui.info '[Dassie] Adding global rubygems source.'
5
+ source 'https://rubygems.org'
6
+ else
7
+ Bundler.ui.info "[Dassie] Global rubygems source already set: #{@sources.global_rubygems_source.inspect}"
8
+ end
2
9
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
10
 
4
- ruby '2.7.2'
11
+ ruby '2.7.4'
5
12
 
6
13
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7
14
  gem 'rails', '~> 5.2.4', '>= 5.2.4.4'
8
15
  # Use postgresql as the database for Active Record
9
16
  gem 'pg', '>= 0.18', '< 2.0'
10
17
  # Use Puma as the app server
11
- gem 'puma', '~> 3.11'
18
+ gem 'puma', '~> 4.3.8'
12
19
  # Use SCSS for stylesheets
13
20
  gem 'sass-rails', '~> 5.0'
14
21
  # Use Uglifier as compressor for JavaScript assets
@@ -43,9 +50,7 @@ end
43
50
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
44
51
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
45
52
 
46
- begin # this is a hack to allow `eval_gemfile` to work correctly
47
- gem 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
48
- rescue; end
53
+ gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
49
54
 
50
55
  gem 'rsolr', '>= 1.0', '< 3'
51
56
  gem 'bootstrap-sass', '~> 3.0'
@@ -5,6 +5,8 @@ class CatalogController < ApplicationController
5
5
 
6
6
  # This filter applies the hydra access controls
7
7
  before_action :enforce_show_permissions, only: :show
8
+ # Allow all search options when in read-only mode
9
+ skip_before_action :check_read_only
8
10
 
9
11
  def self.uploaded_field
10
12
  "system_create_dtsi"
@@ -28,6 +30,10 @@ class CatalogController < ApplicationController
28
30
  config.view.gallery.partials = [:index_header, :index]
29
31
  config.view.slideshow.partials = [:index]
30
32
 
33
+ # Because too many times on Samvera tech people raise a problem regarding a failed query to SOLR.
34
+ # Often, it's because they inadvertently exceeded the character limit of a GET request.
35
+ config.http_method = :post
36
+
31
37
  ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
32
38
  config.default_solr_params = {
33
39
  qt: "search",
@@ -39,6 +39,11 @@ Hyrax.config do |config|
39
39
  ##
40
40
  # Set the system-wide virus scanner
41
41
  config.virus_scanner = Hyrax::VirusScanner
42
+
43
+ ##
44
+ # To index to the Valkyrie core, uncomment the following two lines.
45
+ # config.query_index_from_valkyrie = true
46
+ # config.index_adapter = :solr_index
42
47
  end
43
48
 
44
49
  Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
@@ -1,27 +1,29 @@
1
1
  # frozen_string_literal: true
2
- Riiif::Image.file_resolver = Riiif::HttpFileResolver.new
3
- Riiif::Image.info_service = lambda do |id, _file|
4
- # id will look like a path to a pcdm:file
5
- # (e.g. rv042t299%2Ffiles%2F6d71677a-4f80-42f1-ae58-ed1063fd79c7)
6
- # but we just want the id for the FileSet it's attached to.
2
+ ActiveSupport::Reloader.to_prepare do
3
+ Riiif::Image.file_resolver = Riiif::HttpFileResolver.new
4
+ Riiif::Image.info_service = lambda do |id, _file|
5
+ # id will look like a path to a pcdm:file
6
+ # (e.g. rv042t299%2Ffiles%2F6d71677a-4f80-42f1-ae58-ed1063fd79c7)
7
+ # but we just want the id for the FileSet it's attached to.
7
8
 
8
- # Capture everything before the first slash
9
- fs_id = id.sub(/\A([^\/]*)\/.*/, '\1')
10
- resp = Hyrax::SolrService.get("id:#{fs_id}")
11
- doc = resp['response']['docs'].first
12
- raise "Unable to find solr document with id:#{fs_id}" unless doc
13
- { height: doc['height_is'], width: doc['width_is'], format: doc['mime_type_ssi'], channels: doc['alpha_channels_ssi'] }
14
- end
9
+ # Capture everything before the first slash
10
+ fs_id = id.sub(/\A([^\/]*)\/.*/, '\1')
11
+ resp = Hyrax::SolrService.get("id:#{fs_id}")
12
+ doc = resp['response']['docs'].first
13
+ raise "Unable to find solr document with id:#{fs_id}" unless doc
14
+ { height: doc['height_is'], width: doc['width_is'], format: doc['mime_type_ssi'], channels: doc['alpha_channels_ssi'] }
15
+ end
15
16
 
16
- Riiif::Image.file_resolver.id_to_uri = lambda do |id|
17
- Hyrax::Base.id_to_uri(CGI.unescape(id)).tap do |url|
18
- Rails.logger.info "Riiif resolved #{id} to #{url}"
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}"
20
+ end
19
21
  end
20
- end
21
22
 
22
- Riiif::Image.authorization_service = Hyrax::IIIFAuthorizationService
23
+ Riiif::Image.authorization_service = Hyrax::IIIFAuthorizationService
23
24
 
24
- Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
25
- Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
25
+ Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
26
+ Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
26
27
 
27
- Riiif::Engine.config.cache_duration = 365.days
28
+ Riiif::Engine.config.cache_duration = 365.days
29
+ end
@@ -1,4 +1,6 @@
1
1
  development:
2
+ admin:
3
+ - admin@example.com
2
4
  archivist:
3
5
  - archivist1@example.com
4
6
 
data/.dassie/db/seeds.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
7
  # Character.create(name: 'Luke', movie: movies.first)
8
8
 
9
- Hyrax::Engine.load_seed
9
+ Hyrax::Engine.load_seed unless ActiveModel::Type::Boolean.new.cast(ENV["SKIP_HYRAX_ENGINE_SEED"])
10
10
 
11
11
  puts "\n== Loading users"
12
12
  User.where(email: 'admin@example.com').first_or_create do |f|
data/.dassie/package.json CHANGED
@@ -8,10 +8,8 @@
8
8
  "scripts": {
9
9
  "preinstall": "rm -rf ./public/uv",
10
10
  "postinstall": "yarn run uv-install && yarn run uv-config",
11
- "uv-install": "shx cp -r ./node_modules/universalviewer/dist ./public/uv",
12
- "uv-config": "shx cp ./config/uv/uv.html ./public/uv/uv.html & shx cp ./config/uv/uv-config.json ./public/uv/"
11
+ "uv-install": "cp -r ./node_modules/universalviewer/dist ./public/uv",
12
+ "uv-config": "cp ./config/uv/uv.html ./public/uv/uv.html & cp ./config/uv/uv-config.json ./public/uv/"
13
13
  },
14
- "devDependencies": {
15
- "shx": "^0.3.2"
16
- }
14
+ "devDependencies": {}
17
15
  }
data/.dockerignore CHANGED
@@ -10,3 +10,6 @@ Dockerfile
10
10
  artifacts/*
11
11
  coverage/*
12
12
  chart/*
13
+
14
+ Gemfile.lock
15
+ .dassie/Gemfile.lock
data/.env CHANGED
@@ -1,4 +1,3 @@
1
- CAPYBARA_SERVER=http://app:3010
2
1
  CHROME_HEADLESS_MODE=false
3
2
  DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
4
3
  DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
@@ -7,7 +6,7 @@ DB_PORT=5432
7
6
  DB_HOST=postgres
8
7
  FCREPO_PORT=8080
9
8
  FCREPO_HOST=fcrepo
10
- FCREPO_REST_PATH=fcrepo/rest
9
+ FCREPO_REST_PATH=rest
11
10
  FCREPO_TEST_BASE_PATH=/test
12
11
  HUB_URL=http://chrome:4444/wd/hub
13
12
  HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
data/.rubocop.yml CHANGED
@@ -41,6 +41,10 @@ Metrics/BlockLength:
41
41
  Style/AsciiComments:
42
42
  Enabled: false
43
43
 
44
+ # rubocop suggests !thing.nil? instead, but that is NOT equivalent
45
+ Style/DoubleNegation:
46
+ Enabled: false
47
+
44
48
  Style/CollectionMethods:
45
49
  PreferredMethods:
46
50
  collect: 'map'
data/CONTAINERS.md CHANGED
@@ -8,7 +8,7 @@ providing better guidance around deployment.
8
8
  Where are we at? It's complicated. What we have below is experimental support, but one that we want to push
9
9
  towards. We need your help to keep pushing in this direction. So dig in and prepare to get your hands dirty.
10
10
 
11
- The [Hyrax Engine Development](#hyrax-engine-development) is further along than the [Docker Image for Hyrax-based Applications](docker-image-for-hyrax-based-applications) which is further along than [Deploying to Production](#deploying-to-production).
11
+ The [Hyrax Engine Development](#hyrax-engine-development) is further along than the [Docker Image for Hyrax-based Applications](#docker-image-for-hyrax-based-applications) which is further along than [Deploying to Production](#deploying-to-production).
12
12
 
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
@@ -107,6 +107,26 @@ I (Jeremy) find myself wanting to debug the application. This requires a somewh
107
107
 
108
108
  This advice comes from [Debugging Rails App With Docker Compose: How to use Byebug in a dockerized rails app](https://medium.com/gogox-technology/debugging-rails-app-with-docker-compose-39a3767962f4).
109
109
 
110
+ ### Troubleshooting
111
+
112
+ #### Bad Address SOLR
113
+
114
+ With `docker-compose up` running, if you see the following, then there may be issues with file permissions:
115
+
116
+ ```
117
+ db_migrate_1 | waiting for solr:8983
118
+ db_migrate_1 | nc: bad address 'solr'
119
+ ```
120
+
121
+ Check the Docker application logs and look for permission errors:
122
+
123
+ ```
124
+ Executing /opt/docker-solr/scripts/precreate-core hyrax_test /opt/solr/server/configsets/hyraxconf
125
+ cp: cannot create directory '/var/solr/data/hyrax_test': Permission denied
126
+ ```
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._
129
+
110
130
  <!-- NOTE: This title is referenced in the top-level documentation/developing-your-hyrax-based-app.md. Keep that in mind if you change it. -->
111
131
  ## Docker Image for Hyrax-based Applications
112
132
 
data/Dockerfile CHANGED
@@ -1,6 +1,5 @@
1
- ARG RUBY_VERSION=2.7.2
2
- # lock at alpine3.12 because 3.13 has dns resolver problems
3
- FROM ruby:$RUBY_VERSION-alpine3.12 as hyrax-base
1
+ ARG RUBY_VERSION=2.7.4
2
+ FROM ruby:$RUBY_VERSION-alpine3.14 as hyrax-base
4
3
 
5
4
  ARG DATABASE_APK_PACKAGE="postgresql-dev"
6
5
  ARG EXTRA_APK_PACKAGES="git"
@@ -43,21 +42,8 @@ ONBUILD COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
43
42
  ONBUILD RUN bundle install --jobs "$(nproc)"
44
43
  ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
45
44
 
46
- FROM hyrax-base as hyrax-engine-dev
47
-
48
- ARG APP_PATH=.dassie
49
- ARG BUNDLE_WITHOUT=
50
-
51
- ENV HYRAX_ENGINE_PATH /app/samvera/hyrax-engine
52
-
53
- COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
54
- COPY --chown=1001:101 . /app/samvera/hyrax-engine
55
-
56
- RUN cd /app/samvera/hyrax-engine && bundle install --jobs "$(nproc)"
57
- RUN RAILS_ENV=production SECRET_KEY_BASE='fakesecret1234' DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
58
-
59
45
 
60
- FROM hyrax-engine-dev as hyrax-engine-dev-worker
46
+ FROM hyrax-base as hyrax-worker-base
61
47
 
62
48
  ENV MALLOC_ARENA_MAX=2
63
49
 
@@ -78,3 +64,42 @@ RUN mkdir -p /app/fits && \
78
64
  ENV PATH="${PATH}:/app/fits"
79
65
 
80
66
  CMD bundle exec sidekiq
67
+
68
+
69
+ FROM hyrax-worker-base as hyrax-worker
70
+
71
+ ARG APP_PATH=.
72
+ ARG BUNDLE_WITHOUT="development test"
73
+
74
+ ONBUILD COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
75
+ ONBUILD RUN bundle install --jobs "$(nproc)"
76
+ ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
77
+
78
+
79
+ FROM hyrax-base as hyrax-engine-dev
80
+
81
+ ARG APP_PATH=.dassie
82
+ ARG BUNDLE_WITHOUT=
83
+
84
+ ENV HYRAX_ENGINE_PATH /app/samvera/hyrax-engine
85
+
86
+ COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
87
+ COPY --chown=1001:101 . /app/samvera/hyrax-engine
88
+
89
+ RUN gem update bundler && gem cleanup bundler && bundle -v && \
90
+ bundle install --jobs "$(nproc)" && \
91
+ cd $HYRAX_ENGINE_PATH && bundle install --jobs "$(nproc)"
92
+ RUN RAILS_ENV=production SECRET_KEY_BASE='fakesecret1234' DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
93
+
94
+
95
+ FROM hyrax-worker-base as hyrax-engine-dev-worker
96
+
97
+ ARG APP_PATH=.dassie
98
+ ARG BUNDLE_WITHOUT=
99
+
100
+ ENV HYRAX_ENGINE_PATH /app/samvera/hyrax-engine
101
+
102
+ COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
103
+ COPY --chown=1001:101 . /app/samvera/hyrax-engine
104
+
105
+ RUN bundle install --jobs "$(nproc)"
data/Gemfile CHANGED
@@ -1,44 +1,38 @@
1
1
  # frozen_string_literal: true
2
- source 'https://rubygems.org' do
3
- # Please see hyrax.gemspec for dependency information.
4
- gemspec
2
+ source 'https://rubygems.org'
3
+ # Please see hyrax.gemspec for dependency information.
4
+ gemspec
5
5
 
6
- group :development, :test do
7
- gem 'benchmark-ips'
8
- gem 'easy_translate'
9
- gem 'i18n-tasks'
10
- gem 'okcomputer'
11
- gem 'pry' unless ENV['CI']
12
- gem 'pry-byebug' unless ENV['CI']
13
- gem 'ruby-prof', require: false
14
- gem "simplecov", require: false
15
- end
6
+ group :development, :test do
7
+ gem 'benchmark-ips'
8
+ gem 'easy_translate'
9
+ gem 'i18n-tasks'
10
+ gem 'okcomputer'
11
+ gem 'pry' unless ENV['CI']
12
+ gem 'pry-byebug' unless ENV['CI']
13
+ gem 'ruby-prof', require: false
14
+ gem "simplecov", require: false
16
15
  end
17
16
 
18
17
  test_app_path = ENV['RAILS_ROOT'] ||
19
18
  ENV.fetch('ENGINE_CART_DESTINATION', File.expand_path('.internal_test_app', File.dirname(__FILE__)))
20
19
  test_app_gemfile = File.expand_path('Gemfile', test_app_path)
21
20
 
21
+ # rubocop:disable Bundler/DuplicatedGem
22
22
  if File.exist?(test_app_gemfile)
23
23
  begin
24
+ Bundler.ui.info "[Hyrax] Including test application dependencies from #{test_app_gemfile}"
24
25
  eval_gemfile test_app_gemfile
25
26
  rescue Bundler::GemfileError => e
26
27
  Bundler.ui.warn '[Hyrax] Skipping Rails application dependencies:'
27
28
  Bundler.ui.warn e.message
28
29
  end
30
+ elsif ENV['RAILS_VERSION'] == 'edge'
31
+ gem 'rails', github: 'rails/rails', source: 'https://rubygems.org'
32
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
33
+ elsif ENV['RAILS_VERSION']
34
+ gem 'rails', ENV['RAILS_VERSION'], source: 'https://rubygems.org'
29
35
  else
30
- Bundler.ui.warn "[Hyrax] Unable to find test application dependencies in #{test_app_gemfile}, using placeholder dependencies"
31
-
32
- # rubocop:disable Bundler/DuplicatedGem
33
- if ENV['RAILS_VERSION']
34
- if ENV['RAILS_VERSION'] == 'edge'
35
- gem 'rails', github: 'rails/rails', source: 'https://rubygems.org'
36
- ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
37
- else
38
- gem 'rails', ENV['RAILS_VERSION'], source: 'https://rubygems.org'
39
- end
40
- end
41
- # rubocop:enable Bundler/DuplicatedGem
42
-
43
- eval_gemfile File.expand_path('spec/test_app_templates/Gemfile.extra', File.dirname(__FILE__))
36
+ Bundler.ui.warn '[Hyrax] Skipping all Rails dependency injection'
44
37
  end
38
+ # rubocop:enable Bundler/DuplicatedGem
@@ -37,7 +37,7 @@ module Hyrax
37
37
  # @return [Boolean] true if destroy was successful
38
38
  def destroy(env)
39
39
  env.curation_concern.in_collection_ids.each do |id|
40
- destination_collection = ::Collection.find(id)
40
+ destination_collection = Hyrax.config.collection_class.find(id)
41
41
  destination_collection.members.delete(env.curation_concern)
42
42
  destination_collection.update_index
43
43
  end
@@ -95,7 +95,7 @@ module Hyrax
95
95
  def clean_attributes(attributes)
96
96
  attributes[:license] = Array(attributes[:license]) if attributes.key? :license
97
97
  attributes[:rights_statement] = Array(attributes[:rights_statement]) if attributes.key? :rights_statement
98
- remove_blank_attributes!(attributes)
98
+ remove_blank_attributes!(attributes).except('file_set')
99
99
  end
100
100
 
101
101
  # If any attributes are blank remove them
@@ -69,7 +69,7 @@ module Hyrax
69
69
  # Adds the item to the ordered members so that it displays in the items
70
70
  # along side the FileSets on the show page
71
71
  def add(env, id)
72
- collection = ::Collection.find(id)
72
+ collection = Hyrax.config.collection_class.find(id)
73
73
  collection.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX
74
74
 
75
75
  return unless env.current_ability.can?(:deposit, collection)
@@ -78,7 +78,7 @@ module Hyrax
78
78
 
79
79
  # Remove the object from the members set and the ordered members list
80
80
  def remove(curation_concern, id)
81
- collection = ::Collection.find(id)
81
+ collection = Hyrax.config.collection_class.find(id)
82
82
  curation_concern.member_of_collections.delete(collection)
83
83
  end
84
84
 
@@ -107,7 +107,7 @@ module Hyrax
107
107
  collection_id = attributes_collection.first.second['id']
108
108
 
109
109
  # Do not apply permissions to work if collection type is configured not to
110
- collection = ::Collection.find(collection_id)
110
+ collection = Hyrax.config.collection_class.find(collection_id)
111
111
  return unless collection.share_applies_to_new_works?
112
112
 
113
113
  # Save the collection id in env for use in apply_permission_template_actor