hyrax 3.1.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +8 -11
  3. data/.dassie/.env +1 -2
  4. data/.dassie/Gemfile +8 -4
  5. data/.dassie/app/controllers/catalog_controller.rb +6 -0
  6. data/.dassie/app/models/user.rb +0 -2
  7. data/.dassie/config/analytics.yml +12 -5
  8. data/.dassie/config/environments/development.rb +2 -0
  9. data/.dassie/config/initializers/hyrax.rb +13 -1
  10. data/.dassie/db/migrate/20210921150120_enable_uuid_extension.valkyrie_engine.rb +7 -0
  11. data/.dassie/db/migrate/20210921150121_create_orm_resources.valkyrie_engine.rb +19 -0
  12. data/.dassie/db/migrate/20210921150122_add_model_type_to_orm_resources.valkyrie_engine.rb +7 -0
  13. data/.dassie/db/migrate/20210921150123_change_model_type_to_internal_model.valkyrie_engine.rb +7 -0
  14. data/.dassie/db/migrate/20210921150124_create_path_gin_index.valkyrie_engine.rb +7 -0
  15. data/.dassie/db/migrate/20210921150125_create_internal_resource_index.valkyrie_engine.rb +7 -0
  16. data/.dassie/db/migrate/20210921150126_create_updated_at_index.valkyrie_engine.rb +7 -0
  17. data/.dassie/db/migrate/20210921150127_add_optimistic_locking_to_orm_resources.valkyrie_engine.rb +7 -0
  18. data/.dassie/db/migrate/20211130181150_create_default_administrative_set.rb +8 -0
  19. data/.dassie/db/schema.rb +20 -1
  20. data/.env +7 -4
  21. data/.github/workflows/main.yml +17 -0
  22. data/.github/workflows/release.yml +17 -0
  23. data/.gitignore +4 -0
  24. data/.regen +1 -1
  25. data/.rubocop_fixme.yml +3 -1
  26. data/CONTAINERS.md +13 -10
  27. data/Dockerfile +4 -4
  28. data/README.md +37 -0
  29. data/app/actors/hyrax/actors/base_actor.rb +1 -1
  30. data/app/actors/hyrax/actors/collections_membership_actor.rb +3 -3
  31. data/app/actors/hyrax/actors/file_actor.rb +6 -4
  32. data/app/actors/hyrax/actors/file_set_actor.rb +2 -0
  33. data/app/actors/hyrax/actors/transfer_request_actor.rb +3 -7
  34. data/app/assets/javascripts/hyrax/admin/graphs.es6 +34 -37
  35. data/app/assets/javascripts/hyrax/analytics_events.js +75 -0
  36. data/app/assets/javascripts/hyrax/autocomplete/linked_data.es6 +1 -3
  37. data/app/assets/javascripts/hyrax/collapse.js +24 -0
  38. data/app/assets/javascripts/hyrax/collections.js +1 -2
  39. data/app/assets/javascripts/hyrax/ga_events.js +2 -8
  40. data/app/assets/javascripts/hyrax/reports-buttons.js +33 -0
  41. data/app/assets/javascripts/hyrax.js +2 -1
  42. data/app/assets/stylesheets/_bootstrap-default-overrides.scss +9 -0
  43. data/app/assets/stylesheets/hyrax/_styles.scss +5 -0
  44. data/app/authorities/qa/authorities/collections.rb +4 -5
  45. data/app/authorities/qa/authorities/find_works.rb +1 -1
  46. data/app/controllers/concerns/hyrax/breadcrumbs_for_collection_analytics.rb +26 -0
  47. data/app/controllers/concerns/hyrax/breadcrumbs_for_works_analytics.rb +26 -0
  48. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +13 -5
  49. data/app/controllers/concerns/hyrax/controller.rb +56 -2
  50. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +83 -59
  51. data/app/controllers/hyrax/admin/admin_sets_controller.rb +105 -36
  52. data/app/controllers/hyrax/admin/analytics/analytics_controller.rb +40 -0
  53. data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +61 -0
  54. data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +122 -0
  55. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +17 -21
  56. data/app/controllers/hyrax/batch_edits_controller.rb +12 -3
  57. data/app/controllers/hyrax/batch_uploads_controller.rb +4 -0
  58. data/app/controllers/hyrax/citations_controller.rb +1 -1
  59. data/app/controllers/hyrax/collections_controller.rb +6 -1
  60. data/app/controllers/hyrax/dashboard/collection_members_controller.rb +12 -9
  61. data/app/controllers/hyrax/dashboard/collections_controller.rb +119 -37
  62. data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +75 -39
  63. data/app/controllers/hyrax/dashboard_controller.rb +8 -0
  64. data/app/controllers/hyrax/my_controller.rb +4 -4
  65. data/app/controllers/hyrax/stats_controller.rb +3 -1
  66. data/app/controllers/hyrax/workflow_actions_controller.rb +8 -5
  67. data/app/forms/hyrax/forms/administrative_set_form.rb +80 -0
  68. data/app/forms/hyrax/forms/batch_edit_form.rb +1 -1
  69. data/app/forms/hyrax/forms/collection_form.rb +2 -2
  70. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +33 -8
  71. data/app/forms/hyrax/forms/pcdm_collection_form.rb +68 -0
  72. data/app/forms/hyrax/forms/permission_template_form.rb +17 -9
  73. data/app/forms/hyrax/forms/resource_form.rb +24 -15
  74. data/app/forms/hyrax/forms/workflow_action_form.rb +4 -0
  75. data/app/helpers/hyrax/collections_helper.rb +14 -0
  76. data/app/helpers/hyrax/hyrax_helper_behavior.rb +9 -0
  77. data/app/helpers/hyrax/membership_helper.rb +1 -1
  78. data/app/helpers/hyrax/trophy_helper.rb +1 -1
  79. data/app/helpers/hyrax/url_helper.rb +1 -1
  80. data/app/indexers/hyrax/administrative_set_indexer.rb +12 -6
  81. data/app/indexers/hyrax/deep_indexing_service.rb +1 -1
  82. data/app/indexers/hyrax/file_set_indexer.rb +1 -0
  83. data/app/indexers/hyrax/pcdm_collection_indexer.rb +5 -1
  84. data/app/indexers/hyrax/thumbnail_indexer.rb +31 -0
  85. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +7 -7
  86. data/app/indexers/hyrax/valkyrie_indexer.rb +4 -2
  87. data/app/indexers/hyrax/valkyrie_work_indexer.rb +13 -0
  88. data/app/inputs/controlled_vocabulary_input.rb +2 -0
  89. data/app/jobs/change_depositor_event_job.rb +47 -0
  90. data/app/jobs/characterize_job.rb +66 -3
  91. data/app/jobs/concerns/hyrax/members_permission_job_behavior.rb +1 -1
  92. data/app/jobs/content_depositor_change_event_job.rb +2 -1
  93. data/app/jobs/hyrax/propagate_change_depositor_job.rb +32 -0
  94. data/app/jobs/inherit_permissions_job.rb +1 -1
  95. data/app/jobs/valkyrie_create_derivatives_job.rb +25 -0
  96. data/app/jobs/valkyrie_ingest_job.rb +124 -0
  97. data/app/models/admin_set.rb +18 -7
  98. data/app/models/collection_branding_info.rb +8 -6
  99. data/app/models/concerns/hyrax/ability/admin_set_ability.rb +31 -7
  100. data/app/models/concerns/hyrax/ability/collection_ability.rb +35 -20
  101. data/app/models/concerns/hyrax/ability/collection_type_ability.rb +1 -1
  102. data/app/models/concerns/hyrax/ability.rb +28 -7
  103. data/app/models/concerns/hyrax/collection_behavior.rb +2 -2
  104. data/app/models/concerns/hyrax/file_set/characterization.rb +7 -1
  105. data/app/models/concerns/hyrax/solr_document/metadata.rb +2 -0
  106. data/app/models/concerns/hyrax/solr_document_behavior.rb +11 -5
  107. data/app/models/file_download_stat.rb +4 -4
  108. data/app/models/hyrax/administrative_set.rb +43 -2
  109. data/app/models/hyrax/collection_type.rb +2 -2
  110. data/app/models/hyrax/default_administrative_set.rb +42 -0
  111. data/app/models/hyrax/file_metadata.rb +5 -1
  112. data/app/models/hyrax/file_set.rb +42 -1
  113. data/app/models/hyrax/pcdm_collection.rb +56 -0
  114. data/app/models/hyrax/permission.rb +1 -1
  115. data/app/models/hyrax/permission_template.rb +30 -10
  116. data/app/models/hyrax/statistic.rb +31 -4
  117. data/app/models/hyrax/work.rb +92 -0
  118. data/app/models/hyrax/workflow_action_info.rb +16 -0
  119. data/app/models/proxy_deposit_request.rb +1 -1
  120. data/app/models/sipity/comment.rb +17 -0
  121. data/app/models/sipity.rb +11 -2
  122. data/app/presenters/hyrax/admin/dashboard_presenter.rb +8 -6
  123. data/app/presenters/hyrax/admin/repository_growth_presenter.rb +10 -5
  124. data/app/presenters/hyrax/admin/user_activity_presenter.rb +8 -12
  125. data/app/presenters/hyrax/admin_set_presenter.rb +10 -5
  126. data/app/presenters/hyrax/collection_presenter.rb +3 -3
  127. data/app/presenters/hyrax/file_set_presenter.rb +2 -0
  128. data/app/presenters/hyrax/menu_presenter.rb +4 -0
  129. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +3 -3
  130. data/app/presenters/hyrax/work_show_presenter.rb +11 -3
  131. data/app/presenters/hyrax/work_usage.rb +1 -0
  132. data/app/search_builders/hyrax/README.md +1 -1
  133. data/app/search_builders/hyrax/abstract_type_relation.rb +4 -2
  134. data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +2 -2
  135. data/app/search_builders/hyrax/dashboard/managed_search_filters.rb +44 -4
  136. data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +2 -2
  137. data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
  138. data/app/search_builders/hyrax/filter_by_type.rb +1 -2
  139. data/app/search_builders/hyrax/my/collections_search_builder.rb +12 -5
  140. data/app/services/hyrax/access_control_list.rb +13 -0
  141. data/app/services/hyrax/admin_set_create_service.rb +179 -51
  142. data/app/services/hyrax/analytics/google/events.rb +37 -0
  143. data/app/services/hyrax/analytics/google/events_daily.rb +72 -0
  144. data/app/services/hyrax/analytics/google/visits.rb +44 -0
  145. data/app/services/hyrax/analytics/google/visits_daily.rb +49 -0
  146. data/app/services/hyrax/analytics/google.rb +204 -0
  147. data/app/services/hyrax/analytics/matomo.rb +193 -0
  148. data/app/services/hyrax/analytics/results.rb +79 -0
  149. data/app/services/hyrax/analytics.rb +12 -82
  150. data/app/services/hyrax/change_content_depositor_service.rb +2 -2
  151. data/app/services/hyrax/change_depositor_service.rb +70 -0
  152. data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +134 -0
  153. data/app/services/hyrax/collection_types/permissions_service.rb +1 -1
  154. data/app/services/hyrax/collections/collection_member_service.rb +12 -2
  155. data/app/services/hyrax/collections/nested_collection_query_service.rb +31 -14
  156. data/app/services/hyrax/collections/permissions_create_service.rb +81 -79
  157. data/app/services/hyrax/collections/permissions_service.rb +1 -1
  158. data/app/services/hyrax/curation_concern.rb +24 -2
  159. data/app/services/hyrax/custom_queries/navigators/child_file_sets_navigator.rb +45 -0
  160. data/app/services/hyrax/custom_queries/navigators/child_filesets_navigator.rb +7 -2
  161. data/app/services/hyrax/custom_queries/navigators/parent_work_navigator.rb +54 -0
  162. data/app/services/hyrax/default_middleware_stack.rb +14 -0
  163. data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +3 -3
  164. data/app/services/hyrax/file_set_derivatives_service.rb +21 -2
  165. data/app/services/hyrax/file_set_type_service.rb +2 -5
  166. data/app/services/hyrax/listeners/acl_index_listener.rb +3 -1
  167. data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +4 -1
  168. data/app/services/hyrax/listeners/batch_notification_listener.rb +3 -1
  169. data/app/services/hyrax/listeners/file_metadata_listener.rb +38 -0
  170. data/app/services/hyrax/listeners/file_set_lifecycle_listener.rb +6 -2
  171. data/app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb +6 -2
  172. data/app/services/hyrax/listeners/member_cleanup_listener.rb +26 -3
  173. data/app/services/hyrax/listeners/metadata_index_listener.rb +72 -11
  174. data/app/services/hyrax/listeners/object_lifecycle_listener.rb +9 -3
  175. data/app/services/hyrax/listeners/proxy_deposit_listener.rb +16 -8
  176. data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +3 -0
  177. data/app/services/hyrax/listeners/workflow_listener.rb +3 -1
  178. data/app/services/hyrax/listeners.rb +8 -0
  179. data/app/services/hyrax/location_service.rb +33 -0
  180. data/app/services/hyrax/multiple_membership_checker.rb +44 -1
  181. data/app/services/hyrax/permission_manager.rb +4 -4
  182. data/app/services/hyrax/resource_visibility_propagator.rb +1 -1
  183. data/app/services/hyrax/restriction_service.rb +4 -0
  184. data/app/services/hyrax/simple_schema_loader.rb +5 -1
  185. data/app/services/hyrax/solr_query_service.rb +12 -7
  186. data/app/services/hyrax/solr_service.rb +1 -1
  187. data/app/services/hyrax/statistics/collections/over_time.rb +2 -1
  188. data/app/services/hyrax/statistics/users/over_time.rb +8 -5
  189. data/app/services/hyrax/statistics/works/over_time.rb +10 -0
  190. data/app/services/hyrax/thumbnail_path_service.rb +1 -1
  191. data/app/services/hyrax/work_uploads_handler.rb +2 -9
  192. data/app/services/hyrax/workflow/abstract_notification.rb +2 -2
  193. data/app/services/hyrax/workflow/action_taken_service.rb +16 -4
  194. data/app/services/hyrax/workflow/activate_object.rb +5 -4
  195. data/app/services/hyrax/workflow/changes_required_notification.rb +5 -4
  196. data/app/services/hyrax/workflow/deactivate_object.rb +7 -5
  197. data/app/services/hyrax/workflow/deposited_notification.rb +8 -4
  198. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +7 -3
  199. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +10 -3
  200. data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +8 -2
  201. data/app/services/hyrax/workflow/workflow_action_service.rb +4 -1
  202. data/app/validators/hyrax/collection_membership_validator.rb +38 -0
  203. data/app/views/catalog/_index_header_list_hyrax_pcdm_collection.html.erb +4 -0
  204. data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
  205. data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +2 -2
  206. data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +2 -2
  207. data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +2 -2
  208. data/app/views/hyrax/admin/admin_sets/_form_workflow.erb +1 -1
  209. data/app/views/hyrax/admin/analytics/_date_range_form.html.erb +11 -0
  210. data/app/views/hyrax/admin/analytics/collection_reports/_custom_range.html.erb +39 -0
  211. data/app/views/hyrax/admin/analytics/collection_reports/_monthly_summary.html.erb +48 -0
  212. data/app/views/hyrax/admin/analytics/collection_reports/_summary.html.erb +55 -0
  213. data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +55 -0
  214. data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +70 -0
  215. data/app/views/hyrax/admin/analytics/collection_reports/show.html.erb +94 -0
  216. data/app/views/hyrax/admin/analytics/work_reports/_custom_range.html.erb +43 -0
  217. data/app/views/hyrax/admin/analytics/work_reports/_monthly_summary.html.erb +35 -0
  218. data/app/views/hyrax/admin/analytics/work_reports/_summary.html.erb +60 -0
  219. data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +33 -0
  220. data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +40 -0
  221. data/app/views/hyrax/admin/analytics/work_reports/_work_counts.html.erb +18 -0
  222. data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +41 -0
  223. data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +77 -0
  224. data/app/views/hyrax/admin/analytics/work_reports/show.html.erb +90 -0
  225. data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
  226. data/app/views/hyrax/admin/stats/show.html.erb +1 -1
  227. data/app/views/hyrax/base/_form.html.erb +1 -1
  228. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
  229. data/app/views/hyrax/base/_relationships_parent_row.html.erb +0 -1
  230. data/app/views/hyrax/base/show.html.erb +6 -0
  231. data/app/views/hyrax/collections/show.html.erb +4 -0
  232. data/app/views/hyrax/dashboard/_repository_growth.html.erb +5 -5
  233. data/app/views/hyrax/dashboard/_resource_type_graph.html.erb +41 -0
  234. data/app/views/hyrax/dashboard/_sidebar.html.erb +4 -1
  235. data/app/views/hyrax/dashboard/_tabs.html.erb +11 -0
  236. data/app/views/hyrax/dashboard/_user_activity.html.erb +17 -23
  237. data/app/views/hyrax/dashboard/_user_activity_graph.html.erb +55 -0
  238. data/app/views/hyrax/dashboard/_visibility_graph.html.erb +31 -0
  239. data/app/views/hyrax/dashboard/_work_type_graph.html.erb +41 -0
  240. data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +1 -1
  241. data/app/views/hyrax/dashboard/collections/_default_group.html.erb +2 -2
  242. data/app/views/hyrax/dashboard/collections/_form.html.erb +24 -17
  243. data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +6 -3
  244. data/app/views/hyrax/dashboard/collections/_form_share.html.erb +2 -2
  245. data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +3 -3
  246. data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +2 -2
  247. data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
  248. data/app/views/hyrax/dashboard/show_admin.html.erb +24 -45
  249. data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +22 -0
  250. data/app/views/hyrax/dashboard/works/_default_group.html.erb +1 -1
  251. data/app/views/hyrax/dashboard/works/_list_works.html.erb +1 -1
  252. data/app/views/hyrax/file_sets/_actions.html.erb +4 -3
  253. data/app/views/hyrax/file_sets/show.html.erb +6 -0
  254. data/app/views/hyrax/homepage/index.html.erb +1 -1
  255. data/app/views/hyrax/my/_work_action_menu.html.erb +8 -9
  256. data/app/views/hyrax/my/collections/_default_group.html.erb +2 -2
  257. data/app/views/hyrax/my/collections/_list_collections.html.erb +2 -2
  258. data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +1 -1
  259. data/app/views/hyrax/my/collections/index.html.erb +4 -3
  260. data/app/views/hyrax/my/works/_default_group.html.erb +1 -1
  261. data/app/views/hyrax/my/works/_list_works.html.erb +1 -2
  262. data/app/views/hyrax/my/works/index.html.erb +4 -2
  263. data/app/views/hyrax/stats/_downloads.html.erb +18 -0
  264. data/app/views/hyrax/stats/_pageviews.html.erb +18 -0
  265. data/app/views/hyrax/stats/work.html.erb +17 -9
  266. data/app/views/layouts/_head_tag_content.html.erb +7 -2
  267. data/app/views/layouts/hyrax/dashboard.html.erb +1 -0
  268. data/app/views/layouts/hyrax.html.erb +1 -0
  269. data/app/views/{_ga.html.erb → shared/_ga.html.erb} +3 -7
  270. data/app/views/shared/_matomo.html.erb +15 -0
  271. data/app/views/shared/_read_only.html.erb +5 -0
  272. data/chart/hyrax/Chart.yaml +2 -2
  273. data/chart/hyrax/README.md +22 -1
  274. data/chart/hyrax/templates/deployment.yaml +6 -0
  275. data/chart/hyrax/values.yaml +1 -1
  276. data/config/features.rb +3 -0
  277. data/config/i18n-tasks.yml +2 -2
  278. data/config/initializers/1_healthz.rb +1 -0
  279. data/config/initializers/listeners.rb +5 -5
  280. data/config/locales/hyrax.de.yml +200 -5
  281. data/config/locales/hyrax.en.yml +202 -21
  282. data/config/locales/hyrax.es.yml +204 -9
  283. data/config/locales/hyrax.fr.yml +196 -1
  284. data/config/locales/hyrax.it.yml +197 -2
  285. data/config/locales/hyrax.pt-BR.yml +196 -1
  286. data/config/locales/hyrax.zh.yml +196 -1
  287. data/config/metadata/basic_metadata.yaml +2 -0
  288. data/config/metadata/core_metadata.yaml +1 -1
  289. data/config/routes.rb +4 -0
  290. data/db/seeds.rb +1 -1
  291. data/docker-compose.yml +48 -42
  292. data/documentation/developing-your-hyrax-based-app.md +2 -2
  293. data/documentation/legacyREADME.md +1 -1
  294. data/hyrax.gemspec +4 -2
  295. data/lib/generators/hyrax/templates/catalog_controller.rb +3 -1
  296. data/lib/generators/hyrax/templates/config/analytics.yml +13 -7
  297. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +10 -13
  298. data/lib/generators/hyrax/templates/db/migrate/20211130181150_create_default_administrative_set.rb.erb +8 -0
  299. data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +4 -2
  300. data/lib/generators/hyrax/work_resource/templates/indexer_spec.rb.erb +1 -0
  301. data/lib/hyrax/administrative_set_name.rb +18 -0
  302. data/lib/hyrax/collection_name.rb +8 -2
  303. data/lib/hyrax/configuration.rb +104 -4
  304. data/lib/hyrax/controlled_vocabularies/location.rb +9 -2
  305. data/lib/hyrax/controlled_vocabularies/resource_label_caching.rb +42 -0
  306. data/lib/hyrax/controlled_vocabularies.rb +1 -0
  307. data/lib/hyrax/engine.rb +7 -6
  308. data/lib/hyrax/form_fields.rb +1 -0
  309. data/lib/hyrax/publisher.rb +61 -0
  310. data/lib/hyrax/resource_sync/change_list_writer.rb +2 -2
  311. data/lib/hyrax/resource_sync/resource_list_writer.rb +2 -2
  312. data/lib/hyrax/specs/capybara.rb +1 -1
  313. data/lib/hyrax/specs/shared_specs/hydra_works.rb +13 -4
  314. data/lib/hyrax/specs/shared_specs/indexers.rb +120 -0
  315. data/lib/hyrax/transactions/admin_set_create.rb +23 -0
  316. data/lib/hyrax/transactions/admin_set_destroy.rb +22 -0
  317. data/lib/hyrax/transactions/admin_set_update.rb +21 -0
  318. data/lib/hyrax/transactions/collection_create.rb +25 -0
  319. data/lib/hyrax/transactions/collection_destroy.rb +22 -0
  320. data/lib/hyrax/transactions/collection_update.rb +21 -0
  321. data/lib/hyrax/transactions/container.rb +118 -17
  322. data/lib/hyrax/transactions/create_work.rb +3 -0
  323. data/lib/hyrax/transactions/destroy_work.rb +3 -0
  324. data/lib/hyrax/transactions/steps/add_to_collections.rb +13 -1
  325. data/lib/hyrax/transactions/steps/apply_collection_permission_template.rb +2 -0
  326. data/lib/hyrax/transactions/steps/apply_collection_type_permissions.rb +29 -0
  327. data/lib/hyrax/transactions/steps/apply_permission_template.rb +2 -0
  328. data/lib/hyrax/transactions/steps/apply_visibility.rb +2 -0
  329. data/lib/hyrax/transactions/steps/change_depositor.rb +46 -0
  330. data/lib/hyrax/transactions/steps/check_for_empty_admin_set.rb +36 -0
  331. data/lib/hyrax/transactions/steps/delete_access_control.rb +32 -0
  332. data/lib/hyrax/transactions/steps/delete_resource.rb +19 -3
  333. data/lib/hyrax/transactions/steps/destroy_work.rb +3 -1
  334. data/lib/hyrax/transactions/steps/ensure_permission_template.rb +2 -0
  335. data/lib/hyrax/transactions/steps/save.rb +37 -7
  336. data/lib/hyrax/transactions/steps/save_access_control.rb +2 -2
  337. data/lib/hyrax/transactions/steps/save_work.rb +3 -0
  338. data/lib/hyrax/transactions/steps/set_collection_type_gid.rb +35 -0
  339. data/lib/hyrax/transactions/steps/set_user_as_creator.rb +41 -0
  340. data/lib/hyrax/transactions/steps/update_work_members.rb +51 -0
  341. data/lib/hyrax/transactions/update_work.rb +4 -3
  342. data/lib/hyrax/transactions/work_create.rb +1 -1
  343. data/lib/hyrax/transactions/work_destroy.rb +2 -1
  344. data/lib/hyrax/transactions/work_update.rb +19 -0
  345. data/lib/hyrax/version.rb +1 -1
  346. data/lib/tasks/default_admin_set.rake +12 -11
  347. data/lib/tasks/regenerate_derivatives.rake +1 -1
  348. data/lib/wings/attribute_transformer.rb +5 -1
  349. data/lib/wings/setup.rb +18 -1
  350. data/lib/wings/valkyrie/persister.rb +16 -0
  351. data/lib/wings/valkyrie/query_service.rb +2 -1
  352. data/lib/wings/valkyrie/storage.rb +7 -1
  353. data/template.rb +1 -1
  354. data/vendor/assets/javascripts/morris/morris.min.js +1 -7
  355. data/vendor/assets/stylesheets/morris.js/0.5.1/morris.css +1 -1
  356. metadata +121 -17
  357. data/app/views/hyrax/dashboard/_repository_objects.html.erb +0 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea0970bcb0ea485337ce206cd398d9ca95ce9f5dbd22bda820b6112e089ed624
