hyrax 5.1.0.pre.beta1 → 5.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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/.dassie/.env +4 -0
  3. data/.dassie/Gemfile +12 -7
  4. data/.dassie/app/controllers/application_controller.rb +4 -0
  5. data/.dassie/app/helpers/hyrax_helper.rb +4 -0
  6. data/.dassie/app/models/ability.rb +4 -0
  7. data/.dassie/app/models/user.rb +11 -0
  8. data/.dassie/app/views/shared/_footer.html.erb +17 -0
  9. data/.dassie/config/application.rb +1 -1
  10. data/.dassie/config/database.yml +18 -0
  11. data/.dassie/config/environments/production.rb +1 -1
  12. data/.dassie/config/fedora.yml +6 -6
  13. data/.dassie/config/initializers/devise.rb +1 -0
  14. data/.dassie/config/initializers/profiler.rb +5 -0
  15. data/.dassie/config/locales/hyrax.en.yml +1 -1
  16. data/.dassie/config/puma.rb +55 -5
  17. data/.dassie/config/routes.rb +2 -0
  18. data/.dassie/db/migrate/20250328100249_user_roles.rb +20 -0
  19. data/.dassie/db/schema.rb +123 -109
  20. data/.github/workflows/lint-build-test.yml +34 -5
  21. data/.koppie/.env +1 -1
  22. data/.koppie/Gemfile +10 -6
  23. data/.koppie/app/controllers/application_controller.rb +4 -0
  24. data/.koppie/app/helpers/hyrax_helper.rb +4 -0
  25. data/.koppie/app/models/ability.rb +4 -0
  26. data/.koppie/app/models/user.rb +10 -0
  27. data/.koppie/app/views/shared/_footer.html.erb +17 -0
  28. data/.koppie/config/database.yml +2 -9
  29. data/.koppie/config/environments/development.rb +9 -0
  30. data/.koppie/config/environments/production.rb +1 -1
  31. data/.koppie/config/initializers/1_valkyrie.rb +5 -5
  32. data/.koppie/config/initializers/devise.rb +1 -1
  33. data/.koppie/config/initializers/profiler.rb +5 -0
  34. data/.koppie/config/locales/hyrax.en.yml +2 -2
  35. data/.koppie/config/puma.rb +26 -7
  36. data/.koppie/config/routes.rb +2 -0
  37. data/.koppie/db/schema.rb +109 -110
  38. data/CONTAINERS.md +10 -10
  39. data/Dockerfile +108 -50
  40. data/Gemfile +2 -1
  41. data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +1 -0
  42. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +2 -1
  43. data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +4 -4
  44. data/app/controllers/hyrax/file_sets_controller.rb +11 -0
  45. data/app/helpers/hyrax/hyrax_helper_behavior.rb +2 -2
  46. data/app/helpers/hyrax/trophy_helper.rb +1 -1
  47. data/app/jobs/concerns/hyrax/queued_job_behavior.rb +22 -0
  48. data/app/jobs/hyrax/propagate_change_depositor_job.rb +1 -1
  49. data/app/jobs/hyrax/queued_delete_job.rb +11 -0
  50. data/app/jobs/hyrax/queued_indexing_job.rb +11 -0
  51. data/app/jobs/migrate_files_to_valkyrie_job.rb +33 -21
  52. data/app/jobs/migrate_sipity_entity_job.rb +21 -0
  53. data/app/models/concerns/hyrax/ability.rb +4 -2
  54. data/app/models/concerns/hyrax/solr_document_behavior.rb +5 -2
  55. data/app/models/hyrax/file_metadata.rb +22 -7
  56. data/app/services/hyrax/analytics/ga4/base.rb +1 -1
  57. data/app/services/hyrax/analytics/ga4.rb +5 -1
  58. data/app/services/hyrax/change_depositor_service.rb +1 -1
  59. data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +21 -13
  60. data/app/services/hyrax/custom_queries/find_ids_by_model.rb +31 -6
  61. data/app/services/hyrax/edit_permissions_service.rb +9 -8
  62. data/app/services/hyrax/workflow/workflow_factory.rb +3 -3
  63. data/app/services/migrate_resource_service.rb +1 -1
  64. data/app/views/_user_util_links.html.erb +2 -1
  65. data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +3 -7
  66. data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +3 -6
  67. data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +2 -3
  68. data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +1 -6
  69. data/app/views/hyrax/base/_social_media.html.erb +2 -0
  70. data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
  71. data/app/views/hyrax/dashboard/collections/_show_document_list_menu.html.erb +13 -12
  72. data/app/views/hyrax/my/_admin_set_action_menu.html.erb +31 -27
  73. data/app/views/hyrax/my/_collection_action_menu.html.erb +40 -35
  74. data/app/views/hyrax/my/_work_action_menu.html.erb +23 -22
  75. data/bin/db-migrate-seed.sh +1 -1
  76. data/bin/dev-entrypoint.sh +3 -0
  77. data/config/features.rb +50 -40
  78. data/config/initializers/indexing_adapter_initializer.rb +4 -0
  79. data/config/initializers/new_framework_defaults_7_2.rb +6 -4
  80. data/config/initializers/reform_rails_6_1_monkey_patch.rb +29 -0
  81. data/config/metadata/core_metadata.yaml +1 -0
  82. data/docker-compose-dassie.yml +6 -6
  83. data/docker-compose-koppie.yml +2 -2
  84. data/docker-compose-sirenia.yml +2 -2
  85. data/documentation/developing-your-hyrax-based-app.md +2 -2
  86. data/hyrax.gemspec +3 -3
  87. data/lib/freyja/persister.rb +11 -4
  88. data/lib/generators/hyrax/install_generator.rb +0 -5
  89. data/lib/generators/hyrax/templates/.env +1 -1
  90. data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +21 -19
  91. data/lib/generators/hyrax/templates/db/migrate/20170131142607_add_permission_template_to_sipity_workflow.rb.erb +1 -1
  92. data/lib/generators/hyrax/templates/db/migrate/20170810190549_update_collection_type_column_options.rb.erb +1 -1
  93. data/lib/generators/hyrax/templates/db/migrate/20230821153635_add_fields_to_counter_metric.rb.erb +1 -1
  94. data/lib/hyrax/configuration.rb +22 -7
  95. data/lib/hyrax/controlled_vocabulary/importer/language.rb +5 -1
  96. data/lib/hyrax/transactions/steps/add_file_sets.rb +2 -1
  97. data/lib/hyrax/version.rb +1 -1
  98. data/lib/hyrax.rb +1 -0
  99. data/lib/tasks/workflow.rake +1 -2
  100. data/lib/valkyrie/indexing/redis_queue/indexing_adapter.rb +144 -0
  101. data/lib/wings/valkyrie/query_service.rb +3 -4
  102. data/template.rb +1 -1
  103. metadata +28 -14
  104. data/.github/workflows/main.yml +0 -17
