hyrax 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/.dassie/config/initializers/hyrax.rb +11 -1
  3. data/.gitignore +3 -0
  4. data/.regen +1 -1
  5. data/.rubocop_fixme.yml +3 -1
  6. data/Dockerfile +2 -1
  7. data/app/actors/hyrax/actors/file_actor.rb +6 -4
  8. data/app/actors/hyrax/actors/transfer_request_actor.rb +3 -7
  9. data/app/assets/javascripts/hyrax/analytics_events.js +8 -2
  10. data/app/assets/javascripts/hyrax/autocomplete/linked_data.es6 +1 -3
  11. data/app/controllers/concerns/hyrax/controller.rb +21 -0
  12. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +83 -59
  13. data/app/controllers/hyrax/admin/admin_sets_controller.rb +105 -19
  14. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +12 -19
  15. data/app/controllers/hyrax/batch_edits_controller.rb +12 -3
  16. data/app/controllers/hyrax/batch_uploads_controller.rb +4 -0
  17. data/app/controllers/hyrax/citations_controller.rb +1 -1
  18. data/app/controllers/hyrax/dashboard/collections_controller.rb +19 -10
  19. data/app/forms/hyrax/forms/administrative_set_form.rb +19 -1
  20. data/app/forms/hyrax/forms/batch_edit_form.rb +1 -1
  21. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +21 -6
  22. data/app/forms/hyrax/forms/pcdm_collection_form.rb +1 -0
  23. data/app/forms/hyrax/forms/permission_template_form.rb +17 -9
  24. data/app/forms/hyrax/forms/resource_form.rb +9 -5
  25. data/app/helpers/hyrax/collections_helper.rb +14 -0
  26. data/app/helpers/hyrax/membership_helper.rb +1 -1
  27. data/app/helpers/hyrax/trophy_helper.rb +1 -1
  28. data/app/helpers/hyrax/url_helper.rb +1 -1
  29. data/app/indexers/hyrax/administrative_set_indexer.rb +8 -2
  30. data/app/indexers/hyrax/deep_indexing_service.rb +1 -1
  31. data/app/indexers/hyrax/file_set_indexer.rb +1 -0
  32. data/app/indexers/hyrax/pcdm_collection_indexer.rb +3 -1
  33. data/app/indexers/hyrax/thumbnail_indexer.rb +31 -0
  34. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +6 -6
  35. data/app/indexers/hyrax/valkyrie_indexer.rb +4 -2
  36. data/app/indexers/hyrax/valkyrie_work_indexer.rb +13 -0
  37. data/app/inputs/controlled_vocabulary_input.rb +2 -0
  38. data/app/jobs/change_depositor_event_job.rb +47 -0
  39. data/app/jobs/characterize_job.rb +38 -2
  40. data/app/jobs/concerns/hyrax/members_permission_job_behavior.rb +1 -1
  41. data/app/jobs/content_depositor_change_event_job.rb +2 -1
  42. data/app/jobs/hyrax/propagate_change_depositor_job.rb +32 -0
  43. data/app/jobs/inherit_permissions_job.rb +1 -1
  44. data/app/jobs/valkyrie_create_derivatives_job.rb +25 -0
  45. data/app/jobs/valkyrie_ingest_job.rb +84 -16
  46. data/app/models/admin_set.rb +2 -2
  47. data/app/models/collection_branding_info.rb +8 -6
  48. data/app/models/concerns/hyrax/collection_behavior.rb +2 -2
  49. data/app/models/concerns/hyrax/file_set/characterization.rb +7 -1
  50. data/app/models/concerns/hyrax/solr_document/metadata.rb +1 -0
  51. data/app/models/concerns/hyrax/solr_document_behavior.rb +9 -3
  52. data/app/models/hyrax/administrative_set.rb +36 -1
  53. data/app/models/hyrax/collection_type.rb +2 -2
  54. data/app/models/hyrax/file_metadata.rb +5 -1
  55. data/app/models/hyrax/file_set.rb +42 -1
  56. data/app/models/hyrax/pcdm_collection.rb +56 -0
  57. data/app/models/hyrax/permission_template.rb +11 -5
  58. data/app/models/hyrax/work.rb +91 -0
  59. data/app/models/proxy_deposit_request.rb +1 -1
  60. data/app/presenters/hyrax/admin_set_presenter.rb +2 -2
  61. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +2 -2
  62. data/app/presenters/hyrax/work_show_presenter.rb +7 -3
  63. data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +2 -2
  64. data/app/search_builders/hyrax/dashboard/managed_search_filters.rb +44 -4
  65. data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +2 -2
  66. data/app/search_builders/hyrax/my/collections_search_builder.rb +11 -4
  67. data/app/services/hyrax/access_control_list.rb +13 -0
  68. data/app/services/hyrax/admin_set_create_service.rb +21 -37
  69. data/app/services/hyrax/change_content_depositor_service.rb +2 -2
  70. data/app/services/hyrax/change_depositor_service.rb +70 -0
  71. data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +1 -1
  72. data/app/services/hyrax/collections/nested_collection_query_service.rb +23 -11
  73. data/app/services/hyrax/custom_queries/navigators/child_file_sets_navigator.rb +45 -0
  74. data/app/services/hyrax/custom_queries/navigators/child_filesets_navigator.rb +7 -2
  75. data/app/services/hyrax/custom_queries/navigators/parent_work_navigator.rb +54 -0
  76. data/app/services/hyrax/default_middleware_stack.rb +3 -0
  77. data/app/services/hyrax/file_set_derivatives_service.rb +21 -2
  78. data/app/services/hyrax/file_set_type_service.rb +2 -5
  79. data/app/services/hyrax/listeners/file_metadata_listener.rb +20 -1
  80. data/app/services/hyrax/listeners/member_cleanup_listener.rb +23 -3
  81. data/app/services/hyrax/listeners/metadata_index_listener.rb +39 -0
  82. data/app/services/hyrax/listeners/proxy_deposit_listener.rb +14 -8
  83. data/app/services/hyrax/location_service.rb +33 -0
  84. data/app/services/hyrax/multiple_membership_checker.rb +44 -1
  85. data/app/services/hyrax/resource_visibility_propagator.rb +1 -1
  86. data/app/services/hyrax/simple_schema_loader.rb +5 -1
  87. data/app/services/hyrax/solr_query_service.rb +12 -7
  88. data/app/services/hyrax/thumbnail_path_service.rb +1 -1
  89. data/app/services/hyrax/work_uploads_handler.rb +0 -10
  90. data/app/validators/hyrax/collection_membership_validator.rb +38 -0
  91. data/app/views/catalog/_index_header_list_hyrax_pcdm_collection.html.erb +4 -0
  92. data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +2 -2
  93. data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +2 -2
  94. data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +2 -2
  95. data/app/views/hyrax/admin/admin_sets/_form_workflow.erb +1 -1
  96. data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
  97. data/app/views/hyrax/base/_form.html.erb +1 -1
  98. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
  99. data/app/views/hyrax/dashboard/collections/_default_group.html.erb +2 -2
  100. data/app/views/hyrax/dashboard/collections/_form.html.erb +21 -15
  101. data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +6 -3
  102. data/app/views/hyrax/dashboard/collections/_form_share.html.erb +2 -2
  103. data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +3 -3
  104. data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +2 -2
  105. data/app/views/hyrax/dashboard/works/_default_group.html.erb +1 -1
  106. data/app/views/hyrax/dashboard/works/_list_works.html.erb +1 -1
  107. data/app/views/hyrax/file_sets/_actions.html.erb +2 -2
  108. data/app/views/hyrax/my/_work_action_menu.html.erb +8 -9
  109. data/app/views/hyrax/my/collections/_default_group.html.erb +2 -2
  110. data/app/views/hyrax/my/collections/_list_collections.html.erb +2 -2
  111. data/app/views/hyrax/my/collections/index.html.erb +3 -2
  112. data/app/views/hyrax/my/works/_default_group.html.erb +1 -1
  113. data/app/views/hyrax/my/works/_list_works.html.erb +1 -2
  114. data/app/views/hyrax/my/works/index.html.erb +4 -2
  115. data/chart/hyrax/Chart.yaml +2 -2
  116. data/chart/hyrax/README.md +22 -1
  117. data/config/initializers/listeners.rb +0 -1
  118. data/config/locales/hyrax.de.yml +6 -5
  119. data/config/locales/hyrax.en.yml +30 -28
  120. data/config/locales/hyrax.es.yml +10 -9
  121. data/config/locales/hyrax.fr.yml +2 -1
  122. data/config/locales/hyrax.it.yml +3 -2
  123. data/config/locales/hyrax.pt-BR.yml +2 -1
  124. data/config/locales/hyrax.zh.yml +2 -1
  125. data/config/metadata/basic_metadata.yaml +2 -0
  126. data/config/metadata/core_metadata.yaml +1 -1
  127. data/docker-compose.yml +46 -42
  128. data/documentation/developing-your-hyrax-based-app.md +1 -1
  129. data/documentation/legacyREADME.md +1 -1
  130. data/lib/hyrax/administrative_set_name.rb +18 -0
  131. data/lib/hyrax/collection_name.rb +2 -0
  132. data/lib/hyrax/configuration.rb +10 -0
  133. data/lib/hyrax/controlled_vocabularies/location.rb +9 -2
  134. data/lib/hyrax/controlled_vocabularies/resource_label_caching.rb +42 -0
  135. data/lib/hyrax/controlled_vocabularies.rb +1 -0
  136. data/lib/hyrax/publisher.rb +45 -0
  137. data/lib/hyrax/specs/capybara.rb +1 -1
  138. data/lib/hyrax/specs/shared_specs/hydra_works.rb +11 -4
  139. data/lib/hyrax/specs/shared_specs/indexers.rb +117 -3
  140. data/lib/hyrax/transactions/admin_set_create.rb +2 -1
  141. data/lib/hyrax/transactions/admin_set_destroy.rb +22 -0
  142. data/lib/hyrax/transactions/admin_set_update.rb +21 -0
  143. data/lib/hyrax/transactions/collection_destroy.rb +22 -0
  144. data/lib/hyrax/transactions/collection_update.rb +3 -2
  145. data/lib/hyrax/transactions/container.rb +87 -23
  146. data/lib/hyrax/transactions/create_work.rb +3 -0
  147. data/lib/hyrax/transactions/destroy_work.rb +3 -0
  148. data/lib/hyrax/transactions/steps/apply_collection_permission_template.rb +2 -0
  149. data/lib/hyrax/transactions/steps/apply_permission_template.rb +2 -0
  150. data/lib/hyrax/transactions/steps/apply_visibility.rb +2 -0
  151. data/lib/hyrax/transactions/steps/change_depositor.rb +46 -0
  152. data/lib/hyrax/transactions/steps/check_for_empty_admin_set.rb +36 -0
  153. data/lib/hyrax/transactions/steps/delete_access_control.rb +32 -0
  154. data/lib/hyrax/transactions/steps/delete_resource.rb +19 -3
  155. data/lib/hyrax/transactions/steps/destroy_work.rb +3 -1
  156. data/lib/hyrax/transactions/steps/ensure_permission_template.rb +2 -0
  157. data/lib/hyrax/transactions/steps/save.rb +24 -6
  158. data/lib/hyrax/transactions/steps/save_access_control.rb +2 -2
  159. data/lib/hyrax/transactions/steps/save_work.rb +3 -0
  160. data/lib/hyrax/transactions/steps/set_user_as_creator.rb +41 -0
  161. data/lib/hyrax/transactions/steps/update_work_members.rb +51 -0
  162. data/lib/hyrax/transactions/update_work.rb +4 -3
  163. data/lib/hyrax/transactions/work_create.rb +1 -1
  164. data/lib/hyrax/transactions/work_destroy.rb +2 -1
  165. data/lib/hyrax/transactions/work_update.rb +19 -0
  166. data/lib/hyrax/version.rb +1 -1
  167. data/lib/wings/attribute_transformer.rb +5 -1
  168. data/lib/wings/setup.rb +3 -1
  169. data/lib/wings/valkyrie/query_service.rb +2 -1
  170. data/lib/wings/valkyrie/storage.rb +7 -1
  171. data/template.rb +1 -1
  172. metadata +24 -3