4
- data.tar.gz: c58183be603ec7ac6af52523412034f3b28332b2b8d5aa788239e7dabbf4c521
3
+ metadata.gz: 4fa4543b3224a41244d522ea1eedff364bc5a611766952b7f75472c438b4fff1
4
+ data.tar.gz: 19c28428038b672908944c5ad30dd144eabc934e80ecfa5c1d080d6144e7df9d
5
5
  SHA512:
6
- metadata.gz: af2b27f2c10d54ede9007a17f4a126bf408d92c163a924081658625212ff52edccb06bbc7edcf49fce1faa56c715bdf0454f687fbc284f93cfd8d30dbb26d46a
7
- data.tar.gz: 85b38c0dc2628abbbb56dc8aed70461bb5fe6e9ce4444a2d61d6f972968efd1f9157881fc2a5f4443cb1bba85f0495b78e3bc2e7d0d7fe5ea9a8d4cb69d6946b
6
+ metadata.gz: 697a6d11f891fe1a0c42997fb80d49ab94810779745c7472670b9c32bd09d49283ceddb5736d1d5652efc9d5ac21e9dffb416fa2e75c300954c5cb529034a82c
7
+ data.tar.gz: efe3443f9e7e285713ff9c53661f5202748fc0613c9282dc07d834e8802c052a3551d617460d2b1975493b9ab065b0d9c66e9bfd0561fe1aef996821093f6526
data/.circleci/config.yml CHANGED
@@ -33,10 +33,9 @@ jobs:
33
33
  fi