@@ -8,8 +8,9 @@ module Hyrax
8
8
  [:find_ids_by_model]
9
9
  end
10
10
 
11
- def initialize(query_service:)
11
+ def initialize(query_service:, query_rows: 1_000)
12
12
  @query_service = query_service
13
+ @query_rows = query_rows
13
14
  end
14
15
 
15
16
  attr_reader :query_service
@@ -23,14 +24,38 @@ module Hyrax
23
24
  #
24
25
  # @param model [Class]
25
26
  # @param ids [Enumerable<#to_s>, Symbol]
27
+ # @param use_solr [Boolean]
26
28
  #
27
29
  # @return [Enumerable<Valkyrie::ID>]
28
- def find_ids_by_model(model:, ids: :all)
29
- return query_service.find_all_of_model(model: model).map(&:id) if ids == :all
30
+ def find_ids_by_model(model:, ids: :all, use_solr: true)
31
+ if use_solr
32
+ query_solr(model, ids)
33
+ else
34
+ return query_service.find_all_of_model(model: model).map(&:id) if ids == :all
35
+ query_service.find_many_by_ids(ids: ids).select do |resource|
36
+ resource.is_a?(model)
37
+ end.map(&:id)
38
+ end
39
+ end
40
+
41
+ private
42
+
43
+ def query_solr(model, ids)
44
+ return enum_for(:query_solr, model, ids) unless block_given?
45
+ model_name = Hyrax::ModelRegistry.rdf_representations_from(Array(model)).first
46
+
47
+ solr_query = "_query_:\"{!raw f=has_model_ssim}#{model_name}\""
48
+ solr_response = Hyrax::SolrService.get(solr_query, fl: 'id', rows: @query_rows)['response']
49
+
50
+ loop do
51
+ response_docs = solr_response['docs']
52
+ response_docs.select! { |doc| ids.include?(doc['id']) } unless ids == :all
53
+
54
+ response_docs.each { |doc| yield doc['id'] }
30
55
 