@@ -59,10 +59,11 @@ module Hyrax
59
59
  end
60
60
 
61
61
  ##
62
+ # @param join_with [String] the connector (eg. 'AND', 'OR') used to join each clause (default: 'AND')
62
63
  # @return [String] the combined query that can be submitted to solr
63
- def build
64
+ def build(join_with: 'AND')
64
65
  return 'id:NEVER_USE_THIS_ID' if @query.blank? # forces this method to always return a valid solr query
65
- @query.join(' AND ')
66
+ @query.join(padded_join_with(join_with))
66
67
  end
67
68
 
68
69
  ##
@@ -106,8 +107,8 @@ module Hyrax
106
107
 
107
108
  ##
108
109
  # @param field_pairs [Hash] a list of pairs of property name and values (e.g. { field1: values, field2: values })
109
- # @param join_with [String] the connector used to join the field pairs (default: ' AND ')
110
- # @param type [String] type of query to run. Either 'raw' or 'field' (default: 'field')
110
+ # @param join_with [String] the connector (eg. 'AND', 'OR') used to join the field pairs (default: 'AND')
111
+ # @param type [String] type of query to run (e.g. 'raw', 'field', 'terms') (default: 'field')
111
112
  # @return [SolrQueryService] the existing service with field_pair query appended
