hyrax 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +5 -5
  3. data/.dassie/Gemfile +1 -1
  4. data/.dassie/app/controllers/catalog_controller.rb +6 -0
  5. data/Dockerfile +2 -3
  6. data/app/actors/hyrax/actors/base_actor.rb +1 -1
  7. data/app/actors/hyrax/actors/collections_membership_actor.rb +3 -3
  8. data/app/actors/hyrax/actors/file_set_actor.rb +2 -0
  9. data/app/assets/stylesheets/hyrax/_styles.scss +5 -0
  10. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +13 -5
  11. data/app/controllers/concerns/hyrax/controller.rb +13 -2
  12. data/app/controllers/hyrax/admin/admin_sets_controller.rb +2 -19
  13. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +5 -2
  14. data/app/controllers/hyrax/collections_controller.rb +3 -1
  15. data/app/controllers/hyrax/dashboard/collection_members_controller.rb +12 -9
  16. data/app/controllers/hyrax/dashboard/collections_controller.rb +92 -28
  17. data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +75 -39
  18. data/app/controllers/hyrax/my_controller.rb +4 -4
  19. data/app/controllers/hyrax/workflow_actions_controller.rb +8 -5
  20. data/app/forms/hyrax/forms/administrative_set_form.rb +62 -0
  21. data/app/forms/hyrax/forms/collection_form.rb +2 -2
  22. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +14 -4
  23. data/app/forms/hyrax/forms/pcdm_collection_form.rb +64 -0
  24. data/app/forms/hyrax/forms/resource_form.rb +15 -10
  25. data/app/forms/hyrax/forms/workflow_action_form.rb +4 -0
  26. data/app/helpers/hyrax/hyrax_helper_behavior.rb +9 -0
  27. data/app/indexers/hyrax/administrative_set_indexer.rb +6 -6
  28. data/app/indexers/hyrax/pcdm_collection_indexer.rb +2 -0
  29. data/app/models/admin_set.rb +16 -5
  30. data/app/models/concerns/hyrax/ability/admin_set_ability.rb +31 -7
  31. data/app/models/concerns/hyrax/ability/collection_ability.rb +35 -20
  32. data/app/models/concerns/hyrax/ability/collection_type_ability.rb +1 -1
  33. data/app/models/concerns/hyrax/ability.rb +2 -2
  34. data/app/models/concerns/hyrax/solr_document_behavior.rb +2 -2
  35. data/app/models/hyrax/administrative_set.rb +7 -1
  36. data/app/models/hyrax/permission.rb +1 -1
  37. data/app/models/hyrax/permission_template.rb +19 -5
  38. data/app/models/hyrax/work.rb +1 -0
  39. data/app/models/hyrax/workflow_action_info.rb +16 -0
  40. data/app/models/sipity/comment.rb +17 -0
  41. data/app/models/sipity.rb +11 -2
  42. data/app/presenters/hyrax/admin_set_presenter.rb +8 -3
  43. data/app/presenters/hyrax/collection_presenter.rb +3 -3
  44. data/app/presenters/hyrax/work_show_presenter.rb +2 -1
  45. data/app/search_builders/hyrax/abstract_type_relation.rb +4 -2
  46. data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +1 -1
  47. data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
  48. data/app/search_builders/hyrax/filter_by_type.rb +1 -2
  49. data/app/search_builders/hyrax/my/collections_search_builder.rb +1 -1
  50. data/app/services/hyrax/admin_set_create_service.rb +136 -54
  51. data/app/services/hyrax/collection_types/permissions_service.rb +1 -1
  52. data/app/services/hyrax/collections/collection_member_service.rb +12 -2
  53. data/app/services/hyrax/collections/permissions_create_service.rb +81 -79
  54. data/app/services/hyrax/collections/permissions_service.rb +1 -1
  55. data/app/services/hyrax/curation_concern.rb +24 -2
  56. data/app/services/hyrax/default_middleware_stack.rb +11 -0
  57. data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +3 -3
  58. data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +1 -0
  59. data/app/services/hyrax/listeners/metadata_index_listener.rb +25 -9
  60. data/app/services/hyrax/permission_manager.rb +4 -4
  61. data/app/services/hyrax/solr_service.rb +1 -1
  62. data/app/services/hyrax/statistics/collections/over_time.rb +2 -1
  63. data/app/services/hyrax/workflow/abstract_notification.rb +2 -2
  64. data/app/services/hyrax/workflow/action_taken_service.rb +16 -4
  65. data/app/services/hyrax/workflow/activate_object.rb +5 -4
  66. data/app/services/hyrax/workflow/changes_required_notification.rb +5 -4
  67. data/app/services/hyrax/workflow/deactivate_object.rb +7 -5
  68. data/app/services/hyrax/workflow/deposited_notification.rb +8 -4
  69. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +7 -3
  70. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +10 -3
  71. data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +8 -2
  72. data/app/services/hyrax/workflow/workflow_action_service.rb +4 -1
  73. data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
  74. data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +1 -1
  75. data/app/views/hyrax/dashboard/collections/_form.html.erb +1 -1
  76. data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
  77. data/app/views/hyrax/homepage/index.html.erb +1 -1
  78. data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +1 -1
  79. data/app/views/layouts/hyrax/dashboard.html.erb +1 -0
  80. data/app/views/layouts/hyrax.html.erb +1 -0
  81. data/app/views/shared/_read_only.html.erb +5 -0
  82. data/chart/hyrax/Chart.yaml +2 -2
  83. data/chart/hyrax/templates/deployment.yaml +6 -0
  84. data/config/features.rb +3 -0
  85. data/config/initializers/1_healthz.rb +1 -0
  86. data/config/initializers/listeners.rb +2 -1
  87. data/config/locales/hyrax.en.yml +1 -0
  88. data/db/seeds.rb +1 -1
  89. data/documentation/developing-your-hyrax-based-app.md +1 -1
  90. data/documentation/legacyREADME.md +1 -1
  91. data/hyrax.gemspec +1 -1
  92. data/lib/generators/hyrax/templates/catalog_controller.rb +3 -1
  93. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +10 -0
  94. data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
  95. data/lib/generators/hyrax/work_resource/templates/indexer_spec.rb.erb +1 -0
  96. data/lib/hyrax/collection_name.rb +6 -2
  97. data/lib/hyrax/configuration.rb +28 -0
  98. data/lib/hyrax/form_fields.rb +1 -0
  99. data/lib/hyrax/publisher.rb +12 -0
  100. data/lib/hyrax/resource_sync/change_list_writer.rb +2 -2
  101. data/lib/hyrax/resource_sync/resource_list_writer.rb +2 -2
  102. data/lib/hyrax/specs/shared_specs/hydra_works.rb +2 -0
  103. data/lib/hyrax/specs/shared_specs/indexers.rb +6 -0
  104. data/lib/hyrax/transactions/collection_create.rb +25 -0
  105. data/lib/hyrax/transactions/collection_update.rb +20 -0
  106. data/lib/hyrax/transactions/container.rb +26 -0
  107. data/lib/hyrax/transactions/steps/add_to_collections.rb +13 -1
  108. data/lib/hyrax/transactions/steps/apply_collection_type_permissions.rb +29 -0
  109. data/lib/hyrax/transactions/steps/save.rb +18 -6
  110. data/lib/hyrax/transactions/steps/set_collection_type_gid.rb +35 -0
  111. data/lib/hyrax/version.rb +1 -1
  112. data/lib/tasks/default_admin_set.rake +12 -11
  113. data/template.rb +1 -1
  114. metadata +16 -9