34
34
  [[ -z "$(git branch --all --list master */master)" ]]
35
35
 
36
- - samvera/bundle_for_gem:
36
+ - samvera/bundle:
37
37
  ruby_version: << parameters.ruby_version >>
38
38
  bundler_version: << parameters.bundler_version >>
39
- project: hyrax
40
39
 
41
40
  # Run rubocop in parallel with caching
42
41
  # This should get added to the orb once proven here
@@ -89,10 +88,9 @@ jobs:
89
88
  at: ~/
90
89
  - samvera/engine_cart_generate:
91
90
  cache_key: v1-internal-test-app-{{ checksum "hyrax.gemspec" }}-{{ checksum ".regen" }}-{{ checksum ".circleci/config.yml" }}-<< parameters.rails_version >>-<< parameters.ruby_version >>
92
- - samvera/bundle_for_gem:
91
+ - samvera/bundle:
93
92
  ruby_version: << parameters.ruby_version >>
94
93
  bundler_version: << parameters.bundler_version >>
95
- project: hyrax
96
94
  - persist_to_workspace:
97
95
  root: ~/
98
96
  paths:
@@ -128,10 +126,9 @@ jobs:
128
126
  solr_config_path: .internal_test_app/solr/conf
129
127
  core_name: hyrax-valkyrie-test