112
113
  def with_field_pairs(field_pairs: {}, join_with: default_join_with, type: 'field')
113
114
  pairs_query = construct_query_for_pairs(field_pairs, join_with, type)
@@ -140,7 +141,7 @@ module Hyrax
140
141
 
141
142
  # Construct a solr query from a list of pairs (e.g. { field1: values, field2: values })
142
143
  # @param [Hash] field_pairs a list of pairs of property name and values
143
- # @param [String] join_with the value we're joining the clauses with (default: ' AND ')
144
+ # @param [String] join_with the value (e.g. 'AND', 'OR') we're joining the clauses with (default: 'AND')
144
145
  # @param [String] type of query to run. Either 'raw' or 'field' (default: 'field')
145
146
  # @return [String] a solr query
146
147
  # @example
@@ -150,7 +151,7 @@ module Hyrax
150
151
  clauses = pairs_to_clauses(field_pairs, type)
151
152
  return "" if clauses.count.zero?
152
153
  return clauses.first if clauses.count == 1
153
- "(#{clauses.join(join_with)})"
154
+ "(#{clauses.join(padded_join_with(join_with))})"
154
155
  end
155
156
 
156
157
  # Construct a solr query from the model (e.g. Collection, Monograph)
@@ -184,7 +185,11 @@ module Hyrax
184
185
  end
185
186
 
186
187
  def default_join_with
187
- ' AND '
188
+ 'AND'
189
+ end
190
+
191
+ def padded_join_with(join_with)
192
+ " #{join_with.strip} "
188
193
  end
189
194
 
190
195
  # @param [Array<Array>] pairs a list of (key, value) pairs. The value itself may
@@ -9,7 +9,7 @@ module Hyrax
9
9
 
10
10
  thumb = fetch_thumbnail(object)
11
11
 
12
- return unless thumb
12
+ return default_image unless thumb
13
13
  return call(thumb) unless thumb.file_set?
14
14
  if audio?(thumb)
15
15
  audio_image
@@ -116,9 +116,6 @@ module Hyrax
116
116
 
117
117
  ValkyrieIngestJob.perform_later(file)
118
118
 
119
- # this triggers the re-index
120
- Hyrax.publisher.publish('object.metadata.updated', object: file_set, user: file.user)
121
-
122
119
  { file_set: file_set, user: file.user }
123
120
  end
124
121
 
@@ -163,13 +160,6 @@ module Hyrax
163
160
  @target_permissions ||= Hyrax::AccessControlList.new(resource: work)
164
161
  end
165
162
 
166
- ##
167
- # @api private
168
- # @return [JobIoWrapper]
169
- def wrap_file(file, file_set)
170
- JobIoWrapper.create_with_varied_file_handling!(user: file.user, file: file, relation: :original_file, file_set: file_set)
171
- end
172
-
173
163
  ##
174
164
  # @api private