31
- query_service.find_many_by_ids(ids: ids).select do |resource|
32
- resource.is_a?(model)
33
- end.map(&:id)
56
+ break if (solr_response['start'] + solr_response['docs'].count) >= solr_response['numFound']
57
+ solr_response = Hyrax::SolrService.get(solr_query, fl: 'id', rows: @query_rows, start: solr_response['start'] + @query_rows)['response']
58
+ end
34
59
  end
35
60
  end
36
61
  end
@@ -33,23 +33,24 @@ module Hyrax
33
33
  # * use work the file_set is in
34
34
  # No other object types are supported by this view.
35
35
  def self.build_service_object_from(form:, ability:)
36
- if form.object.respond_to?(:model) && form.object.model.work?
36
+ obj = form.object
37
+ if obj.respond_to?(:model) && obj.model.work?
37
38
  # The provided form object is a work form.
38
- new(object: form.object, ability: ability)
39
- elsif form.object.respond_to?(:model) && form.object.model.file_set?
39
+ new(object: obj, ability: ability)
40
+ elsif obj.respond_to?(:model) && obj.model.file_set?
40
41
  # The provided form object is a FileSet form. For Valkyrie forms
41
42
  # (+Hyrax::Forms::FileSetForm+), +:in_works_ids+ is prepopulated onto
42
43
  # the form object itself. For +Hyrax::Forms::FileSetEditForm+, the
43
44
  # +:in_works+ method is present on the wrapped +:model+.
44
- if form.object.is_a?(Hyrax::Forms::FileSetForm)
45
- object_id = form.object.in_works_ids.first
45
+ if obj.is_a?(Hyrax.config.file_set_form)
46
+ object_id = obj.in_works_ids.first
46
47
  new(object: Hyrax.query_service.find_by(id: object_id), ability: ability)
47
48
  else
48
- new(object: form.object.model.in_works.first, ability: ability)
49
+ new(object: obj.model.in_works.first, ability: ability)
49
50
  end
50
- elsif form.object.file_set?
51
+ elsif obj.file_set?
51
52
  # The provided form object is a FileSet.
52
- new(object: form.object.in_works.first, ability: ability)
53
+ new(object: obj.in_works.first, ability: ability)
53
54
  end
54
55
  end
55
56
 
@@ -50,9 +50,9 @@ module Hyrax
50
50
  private
51
51
 
52
52
  def create_workflow_entity!
53
- Sipity::Entity.create!(proxy_for_global_id: Hyrax::GlobalID(work).to_s,
54
- workflow: workflow_for(work),
55
- workflow_state: nil)
53
+ Sipity::Entity.find_or_create_by!(proxy_for_global_id: Hyrax::GlobalID(work).to_s,
54
+ workflow: workflow_for(work),
55
+ workflow_state: nil)
56
56
  end
57
57
 
58
58
  def assign_specific_roles_to(entity:)
@@ -8,7 +8,7 @@ class MigrateResourceService
8
8
  end
9
9
 
10
10
  def model
11
- @model || Wings::ModelRegistry.lookup(resource.class).to_s
11
+ @model ||= Wings::ModelRegistry.lookup(resource.class).to_s
12
12
  end
13
13
 
14
14
  def call
@@ -14,7 +14,8 @@
14
14
  <%= link_to "My Profile", hyrax.dashboard_profile_path(current_user), class: 'dropdown-item' %>
15
15
  <%= link_to t("hyrax.toolbar.dashboard.menu"), hyrax.dashboard_path, class: "dropdown-item" %>
16
16
  <div class="dropdown-divider"></div>
17
- <%= link_to t("hyrax.toolbar.profile.logout"), main_app.destroy_user_session_path, class: "dropdown-item" %>
17
+ <%= button_to t("hyrax.toolbar.profile.logout"), main_app.destroy_user_session_path, class: "dropdown-item",
18
+ method: ::Devise.sign_out_via %>
18
19
  </div>
19
20
  </li>
20
21
  <% else %>
@@ -1,5 +1,5 @@
1
1
  <div class="card">
2
-
2
+
3
3
  <div class="card-header">
4
4
  <h4><%= t('.top_collections') %>
5
5
  <div class="btn-group float-right">
@@ -41,15 +41,11 @@
41
41
  </tbody>