data/lib/hyrax/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hyrax
3
- VERSION = '3.1.0'
3
+ VERSION = '3.2.0'
4
4
  end
@@ -3,24 +3,25 @@ namespace :hyrax do
3
3
  namespace :default_admin_set do
4
4
  desc "Create the Default Admin Set"
5
5
  task create: :environment do
6
- id = AdminSet.find_or_create_default_admin_set_id
7
- # I have found that when I come back to a development
8
- # environment, that I may have an AdminSet in Fedora, but it is
9
- # not indexed in Solr. This remediates that situation by
10
- # ensuring we have an indexed AdminSet
11
- AdminSet.find(id).update_index
12
- if Hyrax::PermissionTemplate.find_by(source_id: id)
6
+ id = Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id
7
+ if Hyrax::PermissionTemplate.find_by(source_id: id.to_s)
13
8
  puts "Successfully created default admin set"
14
9
  else
15
10
  warn "ERROR: Default admin set exists but it does not have an " \
16
11
  "associated permission template.\n\nThis may happen if you cleared your " \
17
- "database but you did not clear out Fedora and Solr.\n\n" \
12
+ "database but you did not clear out metadata datasource (e.g. Fedora, Postgres) " \
13
+ "and Solr.\n\n" \
18
14
  "You could manually create the permission template in the rails console" \