130
128
  # Rerun bundler in case this is a different ruby version than bundle and build steps
131
- - samvera/bundle_for_gem:
129
+ - samvera/bundle:
132
130
  ruby_version: << parameters.ruby_version >>
133
131
  bundler_version: << parameters.bundler_version >>
134
- project: hyrax
135
132
  - run:
136
133
  command: bundle exec rake app:db:migrate
137
134
  - samvera/parallel_rspec
@@ -189,21 +186,21 @@ workflows:
189
186
  hyrax_valkyrie: "true"
190
187
  requires:
191
188
  - build
192
- ruby2-7-2:
189
+ ruby2-7-4:
193
190
  jobs:
194
191
  - bundle:
195
- ruby_version: "2.7.2"
192
+ ruby_version: "2.7.4"
196
193
  rails_version: "5.2.6"
197
194
  bundler_version: "2.1.4"
198
195
  - build:
199
- ruby_version: "2.7.2"
196
+ ruby_version: "2.7.4"
200
197
  rails_version: "5.2.6"
201
198
  bundler_version: "2.1.4"
202
199
  requires:
203
200
  - bundle
204
201
  - test:
205
- name: "ruby2-7-2"
206
- ruby_version: "2.7.2"
202
+ name: "ruby2-7-4"
203
+ ruby_version: "2.7.4"
207
204
  bundler_version: "2.1.4"