42
42
  </table>
43
43
  </div>
44
-
44
+
45
45
  <div class="card-footer">
46
46
  <div class="float-right">
47
- <%= paginate @top_collections %>
47
+ <%= paginate @top_collections, outer_window: 2, theme: 'blacklight' %>
48
48
  </div>
49
49
  </div>
50
50
 
51
51
  </div>
52
-
53
-
54
-
55
-
@@ -14,8 +14,8 @@
14
14
  <tbody>
15
15
  <% @top_file_set_downloads.each do |download| %>
16
16
  <tr>
17
- <td><%= download[1] %></td>
18
- <td><%= download[0] %></td>
17
+ <td><%= download[1] %></td>
18
+ <td><%= download[0] %></td>
19
19
  <td><%= download[2] %></td>
20
20
  </tr>
21
21
  <% end %>
@@ -24,10 +24,7 @@
24
24
  </div>
25
25
  <div class="card-footer">
26
26
  <div class="float-right">
27
- <%= paginate @top_file_set_downloads %>
27
+ <%= paginate @top_file_set_downloads, outer_window: 2, theme: 'blacklight' %>
28
28
  </div>
29
29
  </div>
30
30
  </div>
31
-
32
-
33
-
@@ -24,16 +24,15 @@
24
24
  <td><%= work[0] %></td>
25
25
  <td><%= work[2] %></td>
26
26
  <td><%= work[3] %></td>
27
- </tr>
27
+ </tr>
28
28
  <% end %>
29
29
  </tbody>
30
30
  </table>
31
31
  </div>
32
-
33
32
 
34
33
  <div class="card-footer">
35
34
  <div class="float-right">
36
- <%= paginate @top_works %>
35
+ <%= paginate @top_works, outer_window: 2, theme: 'blacklight' %>
37
36
  </div>
38
37
  </div>
39
38
 
@@ -30,12 +30,7 @@
30
30
  </div>
31
31
  <div class="card-footer">
32
32
  <div class="float-right">
33
- <%= paginate @files %>
33
+ <%= paginate @files, outer_window: 2, theme: 'blacklight' %>
34
34
  </div>
35
35
  </div>
36
36
  </div>
37
-
38
-
39
-
40
-
41
-
@@ -1,3 +1,5 @@
1
+ <% return '' if Flipflop.hide_social_buttons? %>
2
+
1
3
  <% page_title ||= content_for?(:page_title) ? content_for(:page_title) : default_page_title %>
2
4
  <% share_url ||= request.original_url %>
3
5
  <div class="social-media">
@@ -1,5 +1,5 @@
1
1
  <div class="viewer-wrapper">
2
- <iframe aria-label="image view"
2
+ <iframe title="image view"
3
3
  src="<%= universal_viewer_base_url %>#?manifest=<%= main_app.polymorphic_url [main_app, :manifest, presenter], { locale: nil } %>&config=<%= universal_viewer_config_url %>"
4
4
  allowfullscreen="true"
5
5
  frameborder="0"
@@ -1,21 +1,22 @@
1
1
  <div class="btn-group">
2
2
  <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><%= t('.select') %> <span class="caret"></span>
3
3
  </button>
4
- <ul class="dropdown-menu dropdown-menu-right">
4
+ <ul class="dropdown-menu dropdown-menu-right" role="menu">
5
5
  <% if can?( :edit, document ) && !workflow_restriction?(@presenter) %>
6
- <li class="dropdown-item">
7
- <%= link_to [main_app, :edit, document],
8
- class: "itemicon itemedit",
9
- title: t('hyrax.collection.document_list.edit'),
10
- id: "edit_work_link_#{document.id}" do %>
6
+ <%= link_to [main_app, :edit, document],
7
+ class: "itemicon itemedit",
8
+ role: 'menuitem',
9
+ title: t('hyrax.collection.document_list.edit'),
10
+ id: "edit_work_link_#{document.id}" do %>
11
+ <li class="dropdown-item">
11
12
  <i class="fa fa-pencil" aria-hidden="true"></i> <%= t('hyrax.collection.document_list.edit') %>
12
- <% end %>
13
- </li>
13
+ </li>
14
+ <% end %>
14
15
  <% end %>
15
- <li class="dropdown-item">
16
- <%= display_trophy_link(current_user, document.id) do |text| %>
16
+ <%= display_trophy_link(current_user, document.id, role: 'menuitem') do |text| %>
17
+ <li class="dropdown-item">
17
18
  <i class="fa fa-star" aria-hidden="true"></i> <%= text %>