175
165
  #
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+ module Hyrax
3
+ # Validates that the record passes the multiple membership checker
4
+ class CollectionMembershipValidator < ActiveModel::Validator
5
+ def validate(record)
6
+ update_collections(record)
7
+ validation = validate_multi_membership(record)
8
+ return if validation == true
9
+ record.errors[:member_of_collection_ids] << validation
10
+ end
11
+
12
+ private
13
+
14
+ def validate_multi_membership(record)
15
+ # collections-in-collections do not have multi-membership restrictions
16
+ return true if record.is_a? Hyrax::Forms::PcdmCollectionForm
17
+
18
+ Hyrax::MultipleMembershipChecker.new(item: record).validate
19
+ end
20
+
21
+ def update_collections(record)
22
+ record.member_of_collection_ids = collections_ids(record)
23
+ record.member_of_collection_ids.uniq!
24
+ end
25
+
26
+ def collections_ids(record)
27
+ collection_ids = []
28
+ if record.member_of_collections_attributes.present?
29
+ record.member_of_collections_attributes
30
+ .each do |_k, h|
31
+ next if h["_destroy"] == "true"
32
+ collection_ids << Valkyrie::ID.new(h["id"])
33
+ end
34
+ end
35
+ collection_ids
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,4 @@
1
+ <div class="search-results-title-row">
2
+ <h3 class="search-result-title"><%= link_to document.title_or_label, [hyrax, document] %></h3>
3
+ <%= Hyrax::CollectionPresenter.new(document, current_ability).collection_type_badge %>
4
+ </div>
@@ -1,6 +1,6 @@
1
1
  <h3><%= t(".#{access}.title") %></h3>
2
2
  <p><%= t(".#{access}.help") %></p>
3
- <% if @form.permission_template.access_grants.select(&filter).any? %>
3
+ <% if collection_permission_template_form_for(form: @form).access_grants.select(&filter).any? %>
4
4
  <table class="table table-striped share-status">
5
5
  <thead>
6
6
  <tr>
@@ -10,7 +10,7 @@
10
10
  </tr>
11
11
  </thead>
12
12
  <tbody>
13
- <% @form.permission_template.access_grants.select(&filter).each do |g| %>
13
+ <% collection_permission_template_form_for(form: @form).access_grants.select(&filter).each do |g| %>
14
14
  <tr>
15
15
  <td data-agent="<%= g.agent_id %>"><%= g.label %></td>
16
16
  <td><%= g.agent_type.titleize %></td>
@@ -5,7 +5,7 @@
5
5
  <h3><%= t('.add_participants') %></h3>
6
6
  <% access_options = options_for_select([['Manager', 'manage'], ['Depositor', 'deposit'], ['Viewer', 'view']]) %>
7
7
  <div class="sharing-row-form">
8
- <%= simple_form_for @form.permission_template,
8
+ <%= simple_form_for collection_permission_template_form_for(form: @form),
9
9
  url: [hyrax, :admin, @form, :permission_template],
10
10
  html: { id: 'group-participants-form', class: 'form-inline' } do |f| %>
11
11
 
@@ -33,7 +33,7 @@
33
33
  </div>
34
34
 
35
35
  <div class="sharing-row-form">
36
- <%= simple_form_for @form.permission_template,
36
+ <%= simple_form_for collection_permission_template_form_for(form: @form),
37
37
  url: [hyrax, :admin, @form, :permission_template],
38
38
  html: { id: 'user-participants-form', class: 'form-inline add-users' } do |f| %>
39
39
 
@@ -1,6 +1,6 @@
1
1
  <div id="visibility" class="tab-pane">
2
2
  <div class="panel panel-default labels">
3
- <%= simple_form_for @form.permission_template,
3
+ <%= simple_form_for collection_permission_template_form_for(form: @form),
4
4
  url: [hyrax, :admin, @form, :permission_template],
5
5
  html: { class: 'nav-safety' } do |f| %>
6
6
  <div class="panel-body">
@@ -62,4 +62,4 @@
62
62
  </div>
63
63
  <% end %>
64
64
  </div>
65
- </div>
65
+ </div>
@@ -1,6 +1,6 @@
1
1
  <div id="workflow" class="tab-pane">
2
2
  <div class="panel panel-default labels">
3
- <%= simple_form_for @form.permission_template,
3
+ <%= simple_form_for collection_permission_template_form_for(form: @form),
4
4
  url: [hyrax, :admin, @form, :permission_template],
5
5
  html: { id: 'form_workflows', class: 'nav-safety' } do |f| %>
6
6
  <% if f.object.available_workflows.any? %>
@@ -41,7 +41,7 @@
41
41
  <button class="btn btn-danger btn-sm delete-collection-type"
42
42
  data-collection-type="<%= collection_type.to_json %>"
43
43
  data-collection-type-index="<%= hyrax.dashboard_collections_path({ 'f[collection_type_gid_ssim][]' => collection_type.to_global_id.to_s, 'f[has_model_ssim][]' => 'Collection' }) %>"
44
- data-has-collections="<%= collection_type.collections? %>">
44
+ data-has-collections="<%= collection_type.collections.any? %>">
45
45
  <%= t('helpers.action.delete') %>
46
46
  </button>
47
47
  <% end %>
@@ -14,7 +14,7 @@
14
14
  <%= render 'form_visibility_error', f: f %>
15
15
  </div>
16
16
  <% end %>
17
- <% if Flipflop.batch_upload? && f.object.new_record? %>
17
+ <% if Flipflop.batch_upload? && !f.object.persisted? %>
18
18
  <% provide :metadata_tab do %>
19
19
  <p class="switch-upload-type"><%= t('.batch_upload_hint') %> <%= link_to t('.batch_link'), hyrax.new_batch_upload_path(payload_concern: @form.model.class) %></p>