208
205
  requires:
209
206
  - build
data/.dassie/.env CHANGED
@@ -1,4 +1,3 @@
1
1
  MEMCACHED_HOST=memcached
2
- HYRAX_ANALYTICS=1
3
2
  REDIS_PROVIDER=SIDEKIQ_REDIS_URL
4
- SIDEKIQ_REDIS_URL=redis://redis:6379/0
3
+ SIDEKIQ_REDIS_URL=redis://redis:6379/0
data/.dassie/Gemfile CHANGED
@@ -8,7 +8,7 @@ else
8
8
  end
9
9
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
10
10
 
11
- ruby '2.7.2'
11
+ ruby '2.7.4'
12
12
 
13
13
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
14
14
  gem 'rails', '~> 5.2.4', '>= 5.2.4.4'
@@ -52,11 +52,15 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
52
52
 
53
53
  gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
54
54
 
55
- gem 'rsolr', '>= 1.0', '< 3'
56
55
  gem 'bootstrap-sass', '~> 3.0'
57
- gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
58
- gem 'jquery-rails'
59
56
  gem 'devise'
60
57
  gem 'devise-guests', '~> 0.6'
58
+ gem 'jquery-rails'
59
+ gem 'pry-byebug'
60
+ gem 'pry-doc'
61
+ gem 'pry-rails'
62
+ gem 'pry-rescue'
61
63
  gem 'riiif', '~> 2.1'
64
+ gem 'rsolr', '>= 1.0', '< 3'
62
65
  gem 'sidekiq', '~> 6.0'
66
+ gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
@@ -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",
@@ -5,8 +5,6 @@ class User < ApplicationRecord
5
5
  include Hyrax::User
6
6
  include Hyrax::UserUsageStats
7
7
 
8
-
9
-
10
8
  if Blacklight::Utils.needs_attr_accessible?