18
- <% end %>
19
- </li>
19
+ </li>
20
+ <% end %>
20
21
  </ul>
21
22
  </div>
@@ -7,39 +7,43 @@
7
7
  <%= t("hyrax.dashboard.my.action.select") %>
8
8
  </button>
9
9
  <ul role="menu" id="<%= ul_id %>" class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu_<%= id %>">
10
- <li class="dropdown-item" role="menuitem" tabindex="-1">
11
- <%= link_to hyrax.admin_admin_set_path(id),
12
- class: 'itemicon itemedit',
13
- title: t("hyrax.dashboard.my.action.view_admin_set") do %>
10
+ <%= link_to hyrax.admin_admin_set_path(id),
11
+ class: 'itemicon itemedit',
12
+ role: 'menuitem',
13
+ title: t("hyrax.dashboard.my.action.view_admin_set") do %>
14
+ <li class="dropdown-item" tabindex="-1">
14
15
  <%= t("hyrax.dashboard.my.action.view_admin_set") %>
15
- <% end %>
16
- </li>
16
+ </li>
17
+ <% end %>
17
18
  <% if can? :edit, admin_set_presenter.solr_document %>
18
- <li class="dropdown-item" role="menuitem" tabindex="-1">
19
- <%= link_to hyrax.edit_admin_admin_set_path(id),
20
- class: 'itemicon itemedit',
21
- title: t("hyrax.dashboard.my.action.edit_admin_set") do %>
19
+ <%= link_to hyrax.edit_admin_admin_set_path(id),
20
+ class: 'itemicon itemedit',
21
+ role: 'menuitem',
22
+ title: t("hyrax.dashboard.my.action.edit_admin_set") do %>
23
+ <li class="dropdown-item" tabindex="-1">
22
24
  <%= t("hyrax.dashboard.my.action.edit_admin_set") %>
23
- <% end %>
24
- </li>
25
+ </li>
26
+ <% end %>
25
27
  <% else %>
26
- <li class="dropdown-item" role="menuitem" tabindex="-1">
27
- <%= link_to "#",
28
- class: 'itemicon itemedit edit-collection-deny-button',
29
- title: t("hyrax.dashboard.my.action.edit_collection") do %>
28
+ <%= link_to "#",
29
+ class: 'itemicon itemedit edit-collection-deny-button',
30
+ role: 'menuitem',
31
+ title: t("hyrax.dashboard.my.action.edit_collection") do %>
32
+ <li class="dropdown-item" tabindex="-1">
30
33
  <%= t("hyrax.dashboard.my.action.edit_collection") %>
31
- <% end %>
32
- </li>
34
+ </li>
35
+ <% end %>
33
36
  <% end %>
34
- <li class="dropdown-item" role="menuitem" tabindex="-1">
35
- <%= link_to "#",
36
- class: 'itemicon itemtrash delete-collection-button',
37
- title: t("hyrax.dashboard.my.action.delete_admin_set"),
38
- data: { totalitems: admin_set_presenter.total_items ,
39
- membership: admin_set_presenter.collection_type_is_require_membership? ,
40
- hasaccess: (can?(:edit, admin_set_presenter.solr_document)) } do %>
37
+ <%= link_to "#",
38
+ class: 'itemicon itemtrash delete-collection-button',
39
+ role: 'menuitem',
40
+ title: t("hyrax.dashboard.my.action.delete_admin_set"),
41
+ data: { totalitems: admin_set_presenter.total_items,
42
+ membership: admin_set_presenter.collection_type_is_require_membership?,
43
+ hasaccess: (can?(:edit, admin_set_presenter.solr_document)) } do %>
44
+ <li class="dropdown-item" tabindex="-1">
41
45
  <%= t("hyrax.dashboard.my.action.delete_admin_set") %>
42
- <% end %>
43
- </li>
46
+ </li>
47
+ <% end %>
44
48
  </ul>
45
49
  </div>
@@ -7,52 +7,57 @@
7
7
  <%= t("hyrax.dashboard.my.action.select") %>
8
8
  </button>
9
9
  <ul role="menu" id="<%= ul_id %>" class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu_<%= id %>">