19
15
  " (non-destructive):\n\n" \
20
- " Hyrax::PermissionTemplate.create!(source_id: AdminSet::DEFAULT_ID)\n\n" \
21
- "OR you could start fresh by clearing Fedora and Solr (destructive):\n\n" \
16
+ " Hyrax::PermissionTemplate.create!(source_id: Hyrax::AdminSetCreateService::DEFAULT_ID)\n\n" \
17
+ "OR you could start fresh by clearing the metadata datasource and Solr (destructive):\n\n" \
18
+ " For ActiveFedora or Wings Valkryie adapter (default), use...\n" \
22
19
  " require 'active_fedora/cleaner'\n" \
23
- " ActiveFedora::Cleaner.clean!\n\n"
20
+ " ActiveFedora::Cleaner.clean!\n\n" \
21
+ " For Valkyrie, use...\n" \
22
+ " conn = Hyrax.index_adapter.connection\n" \
23
+ " conn.delete_by_query('*:*', params: { 'softCommit' => true })\n" \
24
+ " Hyrax.persister.wipe!\n"
24
25
  end
25
26
  end
26
27
  end
data/template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  # Hack for https://github.com/rails/rails/issues/35153
3
3
  gsub_file 'Gemfile', /^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"'
4
- gem 'hyrax', '3.1.0'
4
+ gem 'hyrax', '3.2.0'
5
5
  run 'bundle install'
6
6
  generate 'hyrax:install', '-f'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2021-09-09 00:00:00.000000000 Z
17
+ date: 2021-11-16 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -774,22 +774,22 @@ dependencies:
774
774
  name: valkyrie
775
775
  requirement: !ruby/object:Gem::Requirement
776
776
  requirements:
777
+ - - "~>"
778
+ - !ruby/object:Gem::Version
779
+ version: '2'
777
780
  - - ">="
778
781
  - !ruby/object:Gem::Version
779
782
  version: 2.1.1
780
- - - "<"
781
- - !ruby/object:Gem::Version
782
- version: '3.0'
783
783
  type: :runtime
784
784
  prerelease: false
785
785
  version_requirements: !ruby/object:Gem::Requirement
786
786
  requirements:
787
+ - - "~>"
788
+ - !ruby/object:Gem::Version
789
+ version: '2'
787
790
  - - ">="
788
791
  - !ruby/object:Gem::Version
789
792
  version: 2.1.1
790
- - - "<"
791
- - !ruby/object:Gem::Version
792
- version: '3.0'
793
793
  - !ruby/object:Gem::Dependency
794
794
  name: capybara
795
795
  requirement: !ruby/object:Gem::Requirement
@@ -1715,6 +1715,7 @@ files:
1715
1715
  - app/forms/hyrax/forms/admin/collection_type_form.rb