11
9
  attr_accessible :email, :password, :password_confirmation
12
10
  end
@@ -1,6 +1,13 @@
1
1
  analytics:
2
- app_name: My App Name
3
- app_version: 0.0.1
4
- privkey_path: /tmp/privkey.p12
5
- privkey_secret: s00pers3kr1t
6
- client_email: oauth@example.org
2
+ google:
3
+ analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
4
+ app_name: <%= ENV['GOOGLE_OAUTH_APP_NAME'] %>
5
+ app_version: <%= ENV['GOOGLE_OAUTH_APP_VERSION'] %>
6
+ privkey_path: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
7
+ privkey_secret: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
8
+ client_email: <%= ENV['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
9
+ matomo:
10
+ base_url: <%= ENV['MATOMO_BASE_URL'] %>
11
+ site_id: <%= ENV['MATOMO_SITE_ID'] %>
12
+ auth_token: <%= ENV['MATOMO_AUTH_TOKEN'] %>
13
+
@@ -29,6 +29,8 @@ Rails.application.configure do
29
29
  config.cache_store = :null_store
30
30
  end
31
31
 
32
+ config.web_console.whitelisted_ips = ['172.18.0.0/16', '172.27.0.0/16', '0.0.0.0/0']
33
+
32
34
  # Store uploaded files on the local file system (see config/storage.yml for options)
33
35
  config.active_storage.service = :local
34
36
 
@@ -5,6 +5,8 @@ Hyrax.config do |config|
5
5
  # Defaults to false. See README for more info
6
6
  config.arkivo_api = true
7
7
 
8
+ config.analytics = ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_ANALYTICS', 'false'))
9
+ config.analytics_provider = ENV.fetch('HYRAX_ANALYTICS_PROVIDER', 'google')
8
10
  # Injected via `rails g hyrax:work GenericWork`
9
11
  config.register_curation_concern :generic_work
10
12
  # Injected via `rails g hyrax:work NamespacedWorks::NestedWork`
@@ -13,6 +15,8 @@ Hyrax.config do |config|
13
15
  config.register_curation_concern :monograph
14
16
 
15
17
  config.iiif_image_server = true
18
+ config.work_requires_files = false
19
+ config.citations = true
16
20
 
17
21
  # Returns a URL that resolves to an image provided by a IIIF image server
18
22
  config.iiif_image_url_builder = lambda do |file_id, base_url, size, format|
@@ -36,14 +40,22 @@ Hyrax.config do |config|
36
40
  config.browse_everything = nil
37
41
  end
38
42
 
43
+ # config.geonames_username = ''
44
+
39
45
  ##
40
46
  # Set the system-wide virus scanner
41
47
  config.virus_scanner = Hyrax::VirusScanner
42
48
 
43
49
  ##
44
- # To index to the Valkyrie core, uncomment the following two lines.
50
+ # To index to the Valkyrie core, uncomment the following lines.
45
51
  # config.query_index_from_valkyrie = true
46
52
  # config.index_adapter = :solr_index
53
+
54
+ ##
55
+ # NOTE: To Valkyrie works, use Monograph which is_a Hyrax::Work is_a Valkyrie::Resource
56
+ # To use Valkyrie models, uncomment the following lines.
57
+ # config.collection_model = 'Hyrax::PcdmCollection'
58
+ # config.admin_set_model = 'Hyrax::AdministrativeSet'
47
59
  end
48
60
 
49
61
  Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20160111215816)
3
+ class EnableUuidExtension < ActiveRecord::Migration[5.0]
4
+ def change
5
+ enable_extension 'uuid-ossp'
6
+ end
7
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20161007101725)
3
+ class CreateOrmResources < ActiveRecord::Migration[5.0]
4
+ def options
5
+ if ENV["VALKYRIE_ID_TYPE"] == "string"
6
+ { id: :text, default: -> { '(uuid_generate_v4())::text' } }
7
+ else
8
+ { id: :uuid }
9
+ end
10
+ end
11
+
12
+ def change
13
+ create_table :orm_resources, **options do |t|
14
+ t.jsonb :metadata, null: false, default: {}
15
+ t.timestamps
16
+ end
17
+ add_index :orm_resources, :metadata, using: :gin
18
+ end
19
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20170124135846)
3
+ class AddModelTypeToOrmResources < ActiveRecord::Migration[5.0]
4
+ def change
5
+ add_column :orm_resources, :resource_type, :string
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20170531004548)
3
+ class ChangeModelTypeToInternalModel < ActiveRecord::Migration[5.1]
4
+ def change
5
+ rename_column :orm_resources, :resource_type, :internal_resource
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20171011224121)
3
+ class CreatePathGinIndex < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_index :orm_resources, 'metadata jsonb_path_ops', using: :gin
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20171204224121)
3
+ class CreateInternalResourceIndex < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_index :orm_resources, :internal_resource
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20180212092225)
3
+ class CreateUpdatedAtIndex < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_index :orm_resources, :updated_at
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20180802220739)
3
+ class AddOptimisticLockingToOrmResources < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :orm_resources, :lock_version, :integer
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ class CreateDefaultAdministrativeSet < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :hyrax_default_administrative_set do |t|
4
+ t.string :default_admin_set_id, null: false
5
+ t.timestamps null: false
6
+ end
7
+ end
8
+ end
data/.dassie/db/schema.rb CHANGED
@@ -10,10 +10,11 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2020_08_21_212903) do
13
+ ActiveRecord::Schema.define(version: 2021_11_30_181150) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
17
+ enable_extension "uuid-ossp"
17
18
 
18
19
  create_table "bookmarks", id: :serial, force: :cascade do |t|
19
20
  t.integer "user_id", null: false
@@ -139,6 +140,12 @@ ActiveRecord::Schema.define(version: 2020_08_21_212903) do
139
140
  t.index ["machine_id"], name: "index_hyrax_collection_types_on_machine_id", unique: true
140
141
  end
141
142
 
143
+ create_table "hyrax_default_administrative_set", force: :cascade do |t|
144
+ t.string "default_admin_set_id", null: false
145
+ t.datetime "created_at", null: false
146
+ t.datetime "updated_at", null: false
147
+ end
148
+
142
149
  create_table "hyrax_features", force: :cascade do |t|
143
150
  t.string "key", null: false
144
151
  t.boolean "enabled", default: false, null: false