10
- <li class="dropdown-item" role="menuitem" tabindex="-1">
11
- <%= link_to hyrax.dashboard_collection_path(id),
12
- class: 'itemicon itemedit',
13
- title: t("hyrax.dashboard.my.action.view_collection") do %>
10
+ <%= link_to hyrax.dashboard_collection_path(id),
11
+ class: 'itemicon itemedit',
12
+ role: 'menuitem',
13
+ title: t("hyrax.dashboard.my.action.view_collection") do %>
14
+ <li class="dropdown-item" tabindex="-1">
14
15
  <%= t("hyrax.dashboard.my.action.view_collection") %>
15
- <% end %>
16
- </li>
16
+ </li>
17
+ <% end %>
17
18
  <% if can? :edit, collection_presenter.solr_document %>
18
- <li class="dropdown-item" role="menuitem" tabindex="-1">
19
- <%= link_to hyrax.edit_dashboard_collection_path(id),
20
- class: 'itemicon itemedit',
21
- title: t("hyrax.dashboard.my.action.edit_collection") do %>
19
+ <%= link_to hyrax.edit_dashboard_collection_path(id),
20
+ class: 'itemicon itemedit',
21
+ role: 'menuitem',
22
+ title: t("hyrax.dashboard.my.action.edit_collection") do %>
23
+ <li class="dropdown-item" tabindex="-1">
22
24
  <%= t("hyrax.dashboard.my.action.edit_collection") %>
23
- <% end %>
24
- </li>
25
+ </li>
26
+ <% end %>
25
27
  <% else %>
26
- <li class="dropdown-item" role="menuitem" tabindex="-1">
27
- <%= link_to "#",
28
- class: 'itemicon itemedit edit-collection-deny-button',
29
- title: t("hyrax.dashboard.my.action.edit_collection") do %>
28
+ <%= link_to "#",
29
+ class: 'itemicon itemedit edit-collection-deny-button',
30
+ role: 'menuitem',
31
+ title: t("hyrax.dashboard.my.action.edit_collection") do %>
32
+ <li class="dropdown-item" tabindex="-1">
30
33
  <%= t("hyrax.dashboard.my.action.edit_collection") %>
31
- <% end %>
32
- </li>
34
+ </li>
35
+ <% end %>
33
36
  <% end %>
34
- <li class="dropdown-item" role="menuitem" tabindex="-1">
35
- <%= link_to "#",
36
- class: 'itemicon itemtrash delete-collection-button',
37
- title: t("hyrax.dashboard.my.action.delete_collection"),
38
- data: { totalitems: collection_presenter.total_items ,
39
- membership: collection_presenter.collection_type_is_require_membership? ,
40
- hasaccess: (can?(:edit, collection_presenter.solr_document)) } do %>
37
+ <%= link_to "#",
38
+ class: 'itemicon itemtrash delete-collection-button',
39
+ role: 'menuitem',
40
+ title: t("hyrax.dashboard.my.action.delete_collection"),
41
+ data: { totalitems: collection_presenter.total_items ,
42
+ membership: collection_presenter.collection_type_is_require_membership? ,
43
+ hasaccess: (can?(:edit, collection_presenter.solr_document)) } do %>
44
+ <li class="dropdown-item" tabindex="-1">
41
45
  <%= t("hyrax.dashboard.my.action.delete_collection") %>
42
- <% end %>
43
- </li>
46
+ </li>
47
+ <% end %>
44
48
 
45
49
  <% if collection_presenter.collection_type_is_nestable? %>
46
50
  <% # The user should have deposit access to the parent we are adding, and read access to the child (the collection we are linking here). %>
47
- <li class="dropdown-item" role="menuitem" tabindex="-1">
48
- <%= link_to "#",
49
- class: 'itemicon add-to-collection',
50
- title: t("hyrax.dashboard.my.action.add_to_collection"),
51
- data: { nestable: collection_presenter.collection_type_is_nestable? ,
52
- hasaccess: (can?(:read, collection_presenter.solr_document)) } do %>
51
+ <%= link_to "#",
52
+ class: 'itemicon add-to-collection',
53
+ role: 'menuitem',
54
+ title: t("hyrax.dashboard.my.action.add_to_collection"),
55
+ data: { nestable: collection_presenter.collection_type_is_nestable? ,
56
+ hasaccess: (can?(:read, collection_presenter.solr_document)) } do %>
57
+ <li class="dropdown-item" tabindex="-1">
53
58
  <%= t("hyrax.dashboard.my.action.add_to_collection") %>