20
20
  <% end %>
@@ -18,7 +18,7 @@ HTML Properties:
18
18
  data: {
19
19
  autocomplete: 'work',
20
20
  'autocomplete-url' => Rails.application.routes.url_helpers.qa_path + '/search/find_works',
21
- 'exclude-work': f.object.model.id # exclude this item from the result set.
21
+ 'exclude-work': f.object.model.id.to_s # exclude this item from the result set.
22
22
  } %>
23
23
  <a href="#" onclick="return false;" class="btn btn-primary" data-behavior="add-relationship"><%= t('.add') %></a>
24
24
  </div>
@@ -16,9 +16,9 @@
16
16
  <th><%= t("hyrax.dashboard.my.heading.access") %></th>
17
17
  <% end %>
18
18
  <th><%= t("hyrax.dashboard.my.heading.type") %></th>
19
- <th><%= t("hyrax.dashboard.my.heading.collection.visibility") %></th>
20
- <th><%= t("hyrax.dashboard.my.heading.items") %></th>
21
19
  <th><%= t("hyrax.dashboard.my.heading.last_modified") %></th>
20
+ <th><%= t("hyrax.dashboard.my.heading.items") %></th>
21
+ <th><%= t("hyrax.dashboard.my.heading.collection.visibility") %></th>
22
22
  <th><%= t("hyrax.dashboard.my.heading.action") %></th>
23
23
  </tr>
24
24
  </thead>
@@ -72,29 +72,35 @@
72
72
  </div> <!-- end description -->
73
73
 
74
74
  <% if @form.persisted? %>
75
- <div id="branding" class="tab-pane">
76
- <div class="panel panel-default labels">
77
- <div class="panel-body">
78
- <%= render 'form_branding', f: f %>
75
+ <% if collection_brandable?(collection: @collection) %>
76
+ <div id="branding" class="tab-pane">
77
+ <div class="panel panel-default labels">
78
+ <div class="panel-body">
79
+ <%= render 'form_branding', f: f %>
80
+ </div>
79
81
  </div>
80
82
  </div>
81
- </div>
83
+ <% end %>
82
84
 
83
- <div id="discovery" class="tab-pane">
84
- <div class="panel panel-default labels">
85
- <div class="panel-body">
86
- <%= render 'form_discovery', f: f %>
85
+ <% if collection_discoverable?(collection: @collection) %>
86
+ <div id="discovery" class="tab-pane">
87
+ <div class="panel panel-default labels">
88
+ <div class="panel-body">
89
+ <%= render 'form_discovery', f: f %>
90
+ </div>
87
91
  </div>
88
92
  </div>
89
- </div>
93
+ <% end %>
90
94
 
91
- <div id="sharing" class="tab-pane">
92
- <div class="panel panel-default labels" id="collection_permissions" data-param-key="<%= f.object.model_name.param_key %>">
93
- <div class="panel-body">
94
- <%= render 'form_share', f: f %>
95
+ <% if collection_sharable?(collection: @collection) %>
96
+ <div id="sharing" class="tab-pane">
97
+ <div class="panel panel-default labels" id="collection_permissions" data-param-key="<%= f.object.model_name.param_key %>">
98
+ <div class="panel-body">
99
+ <%= render 'form_share', f: f %>
100
+ </div>
95
101
  </div>
96
102
  </div>
97
- </div>
103
+ <% end %>
98
104
  <% end %>
99
105
 
100
106
  <div class="panel-footer">
@@ -5,13 +5,16 @@
5
5
 
6
6
  <div class="form-group">
7
7
  <label class="radio">
8
- <input type="radio" id="visibility_open" name="<%= f.object_name %>[visibility]" value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC %>" <% if @collection.open_access? %> checked="true"<% end %> /><strong><%= t('hyrax.visibility.open.text') %></strong> - <%= t('hyrax.visibility.open.note_html') %>
8
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC %>
9
+ <strong><%= t('hyrax.visibility.open.text') %></strong> - <%= t('hyrax.visibility.open.note_html') %>
9
10
  </label>
10
11
  <label class="radio">
11
- <input type="radio" id="visibility_registered" name="<%= f.object_name %>[visibility]" value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED %>" <% if @collection.authenticated_only_access? %> checked="true"<% end %> /><strong><%= t('hyrax.visibility.authenticated.text', institution: institution_name) %></strong> - <%= t('hyrax.visibility.authenticated.note_html', institution: institution_name) %>
12
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED %>
13
+ <strong><%= t('hyrax.visibility.authenticated.text', institution: institution_name) %></strong> - <%= t('hyrax.visibility.authenticated.note_html', institution: institution_name) %>
12
14
  </label>
13
15
  <label class="radio">
14
- <input type="radio" id="visibility_restricted" name="<%= f.object_name %>[visibility]" value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE %>" <% if @collection.private_access? %> checked="true"<% end %> /><strong><%= t('hyrax.visibility.restricted.text') %></strong>- <%= t('hyrax.visibility.restricted.note_html') %>
16
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE %>
17
+ <strong><%= t('hyrax.visibility.restricted.text') %></strong>- <%= t('hyrax.visibility.restricted.note_html') %>
15
18
  </label>
16
19
  </div>
17
20
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  <!-- Add group form -->
10
10
  <div class="form-add-sharing-wrapper" data-id="<%= @form.id %>">
11
- <%= simple_form_for @form.permission_template,
11
+ <%= simple_form_for collection_permission_template_form_for(form: @form),
12
12
  url: [hyrax, :dashboard, @form, :permission_template],
13
13
  html: { id: 'group-participants-form' } do |f| %>