1716
1716
  - app/forms/hyrax/forms/admin/collection_type_participant_form.rb
1717
1717
  - app/forms/hyrax/forms/admin_set_form.rb
1718
+ - app/forms/hyrax/forms/administrative_set_form.rb
1718
1719
  - app/forms/hyrax/forms/batch_edit_form.rb
1719
1720
  - app/forms/hyrax/forms/batch_upload_form.rb
1720
1721
  - app/forms/hyrax/forms/collection_form.rb
@@ -1723,6 +1724,7 @@ files:
1723
1724
  - app/forms/hyrax/forms/file_manager_form.rb
1724
1725
  - app/forms/hyrax/forms/file_set_edit_form.rb
1725
1726
  - app/forms/hyrax/forms/file_set_form.rb
1727
+ - app/forms/hyrax/forms/pcdm_collection_form.rb
1726
1728
  - app/forms/hyrax/forms/permission.rb
1727
1729
  - app/forms/hyrax/forms/permission_template_form.rb
1728
1730
  - app/forms/hyrax/forms/resource_form.rb
@@ -2608,6 +2610,7 @@ files:
2608
2610
  - app/views/shared/_footer.html.erb
2609
2611
  - app/views/shared/_locale_picker.html.erb
2610
2612
  - app/views/shared/_nav_safety_modal.html.erb
2613
+ - app/views/shared/_read_only.html.erb
2611
2614
  - app/views/shared/_select_work_type_modal.html.erb
2612
2615
  - artifacts/entity-relationship-diagram.dot
2613
2616
  - artifacts/entity-relationship-diagram.pdf
@@ -2863,6 +2866,8 @@ files:
2863
2866
  - lib/hyrax/specs/spy_listener.rb
2864
2867
  - lib/hyrax/transactions.rb
2865
2868
  - lib/hyrax/transactions/apply_change_set.rb
2869
+ - lib/hyrax/transactions/collection_create.rb
2870
+ - lib/hyrax/transactions/collection_update.rb
2866
2871
  - lib/hyrax/transactions/container.rb
2867
2872
  - lib/hyrax/transactions/create_work.rb
2868
2873
  - lib/hyrax/transactions/destroy_work.rb
@@ -2871,6 +2876,7 @@ files:
2871
2876
  - lib/hyrax/transactions/steps/add_to_collections.rb
2872
2877
  - lib/hyrax/transactions/steps/add_to_parent.rb
2873
2878
  - lib/hyrax/transactions/steps/apply_collection_permission_template.rb
2879
+ - lib/hyrax/transactions/steps/apply_collection_type_permissions.rb
2874
2880
  - lib/hyrax/transactions/steps/apply_permission_template.rb
2875
2881
  - lib/hyrax/transactions/steps/apply_visibility.rb
2876
2882
  - lib/hyrax/transactions/steps/delete_resource.rb
@@ -2881,6 +2887,7 @@ files:
2881
2887
  - lib/hyrax/transactions/steps/save.rb
2882
2888
  - lib/hyrax/transactions/steps/save_access_control.rb
2883
2889
  - lib/hyrax/transactions/steps/save_work.rb
2890
+ - lib/hyrax/transactions/steps/set_collection_type_gid.rb
2884
2891
  - lib/hyrax/transactions/steps/set_default_admin_set.rb
2885
2892
  - lib/hyrax/transactions/steps/set_modified_date.rb
2886
2893
  - lib/hyrax/transactions/steps/set_uploaded_date_unless_present.rb
@@ -2978,7 +2985,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2978
2985
  - !ruby/object:Gem::Version
2979
2986
  version: '0'
2980
2987
  requirements: []
2981
- rubygems_version: 3.1.6
2988
+ rubygems_version: 3.2.29
2982
2989
  signing_key:
2983
2990
  specification_version: 4
2984
2991
  summary: Hyrax is a front-end based on the robust Samvera framework, providing a user