54
- <% end %>
55
- </li>
59
+ </li>
60
+ <% end %>
56
61
  <% end %>
57
62
  </ul>
58
63
  </div>
@@ -8,38 +8,39 @@
8
8
  </button>
9
9
 
10
10
  <ul role="menu" id="<%= ul_id %>" class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu_<%= document.id %>">
11
-
12
11
  <% if can? :edit, document.id %>
13
- <li class="dropdown-item" role="menuitem" tabindex="-1">
14
- <%= link_to [main_app, :edit, document],
15
- id: 'action-edit-work' do %>
12
+ <%= link_to [main_app, :edit, document],
13
+ id: 'action-edit-work', role: 'menuitem' do %>
14
+ <li class="dropdown-item" tabindex="-1">
16
15
  <%= t("hyrax.dashboard.my.action.edit_work") %>
17
- <% end %>
18
- </li>
16
+ </li>
17
+ <% end %>
19
18
 
20
- <li class="dropdown-item" role="menuitem" tabindex="-1">
21
- <%= link_to [main_app, document],
22
- method: :delete,
23
- id: 'action-delete-work',
24
- data: {
25
- confirm: t("hyrax.dashboard.my.action.work_confirmation", application_name: application_name) } do %>
19
+ <%= link_to [main_app, document],
20
+ method: :delete,
21
+ id: 'action-delete-work',
22
+ role: 'menuitem',
23
+ data: {
24
+ confirm: t("hyrax.dashboard.my.action.work_confirmation", application_name: application_name) } do %>
25
+ <li class="dropdown-item" tabindex="-1">
26
26
  <%= t("hyrax.dashboard.my.action.delete_work") %>
27
- <% end %>
28
- </li>
27
+ </li>
28
+ <% end %>
29
29
  <% end %>
30
30
 
31
- <li class="dropdown-item" role="menuitem" tabindex="-1">
32
- <%= display_trophy_link(current_user, document.id) do |text| %>
31
+ <%= display_trophy_link(current_user, document.id, role: 'menuitem' ) do |text| %>
32
+ <li class="dropdown-item" tabindex="-1">
33
33
  <%= text %>
34
- <% end %>
35
- </li>
34
+ </li>
35
+ <% end %>
36
36
 
37
37
  <% if can? :transfer, document.id %>
38
- <li class="dropdown-item" role="menuitem" tabindex="-1">
39
- <%= link_to(hyrax.new_work_transfer_path(document.id), id: 'action-transfer-work', class: 'itemicon itemtransfer', title: t("hyrax.dashboard.my.action.transfer")) do %>
38
+ <%= link_to(hyrax.new_work_transfer_path(document.id), id: 'action-transfer-work', role: 'menuitem',
39
+ class: 'itemicon itemtransfer', title: t("hyrax.dashboard.my.action.transfer")) do %>
40
+ <li class="dropdown-item" tabindex="-1">
40
41
  <%= t("hyrax.dashboard.my.action.transfer") %>
41
- <% end %>
42
- </li>
42
+ </li>
43
+ <% end %>
43
44
  <% end %>
44
45
  </ul>
45
46
  </div>
@@ -2,7 +2,7 @@
2
2
  set -e
3
3
 
4
4
  service-wait.sh "$DB_HOST:$DB_PORT"
5
- bundle exec rails db:create
5
+ bundle exec rails db:prepare
6
6
  bundle exec rails db:migrate
7
7
 
8
8
  if [ "$FCREPO_HOST" ]; then