14
14
 
@@ -40,7 +40,7 @@
40
40
 
41
41
  <!-- Add user form -->
42
42
  <div class="form-add-sharing-wrapper" data-id="<%= @form.id %>">
43
- <%= simple_form_for @form.permission_template,
43
+ <%= simple_form_for collection_permission_template_form_for(form: @form),
44
44
  url: [hyrax, :dashboard, @form, :permission_template],
45
45
  html: { id: 'user-participants-form' } do |f| %>
46
46
 
@@ -1,7 +1,7 @@
1
1
  <h3><%= t(".#{access}.title") %></h3>
2
2
  <p><%= t(".#{access}.help") %></p>
3
- <p><%= t(".#{access}.help_with_works", type_title: @collection.collection_type.title) if @collection.share_applies_to_new_works? && access != 'depositors' %></p>
4
- <% if @form.permission_template.access_grants.select(&filter).any? %>
3
+ <p><%= t(".#{access}.help_with_works", type_title: @collection_type.title) if @collection_type.share_applies_to_new_works? && access != 'depositors' %></p>
4
+ <% if collection_permission_template_form_for(form: @form).access_grants.select(&filter).any? %>
5
5
  <table class="table table-striped share-status">
6
6
  <thead>
7
7
  <tr>
@@ -11,7 +11,7 @@
11
11
  </tr>
12
12
  </thead>
13
13
  <tbody>
14
- <% @form.permission_template.access_grants.select(&filter).each do |g| %>
14
+ <% collection_permission_template_form_for(form: @form).access_grants.select(&filter).each do |g| %>
15
15
  <tr>
16
16
  <td data-agent="<%= g.agent_id %>"><%= g.label %></td>
17
17
  <td><%= g.agent_type.titleize %></td>
@@ -61,9 +61,9 @@
61
61
  <td class="collection_type">
62
62
  <%= collection_presenter.collection_type_badge %>
63
63
  </td>
64
- <td><%= collection_presenter.permission_badge %> </td>
64
+ <td class="date"><%= collection_presenter.modified_date %></td>
65
65
  <td><%= collection_presenter.total_viewable_items %></td>
66
- <td class="date"><%= collection_presenter.modified_date.try(:to_formatted_s, :standard) %> </td>
66
+ <td><%= collection_presenter.permission_badge %> </td>
67
67
  <td>
68
68
  <% if collection_presenter.solr_document.admin_set? %>
69
69
  <%= render '/hyrax/my/admin_set_action_menu', admin_set_presenter: collection_presenter %>
@@ -5,7 +5,7 @@
5
5
  <tr>
6
6
  <th class="check-all"><label for="check_all" class="sr-only"><%= t("hyrax.dashboard.my.sr.check_all_label") %></label><%= render_check_all %></th>
7
7
  <th><%= t("hyrax.dashboard.my.heading.title") %></th>
8
- <th class="date text-center"><%= t("hyrax.dashboard.my.heading.date_uploaded") %></th>
8
+ <th class="date text-center"><%= t("hyrax.dashboard.my.heading.date_modified") %></th>
9
9
  <th class="text-center"><%= t("blacklight.search.fields.facet.suppressed_bsi") %></th>
10
10
  <th class="text-center"><%= t("hyrax.dashboard.my.heading.work.visibility") %></th>
11
11
  <th class="text-center"><%= t("hyrax.dashboard.my.heading.action") %></th>
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  </td>
29
29
 
30
- <td class='text-center'><%= document.date_uploaded %></td>
30
+ <td class="date text-center"><%= document.date_modified %></td>
31
31
  <td class='workflow-state text-center'><%= presenter.workflow.state_label %></td>
32
32
  <td class='text-center'><%= render_visibility_link document %></td>
33
33
 
@@ -1,4 +1,4 @@
1
- <% if (can?(:download, file_set.id) || can?(:destroy, file_set.id) || can?(:edit, file_set.id)) && !workflow_restriction?(file_set.parent) %>
1
+ <% if (can?(:download, file_set.id) || can?(:destroy, file_set.id) || can?(:edit, file_set.id)) && !workflow_restriction?(@parent) %>
2
2
  <% if can?(:download, file_set.id) && !(can?(:edit, file_set.id) || can?(:destroy, file_set.id)) %>
3
3
  <%= link_to t('.download'),
4
4
  hyrax.download_path(file_set),
@@ -51,4 +51,4 @@
51
51
  </ul>
52
52
  </div>
53
53
  <% end %>
54
- <% end %>
54
+ <% end %>
@@ -12,34 +12,33 @@
12
12
 
13
13
  <% if can? :edit, document.id %>
14
14
  <li role="menuitem" tabindex="-1">
15
- <%= link_to [main_app, :edit, document] do %>
16
- <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
17
- <span> <%= t("hyrax.dashboard.my.action.edit_work") %> </span>
15
+ <%= link_to [main_app, :edit, document],
16
+ id: 'action-edit-work' do %>
17
+ <%= t("hyrax.dashboard.my.action.edit_work") %>
18
18
  <% end %>
19
19
  </li>
20
20
 
21
21
  <li role="menuitem" tabindex="-1">
22
22
  <%= link_to [main_app, document],
23
23
  method: :delete,
24
+ id: 'action-delete-work',
24
25
  data: {
25
26
  confirm: t("hyrax.dashboard.my.action.work_confirmation", application_name: application_name) } do %>
26
- <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
27
- <span> <%= t("hyrax.dashboard.my.action.delete_work") %> </span>
27
+ <%= t("hyrax.dashboard.my.action.delete_work") %>
28
28
  <% end %>