@@ -225,6 +232,18 @@ ActiveRecord::Schema.define(version: 2020_08_21_212903) do
225
232
  t.index ["namespace"], name: "index_minter_states_on_namespace", unique: true
226
233
  end
227
234
 
235
+ create_table "orm_resources", id: :uuid, default: -> { "uuid_generate_v4()" }, force: :cascade do |t|
236
+ t.jsonb "metadata", default: {}, null: false
237
+ t.datetime "created_at", null: false
238
+ t.datetime "updated_at", null: false
239
+ t.string "internal_resource"
240
+ t.integer "lock_version"
241
+ t.index ["internal_resource"], name: "index_orm_resources_on_internal_resource"
242
+ t.index ["metadata"], name: "index_orm_resources_on_metadata", using: :gin
243
+ t.index ["metadata"], name: "index_orm_resources_on_metadata_jsonb_path_ops", opclass: :jsonb_path_ops, using: :gin
244
+ t.index ["updated_at"], name: "index_orm_resources_on_updated_at"
245
+ end
246
+
228
247
  create_table "permission_template_accesses", force: :cascade do |t|
229
248
  t.bigint "permission_template_id"
230
249
  t.string "agent_type"
data/.env CHANGED
@@ -1,14 +1,17 @@
1
+ ANALYTICS_START_DATE=2021-08-21
1
2
  CHROME_HEADLESS_MODE=false
2
3
  DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
3
4
  DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
4
5
  DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5
5
- DB_PORT=5432
6
6
  DB_HOST=postgres
7
- FCREPO_PORT=8080
7
+ DB_PORT=5432
8
8
  FCREPO_HOST=fcrepo
9
+ FCREPO_PORT=8080
9
10
  FCREPO_REST_PATH=rest
10
11
  FCREPO_TEST_BASE_PATH=/test
11
12
  HUB_URL=http://chrome:4444/wd/hub
13
+ HYRAX_ANALYTICS=false
14
+ HYRAX_ANALYTICS_PROVIDER=google
12
15
  HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
13
16
  HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
14
17
  HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/
@@ -17,9 +20,9 @@ RACK_ENV=development
17
20
  RAILS_ENV=development
18
21
  RAILS_ROOT=.dassie
19
22
  REDIS_HOST=redis
20
- SOLR_PORT=8983
21
23
  SOLR_HOST=solr
24
+ SOLR_PORT=8983
22
25
  SOLR_TEST_URL=http://solr:8983/solr/hyrax_test
23
26
  SOLR_URL=http://solr:8983/solr/hyrax
24
- VALKYRIE_SOLR_PORT=8983
25
27
  VALKYRIE_SOLR_HOST=solr
28
+ VALKYRIE_SOLR_PORT=8983
@@ -0,0 +1,17 @@
1
+ name: Trigger Nurax build
2
+ on:
3
+ workflow_dispatch:
4
+ push:
5
+
6
+ jobs:
7
+ trigger:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: peter-evans/repository-dispatch@v1
11
+ with:
12
+ token: ${{ secrets.NURAX_ACCESS_TOKEN }}
13
+ event-type: push
14
+ repository: curationexperts/nurax
15
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
16
+
17
+
@@ -0,0 +1,17 @@
1
+ name: Trigger Nurax build
2
+ on:
3
+ workflow_dispatch:
4
+ release:
5
+
6
+ jobs:
7
+ trigger:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: peter-evans/repository-dispatch@v1
11
+ with:
12
+ token: ${{ secrets.NURAX_ACCESS_TOKEN }}
13
+ event-type: release
14
+ repository: curationexperts/nurax
15
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
16
+
17
+
data/.gitignore CHANGED
@@ -49,6 +49,8 @@ coverage
49
49
  rdoc
50
50
  /.bundle
51
51
  tmp
52
+ /.idea
53
+
52
54
 
53
55
  *.log
54
56
  *~
@@ -71,6 +73,7 @@ db/schema.rb
71
73
 
72
74
  .*_app
73
75
  .byebug_history
76
+ .tool-versions
74
77
 
75
78
  ## Carried over from hyrax-models (RIP)
76
79
  *.gem
@@ -82,3 +85,4 @@ lib/bundler/man
82
85
  spec/reports
83
86
  /spec/examples.txt
84
87
  node_modules
88
+ .env.*
data/.regen CHANGED
@@ -1 +1 @@
1
- 36
1
+ 41
data/.rubocop_fixme.yml CHANGED
@@ -63,6 +63,7 @@ RSpec/ExampleLength:
63
63
  - 'spec/jobs/content_restored_version_event_job_spec.rb'
64
64
  - 'spec/jobs/content_new_version_event_job_spec.rb'
65
65
  - 'spec/jobs/content_depositor_change_event_job_spec.rb'
66
+ - 'spec/jobs/change_depositor_event_job_spec.rb'
66
67
  - 'spec/jobs/content_deposit_event_job_spec.rb'
67
68
  - 'spec/jobs/content_delete_event_job_spec.rb'
68
69
  - 'spec/jobs/ingest_file_job_spec.rb'
@@ -100,7 +101,6 @@ RSpec/SubjectStub:
100
101
  - 'spec/models/hyrax/operation_spec.rb'
101
102
  - 'spec/controllers/hyrax/accepts_batches_controller_spec.rb'
102
103
  - 'spec/indexers/hyrax/repository_reindexer_spec.rb'
103
- - 'spec/jobs/content_depositor_change_event_job_spec.rb'
104
104
  - 'spec/lib/hyrax/analytics_spec.rb'
105
105
  - 'spec/models/job_io_wrapper_spec.rb'
106
106
  - 'spec/search_builders/hyrax/abstract_type_relation_spec.rb'
@@ -114,6 +114,8 @@ RSpec/AnyInstance:
114
114
  - 'spec/controllers/hyrax/batch_edits_controller_spec.rb'
115
115
  - 'spec/controllers/hyrax/stats_controller_spec.rb'
116
116
  - 'spec/controllers/hyrax/users_controller_spec.rb'
117
+ - 'spec/hyrax/transactions/steps/delete_access_control_spec.rb'
118
+ - 'spec/hyrax/transactions/steps/save_access_control_spec.rb'
117
119
  - 'spec/jobs/content_restored_version_event_job_spec.rb'
118
120
  - 'spec/jobs/file_set_attached_event_job_spec.rb'
119
121
  - 'spec/jobs/hyrax/grant_edit_to_members_job_spec.rb'