@@ -12,6 +12,9 @@ cp -Rn /usr/local/bundle/* /app/bundle/ruby/$RUBY_MAJOR.0
12
12
  bundle install
13
13
  yarn install
14
14
 
15
+ # Precompile assets if running in production (Nurax)
16
+ [ "$RAILS_ENV" = "production" ] && bundle exec rake assets:precompile
17
+
15
18
  db-migrate-seed.sh
16
19
 
17
20
  # Run the command
data/config/features.rb CHANGED
@@ -6,46 +6,56 @@ Flipflop.configure do
6
6
  strategy Hyrax::Strategies::YamlStrategy, config: Hyrax.config.feature_config_path
7
7
  strategy :default
8
8
 
9
- feature :proxy_deposit,
10
- default: true,
11
- description: "Depositors may designate proxies to deposit works on their behalf"
12
-
13
- feature :transfer_works,
14
- default: true,
15
- description: "Depositors may transfer their works to another user"
16
-
17
- # Note, if this is deactivated, a default admin set will be created and all
18
- # works will be assigned to it when they are created.
19
- feature :assign_admin_set,
20
- default: true,
21
- description: "Ability to assign uploaded items to an admin set"
22
-
23
- feature :show_deposit_agreement,
24
- default: true,
25
- description: "Show a deposit agreement to users creating works"
26
-
27
- feature :active_deposit_agreement_acceptance,
28
- default: Hyrax.config.active_deposit_agreement_acceptance?,
29
- description: "Require an active acceptance of the deposit agreement by checking a checkbox"
30
-
31
- feature :batch_upload,
32
- default: false,
33
- description: "Enable uploading batches of works"
34
-
35
- feature :hide_private_items,
36
- default: false,
37
- description: "Do not show the private items."
38
-
39
- feature :hide_users_list,
40
- default: true,
41
- description: "Do not show users list unless user has authenticated."
42
-
43
- feature :cache_work_iiif_manifest,
44
- default: false,
45
- description: "Use Rails.cache to cache the JSON document for IIIF manifests"
46
- feature :read_only,
47
- default: false,
48
- description: "Put the system into read-only mode. Deposits, edits, approvals and anything that makes a change to the data will be disabled."
9
+ group :site_configuration do
10
+ feature :cache_work_iiif_manifest,
11
+ default: false,
12
+ description: "Use Rails.cache to cache the JSON document for IIIF manifests"
13
+
14
+ feature :hide_private_items,
15
+ default: false,
16
+ description: "Do not show the private items."
17
+
18
+ feature :hide_social_buttons,
19
+ default: false,
20
+ description: "Do not show social media share buttons."
21
+
22
+ feature :hide_users_list,
23
+ default: true,
24
+ description: "Do not show users list unless user has authenticated."
25
+
26
+ feature :read_only,
27
+ default: false,
28
+ description: "Put the system into read-only mode. Deposits, edits, approvals and anything that makes a change to the data will be disabled."
29
+ end
30
+
31
+ group :repository_management do
32
+ feature :active_deposit_agreement_acceptance,
33
+ default: Hyrax.config.active_deposit_agreement_acceptance?,
34
+ description: "Require an active acceptance of the deposit agreement by checking a checkbox"
35
+
36
+ # Note, if this is deactivated, a default admin set will be created and all
37
+ # works will be assigned to it when they are created.
38
+ feature :assign_admin_set,
39
+ default: true,
40
+ description: "Ability to assign uploaded items to an admin set"
41
+
42
+ feature :batch_upload,
43
+ default: false,
44
+ description: "Enable uploading batches of works"
45
+
46
+ feature :proxy_deposit,
47
+ default: true,
48
+ description: "Depositors may designate proxies to deposit works on their behalf"
49
+
50
+ feature :show_deposit_agreement,
51
+ default: true,
52
+ description: "Show a deposit agreement to users creating works"
53
+
54
+ feature :transfer_works,
55
+ default: true,
56
+ description: "Depositors may transfer their works to another user"
57
+ end
58
+
49
59
  rescue Flipflop::StrategyError, Flipflop::FeatureError => err
50
60
  Hyrax.logger.warn "Ignoring #{err}: #{err.message}"
51
61
  end
@@ -7,3 +7,7 @@ Valkyrie::IndexingAdapter.register(
7
7
  Valkyrie::IndexingAdapter.register(
8
8
  Valkyrie::Indexing::NullIndexingAdapter.new, :null_index
9
9
  )
10
+ Valkyrie::IndexingAdapter.register(
11
+ Valkyrie::Indexing::RedisQueue::IndexingAdapter.new,
12
+ :redis_queue
13
+ )
@@ -2,7 +2,9 @@
2
2
 
3
3
  # Any options set here are to override Rails 7.2 configuration defaults
4
4
 
5
- # These fix a couple of issues arising from Rails 7.2 enforcement of HTML5 semantics
6
- # by default when using certain Rails methods
7
- Rails.application.config.action_view.button_to_generates_button_tag = false
8
- Rails.application.config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer
5
+ if Rails::VERSION::MAJOR >= 7
6
+ # These fix a couple of issues arising from Rails 7.2 enforcement of HTML5 semantics
7
+ # by default when using certain Rails methods
8
+ Rails.application.config.action_view.button_to_generates_button_tag = false
9
+ Rails.application.config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer
10
+ end