29
29
  </li>
30
30
  <% end %>
31
31
 
32
32
  <li role="menuitem" tabindex="-1">
33
33
  <%= display_trophy_link(current_user, document.id) do |text| %>
34
- <i class="glyphicon glyphicon-star" aria-hidden="true"></i> <%= text %>
34
+ <%= text %>
35
35
  <% end %>
36
36
  </li>
37
37
 
38
38
  <% if can? :transfer, document.id %>
39
39
  <li role="menuitem" tabindex="-1">
40
- <%= link_to(hyrax.new_work_transfer_path(document.id), class: 'itemicon itemtransfer', title: t("hyrax.dashboard.my.action.transfer")) do %>
41
- <i class="glyphicon glyphicon-transfer" aria-hidden="true"></i>
42
- <span> <%= t("hyrax.dashboard.my.action.transfer") %> </span>
40
+ <%= link_to(hyrax.new_work_transfer_path(document.id), id: 'action-transfer-work', class: 'itemicon itemtransfer', title: t("hyrax.dashboard.my.action.transfer")) do %>
41
+ <%= t("hyrax.dashboard.my.action.transfer") %>
43
42
  <% end %>
44
43
  </li>
45
44
  <% end %>
@@ -5,9 +5,9 @@
5
5
  <th class="check-all"><label for="check_all" class="sr-only"><%= t("hyrax.dashboard.my.sr.check_all_label") %></label><%= render_check_all %></th>
6
6
  <th><%= t("hyrax.dashboard.my.heading.title") %></th>
7
7
  <th><%= t("hyrax.dashboard.my.heading.type") %></th>
8
- <th><%= t("hyrax.dashboard.my.heading.collection.visibility") %></th>
9
- <th><%= t("hyrax.dashboard.my.heading.items") %></th>
10
8
  <th><%= t("hyrax.dashboard.my.heading.last_modified") %></th>
9
+ <th><%= t("hyrax.dashboard.my.heading.items") %></th>
10
+ <th><%= t("hyrax.dashboard.my.heading.collection.visibility") %></th>
11
11
  <th><%= t("hyrax.dashboard.my.heading.action") %></th>
12
12
  </tr>
13
13
  </thead>
@@ -60,9 +60,9 @@
60
60
  <td class="collection_type">
61
61
  <%= collection_presenter.collection_type_badge %>
62
62
  </td>
63
- <td><%= collection_presenter.permission_badge %></td>
63
+ <td class="date"><%= collection_presenter.modified_date %> </td>
64
64
  <td><%= collection_presenter.total_viewable_items %></td>
65
- <td class="date"><%= collection_presenter.modified_date.try(:to_formatted_s, :standard) %> </td>
65
+ <td><%= collection_presenter.permission_badge %></td>
66
66
  <td>
67
67
  <% if collection_presenter.solr_document.admin_set? %>
68
68
  <%= render '/hyrax/my/admin_set_action_menu', admin_set_presenter: collection_presenter %>
@@ -25,6 +25,7 @@
25
25
  <% if @collection_type_list_presenter.many? %>
26
26
  <% # modal to select type %>
27
27
  <button type="button"
28
+ id="add-new-collection-button"
28
29
  class="btn btn-primary"
29
30
  data-toggle="modal"
30
31
  data-target="#collectiontypes-to-create"
@@ -33,7 +34,7 @@
33
34
  </button>
34
35
  <% else @collection_type_list_presenter.any? %>
35
36
  <% # link directly to create collection form with type %>
36
- <%= link_to(t('helpers.action.collection.new'), append_collection_type_url(new_dashboard_collection_path, @collection_type_list_presenter.first_collection_type.id), class: 'btn btn-primary') %>
37
+ <%= link_to(t('helpers.action.collection.new'), append_collection_type_url(new_dashboard_collection_path, @collection_type_list_presenter.first_collection_type.id), id: 'add-new-collection-button', class: 'btn btn-primary') %>
37
38
  <% end %>
38
39
  <% end %>
39
40
  </section>
@@ -46,7 +47,7 @@
46
47
  <% elsif current_page?(hyrax.dashboard_collections_path(locale: nil)) && !current_ability.admin? %>
47
48
  <span class="count-display"><%= I18n.t('hyrax.my.count.collections.you_manage', total_count: @response.total_count).html_safe %></span>
48
49
  <% else %>
49
- <span class="count-display"><%= I18n.t('hyrax.my.count.collections.in_repo', total_count: @response.total_count).html_safe %></span>
50
+ <span class="count-display"><%= I18n.t('hyrax.my.count.collections.in_repo', total_count: @response.total_count).html_safe %></span>
50
51
  <% end %>
51
52
  </div>
52
53
  <div class="panel-body">
@@ -5,7 +5,7 @@
5
5
  <tr>
6
6
  <th class="check-all"><label for="check_all" class="sr-only"><%= t("hyrax.dashboard.my.sr.check_all_label") %></label><%= render_check_all %></th>
7
7
  <th><%= t("hyrax.dashboard.my.heading.title") %></th>
8
- <th class='text-center'><%= t("hyrax.dashboard.my.heading.date_uploaded") %></th>
8
+ <th class='text-center'><%= t("hyrax.dashboard.my.heading.last_modified") %></th>
9
9
  <th class='text-center'><%= t("hyrax.dashboard.my.heading.highlighted") %></th>
10
10
  <th class='text-center'><%= t("hyrax.dashboard.my.heading.work.visibility") %></th>
11
11
  <th class='text-center'><%= t("hyrax.dashboard.my.heading.action") %></th>