data/CONTAINERS.md CHANGED
@@ -1,15 +1,12 @@
1
1
  Hyrax-in-a-Container
2
2
  ====================
3
3
 
4
- Our goal is to provide a practical, reusable "reference environment for applications. The first step is providing
5
- on on-ramp for Hyrax engine development. Then providing help with Hyrax-based application development. Finally,
6
- providing better guidance around deployment.
7
-
8
- Where are we at? It's complicated. What we have below is experimental support, but one that we want to push
9
- towards. We need your help to keep pushing in this direction. So dig in and prepare to get your hands dirty.
4
+ Our goal is to provide a practical, reusable reference environment for applications. The first step is providing an on-ramp for Hyrax engine development. Then providing help with Hyrax-based application development. Finally, providing better guidance around deployment.
10
5
 
11
6
  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
7
 
8
+ See the [Troubleshooting](#troubleshooting) section if you encounter any issues.
9
+
13
10
  <!-- NOTE: This title is referenced in the top-level README.md. Keep that in mind if you change it. -->
14
11
  ## Hyrax Engine Development
15
12
 
@@ -42,8 +39,6 @@ To stop the containers for the Hyrax-based application, type <kbd>Ctrl</kbd>+<kb
42
39
 
43
40
  _**Note:** Starting and stopping Docker in this way will preserve your data between restarts._
44
41
 
45
- _**Note:** I (Jeremy) encountered a problem using `docker-compose build`. I ran `bundle update` in `./hyrax` as well as within `./hyrax/.dassie`. That appeared to clear up the problem of a failure to build a gem._
46
-
47
42
  ### Code Changes and Testing
48
43
 
49
44
  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).
@@ -99,7 +94,7 @@ In the two examples, note the difference in the `-w` switch. In the first case,
99
94
 
100
95
  ### Debugging
101
96
 
102
- I (Jeremy) find myself wanting to debug the application. This requires a somewhat different approach than running Hyrax bare-metal. You need to use `docker attach` to debug the running docker instance.
97
+ 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
98
 
104
99
  1. With `docker-compose up` running open a new Terminal session.
105
100
  2. In that new Terminal session, using `docker container ls` find the "CONTAINER ID" for the `hyrax-engine-dev`.
@@ -127,6 +122,14 @@ cp: cannot create directory '/var/solr/data/hyrax_test': Permission denied
127
122
 
128
123
  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
124
 
125
+ #### Errors building the Docker image
126
+
127
+ 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.
128
+
129
+ #### Containers do not all start
130
+
131
+ 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.
132
+
130
133
  <!-- NOTE: This title is referenced in the top-level documentation/developing-your-hyrax-based-app.md. Keep that in mind if you change it. -->
131
134
  ## Docker Image for Hyrax-based Applications
132
135
 
@@ -177,4 +180,4 @@ helm dependency update chart/hyrax
177
180
  helm install -n hyrax --set image.tag=(git rev-parse HEAD) dassie chart/hyrax
178
181
  ```
179
182
 
180
- [dockerhub-samveralabs]: https://hub.docker.com/r/samveralabs
183
+ [dockerhub-samveralabs]: https://hub.docker.com/r/samveralabs
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"
@@ -8,6 +7,7 @@ ARG EXTRA_APK_PACKAGES="git"
8
7
  RUN apk --no-cache upgrade && \
9
8
  apk --no-cache add build-base \
10
9
  curl \
10
+ gcompat \
11
11
  imagemagick \
12
12
  tzdata \
13
13
  nodejs \
@@ -58,7 +58,7 @@ USER app
58
58
 
59
59
  RUN mkdir -p /app/fits && \
60
60
  cd /app/fits && \
61
- wget https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip -O fits.zip && \
61
+ wget https://github.com/harvard-lts/fits/releases/download/1.5.1/fits-1.5.1.zip -O fits.zip && \
62
62
  unzip fits.zip && \
63
63
  rm fits.zip && \
64
64
  chmod a+x /app/fits/fits.sh
data/README.md CHANGED
@@ -77,6 +77,43 @@ This is where you work on the code-base that will be used by yours and other Hyr
77
77
  <p>By moving to Docker, we are encoding the documentation steps for standing up a Hyrax-engine development environment.</p>
78
78
  </aside>
79
79
 
80
+ ### Installing Analytics
81
+
82
+ Hyrax supports your choice of either Google Analytics or Matomo. To enable analytics tracking and reporting features, follow the directions below.
83
+
84
+ Enable Analytics Features
85
+
86
+ Analytics can be enabled and configured using environment variables. Set HYRAX_ANALYTICS to true, set either 'google' or 'matomo' for HYRAX_ANALYTICS_PROVIDER, and set the date you would like reporting to start (ANALYTICS_START_DATE).
87
+
88
+ ```
89
+ HYRAX_ANALYTICS=true
90
+ HYRAX_ANALYTICS_PROVIDER=google
91
+ ANALYTICS_START_DATE=2021-08-21
92
+ ```
93
+
94
+ If using google, you'll also need the following ENV variables:
95
+
96
+ ```
97
+ GOOGLE_ANALYTICS_ID=UA-111111-1 # Universal ID (Currently Hyrax Analytics only works with Univeral (UA) accounts)
98
+ GOOGLE_OAUTH_APP_NAME=
99
+ GOOGLE_OAUTHAPP_VERSION=
100
+ GOOGLE_OAUTH_PRIVATE_KEY_PATH= # store the .p12 file in the root of your application
101
+ GOOGLE_OAUTH_PRIVATE_KEY_SECRET=
102
+ GOOGLE_OAUTH_CLIENT_EMAIL=
103
+ ```
104
+
105
+ Add these ENV variables if using Matomo:
106
+
107
+ ```
108
+ MATOMO_SITE_ID=
109
+ MATOMO_BASE_URL=
110
+ MATOMO_AUTH_TOKEN=
111
+ ```
112
+
113
+ #### Analytics Features
114
+
115
+ Once analytics is enabled, Hyrax will automatically install the JS tracking code. Page views and downloads of a file set are recorded and sent to the selected analytics provider. Admin users will have access to an expanded dashboard with details about how many vistors viewed a page, and how many visitors downloaded a file. Easily find the top works by views, and most popular file downloads!
116
+
80
117
  #### Contributing
81
118
 
82
119
  We'd love to accept your contributions. Please see our guide to [contributing to Hyrax](./.github/CONTRIBUTING.md).
@@ -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
@@ -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