@@ -28,8 +28,7 @@
28
28
  </div>
29
29
  </div>
30
30
  </td>
31
-
32
- <td class="date text-center"><%= document.date_uploaded %></td>
31
+ <td class="date text-center"><%= document.date_modified %></td>
33
32
  <td class='text-center'>
34
33
  <span class="fa <%= current_user.trophies.where(work_id: document.id).exists? ? 'fa-star highlighted-work' : 'fa-star-o trophy-off' %>" aria-hidden="true"></span></td>
35
34
  <td class='text-center'><%= render_visibility_link document %></td>
@@ -30,6 +30,7 @@
30
30
  t(:'helpers.action.work.new'),
31
31
  '#',
32
32
  data: { behavior: "select-work", target: "#worktypes-to-create", 'create-type' => 'single' },
33
+ id: 'add-new-work-button',
33
34
  class: 'btn btn-primary'
34
35
  ) %>
35
36
  <% else # simple link to the first work type %>
@@ -43,6 +44,7 @@
43
44
  <%= link_to(
44
45
  t(:'helpers.action.work.new'),
45
46
  new_polymorphic_path([main_app, @create_work_presenter.first_model]),
47
+ id: 'add-new-work-button',
46
48
  class: 'btn btn-primary'
47
49
  ) %>
48
50
  <% end %>
@@ -60,9 +62,9 @@
60
62
  <% elsif current_page?(hyrax.dashboard_works_path(locale: nil)) && !current_ability.admin? %>
61
63
  <span class="count-display"><%= I18n.t('hyrax.my.count.works.you_manage', total_count: @response.total_count).html_safe %></span>
62
64
  <% else %>
63
- <span class="count-display"><%= I18n.t('hyrax.my.count.works.in_repo', total_count: @response.total_count).html_safe %></span>
65
+ <span class="count-display"><%= I18n.t('hyrax.my.count.works.in_repo', total_count: @response.total_count).html_safe %></span>
64
66
  <% end %>
65
- </div>
67
+ </div>
66
68
  <div class="panel-body">
67
69
  <%= render 'search_header' %>
68
70
  <h2 class="sr-only"><%= t('hyrax.my.count.works.works_listing') %></h2>
@@ -2,8 +2,8 @@ apiVersion: v2
2
2
  name: hyrax
3
3
  description: An open-source, Samvera-powered digital repository system
4
4
  type: application
5
- version: 1.0.2
6
- appVersion: 3.1.0
5
+ version: 1.1.0
6
+ appVersion: 3.3.0
7
7
  dependencies:
8
8
  - name: fcrepo
9
9
  version: 0.8.0
@@ -116,7 +116,7 @@ Then update the helm charts with the following:
116
116
  HELM_EXPERIMENTAL_OCI=1 helm dependency update chart/hyrax
117
117
  ```
118
118
 
119
- Without the `HELM_EXPERIMENTAL_OCI=1` switch you might see the following error:
119
+ If your `helm` version is before 3.8, without the `HELM_EXPERIMENTAL_OCI=1` switch you might see the following error:
120
120
 
121
121
  ```sh
122
122
  repository oci://ghcr.io/samvera is an OCI registry: this feature has been marked as experimental and is not enabled by default. Please set HELM_EXPERIMENTAL_OCI=1 in your environment to use this feature”
@@ -142,6 +142,27 @@ Some shell commands of house cleaning and destruction:
142
142
  * Remove hanging docker instances: `docker rm $(docker ps -a -q) -f`
143
143
  * Removing dangling docker images: `docker rmi $(docker images -f "dangling=true" -q)`
144
144
 
145
+ ## Building and Pushing the Chart Package
146
+
147
+ We currently build and push new chart versions manually. This needs to happen
148
+ any time the chart version in [`Chart.yaml`](./Chart.yaml) is incremented.
149
+
150
+ To publish the Hyrax chart, you'll need to be in one of the GitHub groups with
151
+ push permissions. These groups are:
152
+
153
+ - `@samvera/admins`
154
+ - `@samvera/hyrax` (and all its subgroups)
155
+
156
+ To build the package, it's helpful to have a clean checkout of the current
157
+ `main` branch, then:
158
+
159
+ ```sh
160
+ HELM_EXPERIMENTAL_OCI=1 helm dependency update chart/hyrax
161
+ HELM_EXPERIMENTAL_OCI=1 helm package chart/hyrax
162
+ HELM_EXPERIMENTAL_OCI=1 helm push hyrax-[VERSION].tgz oci://ghcr.io/samvera/charts
163
+ ```
164
+
165
+
145
166
  [containers]: ../../CONTAINERS.md#hyrax-image
146
167
  [dassie]: ../../.dassie/README.md
147
168
  [dassie-image]: https://hub.docker.com/r/samveralabs/dassie
@@ -9,7 +9,6 @@ Hyrax.publisher.subscribe(Hyrax::Listeners::FileSetLifecycleNotificationListener
9
9
  Hyrax.publisher.subscribe(Hyrax::Listeners::MemberCleanupListener.new)
10
10
  Hyrax.publisher.subscribe(Hyrax::Listeners::MetadataIndexListener.new)
11
11
  Hyrax.publisher.subscribe(Hyrax::Listeners::ObjectLifecycleListener.new)
12
- Hyrax.publisher.subscribe(Hyrax::Listeners::ProxyDepositListener.new)
13
12
  Hyrax.publisher.subscribe(Hyrax::Listeners::TrophyCleanupListener.new)
14
13
  Hyrax.publisher.subscribe(Hyrax::Listeners::WorkflowListener.new)
15
14