hyrax 2.3.3 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -1
  3. data/.github/stale.yml +19 -0
  4. data/README.md +2 -2
  5. data/app/actors/hyrax/actors/apply_permission_template_actor.rb +2 -4
  6. data/app/actors/hyrax/actors/create_with_files_ordered_members_actor.rb +45 -0
  7. data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +96 -0
  8. data/app/actors/hyrax/actors/file_set_ordered_members_actor.rb +16 -0
  9. data/app/actors/hyrax/actors/ordered_members_actor.rb +28 -0
  10. data/app/assets/javascripts/hyrax/collections.js +2 -0
  11. data/app/assets/stylesheets/hyrax/_file-listing.scss +2 -1
  12. data/app/assets/stylesheets/hyrax/_work-show.scss +4 -0
  13. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +1 -1
  14. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +5 -2
  15. data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +2 -9
  16. data/app/helpers/hyrax/batch_edits_helper.rb +0 -1
  17. data/app/helpers/hyrax/hyrax_helper_behavior.rb +1 -0
  18. data/app/helpers/hyrax/iiif_helper.rb +12 -0
  19. data/app/jobs/attach_files_to_work_with_ordered_members_job.rb +41 -0
  20. data/app/presenters/hyrax/work_show_presenter.rb +29 -2
  21. data/app/services/hyrax/permission_template_applicator.rb +48 -0
  22. data/app/views/hyrax/admin/collection_types/_form_settings.html.erb +1 -1
  23. data/app/views/hyrax/admin/collection_types/index.html.erb +1 -1
  24. data/app/views/hyrax/base/_form_rendering.html.erb +7 -5
  25. data/app/views/hyrax/base/_form_representative.html.erb +4 -2
  26. data/app/views/hyrax/base/_form_thumbnail.html.erb +4 -2
  27. data/app/views/hyrax/base/_member.html.erb +1 -1
  28. data/app/views/hyrax/base/_representative_media.html.erb +1 -4
  29. data/app/views/hyrax/base/_show_actions.html.erb +6 -4
  30. data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +4 -0
  31. data/app/views/hyrax/base/show.html.erb +2 -2
  32. data/app/views/hyrax/dashboard/works/_default_group.html.erb +1 -1
  33. data/app/views/hyrax/file_sets/_file_set_title.erb +2 -2
  34. data/app/views/hyrax/homepage/_featured.html.erb +0 -3
  35. data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -0
  36. data/app/views/hyrax/my/collections/_default_group.html.erb +1 -9
  37. data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
  38. data/app/views/hyrax/users/_activity_log.html.erb +1 -1
  39. data/config/locales/hyrax.de.yml +2 -0
  40. data/config/locales/hyrax.en.yml +2 -0
  41. data/config/locales/hyrax.es.yml +2 -0
  42. data/config/locales/hyrax.fr.yml +2 -0
  43. data/config/locales/hyrax.it.yml +2 -0
  44. data/config/locales/hyrax.pt-BR.yml +2 -0
  45. data/config/locales/hyrax.zh.yml +2 -0
  46. data/hyrax.gemspec +1 -0
  47. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +1 -1
  48. data/lib/generators/hyrax/templates/config/locales/hyrax.de.yml +1 -1
  49. data/lib/generators/hyrax/templates/config/locales/hyrax.en.yml +1 -1
  50. data/lib/generators/hyrax/templates/config/locales/hyrax.es.yml +1 -1
  51. data/lib/generators/hyrax/templates/config/locales/hyrax.fr.yml +1 -1
  52. data/lib/generators/hyrax/templates/config/locales/hyrax.it.yml +1 -1
  53. data/lib/generators/hyrax/templates/config/locales/hyrax.zh.yml +1 -1
  54. data/lib/hyrax/configuration.rb +1 -1
  55. data/lib/hyrax/transactions.rb +23 -0
  56. data/lib/hyrax/transactions/container.rb +63 -0
  57. data/lib/hyrax/transactions/create_work.rb +47 -0
  58. data/lib/hyrax/transactions/steps/apply_permission_template.rb +29 -0
  59. data/lib/hyrax/transactions/steps/ensure_admin_set.rb +23 -0
  60. data/lib/hyrax/transactions/steps/ensure_permission_template.rb +27 -0
  61. data/lib/hyrax/transactions/steps/save_work.rb +35 -0
  62. data/lib/hyrax/transactions/steps/set_default_admin_set.rb +25 -0
  63. data/lib/hyrax/transactions/steps/set_modified_date.rb +25 -0
  64. data/lib/hyrax/transactions/steps/set_uploaded_date.rb +28 -0
  65. data/lib/hyrax/version.rb +1 -1
  66. data/spec/actors/hyrax/actors/create_with_files_ordered_members_actor_spec.rb +41 -0
  67. data/spec/actors/hyrax/actors/create_with_remote_files_ordered_members_actor_spec.rb +49 -0
  68. data/spec/actors/hyrax/actors/file_set_ordered_members_actor_spec.rb +35 -0
  69. data/spec/actors/hyrax/actors/ordered_members_actor_spec.rb +59 -0
  70. data/spec/controllers/hyrax/embargoes_controller_spec.rb +2 -0
  71. data/spec/controllers/hyrax/generic_works_controller_spec.rb +6 -1
  72. data/spec/factories/generic_works.rb +6 -0
  73. data/spec/features/collection_multi_membership_spec.rb +6 -6
  74. data/spec/features/work_show_spec.rb +58 -5
  75. data/spec/helpers/hyrax/batch_edits_helper_spec.rb +4 -2
  76. data/spec/helpers/hyrax/iiif_helper_spec.rb +44 -0
  77. data/spec/hyrax/transactions/create_work_spec.rb +155 -0
  78. data/spec/hyrax/transactions/steps/apply_permission_template_spec.rb +72 -0
  79. data/spec/hyrax/transactions/steps/ensure_admin_set_spec.rb +25 -0
  80. data/spec/hyrax/transactions/steps/ensure_permission_template_spec.rb +33 -0
  81. data/spec/hyrax/transactions/steps/save_work_spec.rb +32 -0
  82. data/spec/hyrax/transactions/steps/set_default_admin_set_spec.rb +38 -0
  83. data/spec/hyrax/transactions/steps/set_modified_date_spec.rb +22 -0
  84. data/spec/hyrax/transactions/steps/set_uploaded_date_spec.rb +32 -0
  85. data/spec/jobs/attach_files_to_work_with_ordered_members_job_spec.rb +13 -0
  86. data/spec/presenters/hyrax/presenter_renderer_spec.rb +4 -2
  87. data/spec/presenters/hyrax/work_show_presenter_spec.rb +46 -2
  88. data/spec/services/hyrax/permission_template_applicator_spec.rb +69 -0
  89. data/spec/spec_helper.rb +13 -2
  90. data/spec/views/catalog/index.html.erb_spec.rb +7 -4
  91. data/spec/views/hyrax/admin/admin_sets/_show_actions.html.erb_spec.rb +2 -0
  92. data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +4 -1
  93. data/spec/views/hyrax/admin/admin_sets/index.html.erb_spec.rb +6 -2
  94. data/spec/views/hyrax/admin/admin_sets/index.json.erb_spec.rb +1 -2
  95. data/spec/views/hyrax/admin/collection_types/_form_metadata_admin_set.html.erb_spec.rb +1 -1
  96. data/spec/views/hyrax/admin/collection_types/_form_settings.html.erb_spec.rb +5 -26
  97. data/spec/views/hyrax/admin/collection_types/index.html.erb_spec.rb +26 -5
  98. data/spec/views/hyrax/admin/stats/show.html.erb_spec.rb +1 -0
  99. data/spec/views/hyrax/base/_attribute_rows.html.erb_spec.rb +5 -1
  100. data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -0
  101. data/spec/views/hyrax/base/_form_rendering.html.erb_spec.rb +5 -1
  102. data/spec/views/hyrax/base/_items.html.erb_spec.rb +2 -0
  103. data/spec/views/hyrax/base/_relationships.html.erb_spec.rb +2 -1
  104. data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +71 -0
  105. data/spec/views/hyrax/base/file_manager.html.erb_spec.rb +11 -14
  106. data/spec/views/hyrax/base/show.html.erb_spec.rb +2 -2
  107. data/spec/views/hyrax/base/show.json.jbuilder_spec.rb +3 -1
  108. data/spec/views/hyrax/collections/_show_document_list_row.html.erb_spec.rb +6 -1
  109. data/spec/views/hyrax/collections/_show_parent_collections.html.erb_spec.rb +5 -5
  110. data/spec/views/hyrax/collections/_subcollection_list.html.erb_spec.rb +1 -1
  111. data/spec/views/hyrax/collections/show.html.erb_spec.rb +3 -2
  112. data/spec/views/hyrax/dashboard/collections/_form_share.erb_spec.rb +1 -1
  113. data/spec/views/hyrax/dashboard/collections/_form_share_table.html.erb_spec.rb +1 -1
  114. data/spec/views/hyrax/dashboard/collections/_show_document_list_row.html.erb_spec.rb +6 -1
  115. data/spec/views/hyrax/dashboard/collections/_subcollection_list.html.erb_spec.rb +1 -1
  116. data/spec/views/hyrax/dashboard/collections/edit.html.erb_spec.rb +3 -1
  117. data/spec/views/hyrax/dashboard/profiles/show.html.erb_spec.rb +2 -3
  118. data/spec/views/hyrax/file_sets/_show_characterization_details.html.erb_spec.rb +1 -2
  119. data/spec/views/hyrax/file_sets/_single_use_links.html.erb_spec.rb +1 -2
  120. data/spec/views/hyrax/homepage/_sortable_featured.html.erb_spec.rb +1 -1
  121. data/spec/views/hyrax/my/_collection_action_menu.html.erb_spec.rb +5 -5
  122. data/spec/views/hyrax/my/collections/_list_collections.html.erb_spec.rb +11 -8
  123. data/spec/views/hyrax/users/index.html.erb_spec.rb +1 -0
  124. data/spec/views/hyrax/users/show.html.erb_spec.rb +3 -0
  125. data/template.rb +1 -1
  126. metadata +65 -3
  127. data/app/views/hyrax/dashboard/collections/_form_default_group_delt.html.erb +0 -27
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ module Hyrax
3
+ ##
4
+ # Applies a `PermissionTemplate` to a given model object by adding the
5
+ # template's manage and view users to the model's permissions.
6
+ #
7
+ # @example applying a template
8
+ # applicator = PermissionTemplateApplicator.new(template: my_template)
9
+ # applicator.apply_to(work)
10
+ #
11
+ # @example applying a template with fluent chaining syntax
12
+ # PermissionTemplateApplicator.apply(my_template).to work
13
+ #
14
+ # @since 2.4.0
15
+ class PermissionTemplateApplicator
16
+ ##
17
+ # @!attribute [rw] template
18
+ # @return [Hyrax::PermissionTemplate]
19
+ attr_accessor :template
20
+
21
+ ##
22
+ # @param template [Hyrax::PermissionTemplate]
23
+ def initialize(template:)
24
+ self.template = template
25
+ end
26
+
27
+ ##
28
+ # @param template [Hyrax::PermissionTemplate]
29
+ #
30
+ # @return [PermissionTemplateApplicator]
31
+ def self.apply(template)
32
+ new(template: template)
33
+ end
34
+
35
+ ##
36
+ # @param model [Hydra::PCDM::Object, Hydra::PCDM::Collection]
37
+ # @return [Boolean] true if the permissions have been successfully applied
38
+ def apply_to(model:)
39
+ model.edit_groups += template.agent_ids_for(agent_type: 'group', access: 'manage')
40
+ model.edit_users += template.agent_ids_for(agent_type: 'user', access: 'manage')
41
+ model.read_groups += template.agent_ids_for(agent_type: 'group', access: 'view')
42
+ model.read_users += template.agent_ids_for(agent_type: 'user', access: 'view')
43
+
44
+ true
45
+ end
46
+ alias to apply_to
47
+ end
48
+ end
@@ -29,7 +29,7 @@
29
29
  APPLY TO NEW WORKS
30
30
  </label>
31
31
  </div>
32
- <p class="help-block">When new works are created directly in the collection, grant sharing users and groups permissions for the new work according to their collection roles.</p>
32
+ <p class="help-block"><%= t('simple_form.hints.collection_type.share_applies_to_new_works') %></p>
33
33
  </div>
34
34
  </div>
35
35
  <p><%= f.input :allow_multiple_membership, as: :boolean, disabled: f.object.all_settings_disabled? %></p>
@@ -21,7 +21,7 @@
21
21
  <%= t('.more_toggle_content_html') %>
22
22
  </div>
23
23
 
24
- <h2>Current Collection Types</h2>
24
+ <h2><%= t('.header') %></h2>
25
25
  <table class="table collection-types-table">
26
26
  <thead>
27
27
  <tr>
@@ -4,11 +4,13 @@
4
4
  <legend>
5
5
  <%= t("hyrax.base.form_rendering.legend_html") %>
6
6
  </legend>
7
- <p><%= t("hyrax.base.form_rendering.help_html") %></p>
8
- <%= f.select :rendering_ids,
9
- f.object.select_files,
10
- { include_blank: true },
11
- { class: 'form-control', multiple: true } %>
7
+ <div class="form-group">
8
+ <span class="help-block"><%= t("hyrax.base.form_rendering.help_html") %></span>
9
+ <%= f.select :rendering_ids,
10
+ f.object.select_files,
11
+ { include_blank: true },
12
+ { class: 'form-control', multiple: true } %>
13
+ </div>
12
14
  </fieldset>
13
15
  </div>
14
16
  </div>
@@ -4,8 +4,10 @@
4
4
  <legend>
5
5
  <%= t("hyrax.base.form_representative.legend_html") %>
6
6
  </legend>
7
- <p><%= t("hyrax.base.form_representative.help_html") %></p>
8
- <%= f.select :representative_id, @form.select_files, {}, { class: 'form-control' } %>
7
+ <div class="form-group">
8
+ <span class="help-block"><%= t("hyrax.base.form_representative.help_html") %></span>
9
+ <%= f.select :representative_id, @form.select_files, {}, { class: 'form-control' } %>
10
+ </div>
9
11
  </fieldset>
10
12
  </div>
11
13
  </div>
@@ -4,8 +4,10 @@
4
4
  <legend>
5
5
  <%= t("hyrax.base.form_thumbnail.legend_html") %>
6
6
  </legend>
7
- <p><%= t("hyrax.base.form_thumbnail.help_html") %></p>
8
- <%= f.select :thumbnail_id, @form.select_files, {}, { class: 'form-control' } %>
7
+ <div class="form-group">
8
+ <span class="help-block"><%= t("hyrax.base.form_thumbnail.help_html") %></span>
9
+ <%= f.select :thumbnail_id, @form.select_files, {}, { class: 'form-control' } %>
10
+ </div>
9
11
  </fieldset>
10
12
  </div>
11
13
  </div>
@@ -2,7 +2,7 @@
2
2
  <td class="thumbnail">
3
3
  <%= render_thumbnail_tag member %>
4
4
  </td>
5
- <td class="attribute attribute-filename"><%= link_to(member.link_name, contextual_path(member, @presenter)) %></td>
5
+ <td class="attribute attribute-filename ensure-wrapped"><%= link_to(member.link_name, contextual_path(member, @presenter)) %></td>
6
6
  <td class="attribute attribute-date_uploaded"><%= member.try(:date_uploaded) %></td>
7
7
  <td class="attribute attribute-permission"><%= member.permission_badge %></td>
8
8
  <td>
@@ -1,9 +1,6 @@
1
1
  <% if presenter.representative_id.present? && presenter.representative_presenter.present? %>
2
2
  <% if defined?(viewer) && viewer %>
3
- <%= PulUvRails::UniversalViewer.script_tag %>
4
- <div class="viewer-wrapper">
5
- <div class="uv viewer" data-uri="<%= main_app.polymorphic_path [main_app, :manifest, presenter], { locale: nil } %>"></div>
6
- </div>
3
+ <%= iiif_viewer_display presenter %>
7
4
  <% else %>
8
5
  <%= media_display presenter.representative_presenter %>
9
6
  <% end %>
@@ -20,12 +20,14 @@
20
20
  <% end %>
21
21
  </ul>
22
22
  </div>
23
- <input type="checkbox" style="display:none" name="batch_document_ids[]" id="batch_document_<%= presenter.id %>" value="<%= presenter.id %>" class="batch_document_selector" checked="checked" />
24
- <%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
25
- class: 'btn btn-default submits-batches submits-batches-add',
26
- data: { toggle: "modal", target: "#collection-list-container" } %>
27
23
  <% end %>
28
24
  <% end %>
25
+ <% if presenter.show_deposit_for?(collections: @user_collections) %>
26
+ <input type="checkbox" style="display:none" name="batch_document_ids[]" id="batch_document_<%= presenter.id %>" value="<%= presenter.id %>" class="batch_document_selector" checked="checked" />
27
+ <%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
28
+ class: 'btn btn-default submits-batches submits-batches-add',
29
+ data: { toggle: "modal", target: "#collection-list-container" } %>
30
+ <% end %>
29
31
  <% if presenter.work_featurable? %>
30
32
  <%= link_to "Feature", hyrax.featured_work_path(presenter, format: :json),
31
33
  data: { behavior: 'feature' },
@@ -0,0 +1,4 @@
1
+ <%= PulUvRails::UniversalViewer.script_tag %>
2
+ <div class="viewer-wrapper">
3
+ <div class="uv viewer" data-uri="<%= main_app.polymorphic_url [main_app, :manifest, presenter], { locale: nil } %>"></div>
4
+ </div>
@@ -15,13 +15,13 @@
15
15
  <div class="panel-body">
16
16
  <div class="row">
17
17
  <%= render 'workflow_actions_widget', presenter: @presenter %>
18
- <% if @presenter.universal_viewer? %>
18
+ <% if @presenter.iiif_viewer? %>
19
19
  <div class="col-sm-12">
20
20
  <%= render 'representative_media', presenter: @presenter, viewer: true %>
21
21
  </div>
22
22
  <% end %>
23
23
  <div class="col-sm-3 text-center">
24
- <%= render 'representative_media', presenter: @presenter, viewer: false unless @presenter.universal_viewer? %>
24
+ <%= render 'representative_media', presenter: @presenter, viewer: false unless @presenter.iiif_viewer? %>
25
25
  <%= render 'citations', presenter: @presenter %>
26
26
  <%= render 'social_media' %>
27
27
  </div>
@@ -1,4 +1,4 @@
1
- <table class="table table-striped works-list datatable">
1
+ <table class="table table-striped works-list">
2
2
  <caption class="sr-only"><%= t("hyrax.dashboard.my.sr.listing") %> <%= application_name %></caption>
3
3
  <thead>
4
4
  <tr>
@@ -1,9 +1,9 @@
1
1
  <% presenter.title.each_with_index do |title, index| %>
2
2
  <% if index == 0 %>
3
- <h1>
3
+ <h1 class="ensure-wrapped">
4
4
  <%= title %> <%= presenter.permission_badge %>
5
5
  </h1>
6
6
  <% else %>
7
- <h1><%= title %></h1>
7
+ <h1 class="ensure-wrapped"><%= title %></h1>
8
8
  <% end %>
9
9
  <% end %>
@@ -1,9 +1,6 @@
1
1
  <% presenter = featured.presenter %>
2
2
  <li class="featured-item" data-id="<%= presenter.id %>">
3
3
  <div class="row">
4
- <div class="col-sm-2">
5
- <%= render_thumbnail_tag presenter %>
6
- </div>
7
4
  <div class="col-sm-10">
8
5
  <%= render 'hyrax/homepage/featured_fields', featured: presenter %>
9
6
  </div>
@@ -42,6 +42,7 @@
42
42
  <%= t("hyrax.dashboard.my.action.delete_collection") %>
43
43
  <% end %>
44
44
  </li>
45
+
45
46
  <% if Hyrax::CollectionType.any_nestable? %>
46
47
  <% # 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
48
  <li role="menuitem" tabindex="-1">
@@ -2,15 +2,7 @@
2
2
  <caption class="sr-only"><%= t("hyrax.dashboard.my.sr.listing") %> <%= application_name %></caption>
3
3
  <thead>
4
4
  <tr>
5
- <th class="check-all text-left">
6
- <label for="check_all" class="sr-only">
7
- <%= t("hyrax.dashboard.my.sr.check_all_label") %>
8
- </label>
9
- <label class="centerizer">
10
- <input type="checkbox" class="check-all-checkbox" name="check_all" id="check_all" value="yes" />
11
- <%= t("hyrax.dashboard.my.action.select") %>
12
- </label>
13
- </th>
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>
14
6
  <th><%= t("hyrax.dashboard.my.heading.title") %></th>
15
7
  <th><%= t("hyrax.dashboard.my.heading.type") %></th>
16
8
  <th><%= t("hyrax.dashboard.my.heading.visibility") %></th>
@@ -1,6 +1,6 @@
1
1
  <% # used by Your Collections tab %>
2
2
  <% id = collection_presenter.id %>
3
- <%# Data attributes referenced by the javascript for row actions %>
3
+ <%# Data attributes referenced by the javascript for submitting nested forms. %>
4
4
  <tr id="document_<%= id %>"
5
5
  data-source="my"
6
6
  data-id="<%= id %>"
@@ -9,7 +9,7 @@
9
9
  <% events.each do |event| %>
10
10
  <% next if event[:action].blank? or event[:timestamp].blank? %>
11
11
  <tr>
12
- <td><%= sanitize event[:action] %></td>
12
+ <td class="ensure-wrapped"><%= sanitize event[:action] %></td>
13
13
  <% time = Time.zone.at(event[:timestamp].to_i) %>
14
14
  <td data-sort="<%= time.getutc.iso8601(5) %>">
15
15
  <relative-time datetime="<%= time.getutc.iso8601 %>" title="<%= time.to_formatted_s(:standard) %>">
@@ -826,6 +826,8 @@ de:
826
826
  type: Art von Arbeit
827
827
  viz_after: Sichtbarkeit wird geändert
828
828
  viz_current: Aktuelle Sichtbarkeit
829
+ update:
830
+ embargo_deactivated: Deaktivierung erfolgreich!
829
831
  featured_researchers: Ausgewählte Forscher
830
832
  file_manager:
831
833
  link_text: Dateimanager
@@ -825,6 +825,8 @@ en:
825
825
  type: Type of Item
826
826
  viz_after: Visibility will Change to
827
827
  viz_current: Current Visibility
828
+ update:
829
+ embargo_deactivated: Deactivation succeeded!
828
830
  featured_researchers: Featured Researchers
829
831
  file_manager:
830
832
  link_text: File Manager
@@ -824,6 +824,8 @@ es:
824
824
  type: Tipo de trabajo
825
825
  viz_after: La visibilidad cambiará a
826
826
  viz_current: Visibilidad actual
827
+ update:
828
+ embargo_deactivated: Desactivación exitosa!
827
829
  featured_researchers: Investigadores Destacados
828
830
  file_manager:
829
831
  link_text: Administrador de archivos
@@ -825,6 +825,8 @@ fr:
825
825
  type: Type de travail
826
826
  viz_after: La visibilité changera en
827
827
  viz_current: Visibilité actuelle
828
+ update:
829
+ embargo_deactivated: Désactivation réussie!
828
830
  featured_researchers: Les chercheurs en vedette
829
831
  file_manager:
830
832
  link_text: Gestionnaire de fichiers
@@ -824,6 +824,8 @@ it:
824
824
  type: Tipo di lavoro
825
825
  viz_after: La visibilità cambierà
826
826
  viz_current: Visibilità attuale
827
+ update:
828
+ embargo_deactivated: Disattivazione riuscita!
827
829
  featured_researchers: Ricercatori in primo piano
828
830
  file_manager:
829
831
  link_text: File Manager
@@ -819,6 +819,8 @@ pt-BR:
819
819
  type: Tipo de obra
820
820
  viz_after: O acesso mudará para
821
821
  viz_current: Acesso atual
822
+ update:
823
+ embargo_deactivated: Desativação bem sucedida!
822
824
  featured_researchers: Pesquisadores em destaque
823
825
  file_manager:
824
826
  link_text: Gerenciador de arquivos
@@ -822,6 +822,8 @@ zh:
822
822
  type: 什么样的工作
823
823
  viz_after: 公开度将更改为
824
824
  viz_current: 当前公开度
825
+ update:
826
+ embargo_deactivated: 停用限制成功!
825
827
  featured_researchers: 特色研究者
826
828
  file_manager:
827
829
  link_text: 文件管理员
@@ -43,6 +43,7 @@ SUMMARY
43
43
  spec.add_dependency 'clipboard-rails', '~> 1.5'
44
44
  spec.add_dependency 'dry-equalizer', '~> 0.2'
45
45
  spec.add_dependency 'dry-struct', '~> 0.1'
46
+ spec.add_dependency 'dry-transaction', '~> 0.11'
46
47
  spec.add_dependency 'dry-validation', '~> 0.9'
47
48
  spec.add_dependency 'flipflop', '~> 2.3'
48
49
  # Pin more tightly because 0.x gems are potentially unstable
@@ -121,7 +121,7 @@ Hyrax.config do |config|
121
121
  # config.show_work_item_rows = 10
122
122
 
123
123
  # Enable IIIF image service. This is required to use the
124
- # UniversalViewer-ified show page
124
+ # IIIF viewer enabled show page
125
125
  #
126
126
  # If you have run the riiif generator, an embedded riiif service
127
127
  # will be used to deliver images via IIIF. If you have not, you will
@@ -50,7 +50,7 @@ de:
50
50
  directory:
51
51
  suffix: "@ Example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright © 2017 Samvera lizenziert</strong> unter der Apache Lizenz, Version 2.0"
53
+ copyright_html: "<strong>Copyright © 2018 Samvera lizenziert</strong> unter der Apache Lizenz, Version 2.0"
54
54
  service_html: Ein Dienst von <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a> .
55
55
  institution_name: Institution
56
56
  institution_name_full: Name des Instituts
@@ -50,7 +50,7 @@ en:
50
50
  directory:
51
51
  suffix: "@example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright &copy; 2017 Samvera</strong> Licensed under the Apache License, Version 2.0"
53
+ copyright_html: "<strong>Copyright &copy; 2018 Samvera</strong> Licensed under the Apache License, Version 2.0"
54
54
  service_html: A service of <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a>.
55
55
  institution_name: Institution
56
56
  institution_name_full: The Institution Name
@@ -50,7 +50,7 @@ es:
50
50
  directory:
51
51
  suffix: "@example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright &copy; 2017 Samvera</strong> bajo licencia de Apache, Version 2.0"
53
+ copyright_html: "<strong>Copyright &copy; 2018 Samvera</strong> bajo licencia de Apache, Version 2.0"
54
54
  service_html: Un servicio de <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera/a>.
55
55
  institution_name: institución
56
56
  institution_name_full: El nombre de la institución
@@ -50,7 +50,7 @@ fr:
50
50
  directory:
51
51
  suffix: "@ Example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright © 2017 Samvera</strong> Licence sous Licence Apache, Version 2.0"
53
+ copyright_html: "<strong>Copyright © 2018 Samvera</strong> Licence sous Licence Apache, Version 2.0"
54
54
  service_html: Un service de <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a> .
55
55
  institution_name: Institution
56
56
  institution_name_full: Nom de l'établissement
@@ -50,7 +50,7 @@ it:
50
50
  directory:
51
51
  suffix: "@ example.org"
52
52
  footer:
53
- copyright_html: "<strong>Copyright © 2017 Samvera</strong> Licenza sotto la licenza Apache, versione 2.0"
53
+ copyright_html: "<strong>Copyright © 2018 Samvera</strong> Licenza sotto la licenza Apache, versione 2.0"
54
54
  service_html: Un servizio di <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a> .
55
55
  institution_name: Istituzione
56
56
  institution_name_full: Nome dell'Istituzione
@@ -50,7 +50,7 @@ zh:
50
50
  directory:
51
51
  suffix: "@example.org"
52
52
  footer:
53
- copyright_html: "<strong>版权所有 &copy; 2017 Samvera</strong> 根据Apache许可证2.0版许可"
53
+ copyright_html: "<strong>版权所有 &copy; 2018 Samvera</strong> 根据Apache许可证2.0版许可"
54
54
  service_html: 的服务<a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a>.
55
55
  institution_name: 机构
56
56
  institution_name_full: 机构名称
@@ -367,7 +367,7 @@ module Hyrax
367
367
  end
368
368
 
369
369
  # Enable IIIF image service. This is required to use the
370
- # UniversalViewer-enabled show page
370
+ # IIIF viewer enabled show page
371
371
  #
372
372
  # If you have run the hyrax:riiif generator, an embedded riiif service
373
373
  # will be used to deliver images via IIIF. If you have not, you will
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+ require 'hyrax/transactions/container'
3
+
4
+ module Hyrax
5
+ ##
6
+ # This is a parent module for DRY Transaction classes handling Hyrax
7
+ # processes. Especially: transactions and steps for creating, updating, and
8
+ # destroying PCDM Objects are located here. Loading this module provides an
9
+ # easy way to load the full suite of transactions included for these purposes.
10
+ #
11
+ # @note These uses of `dry-transaction` are currently experimental
12
+ # replacements for actor stack behavior. They are not loaded during normal
13
+ # execution in a stock Hyrax application.
14
+ #
15
+ # @since 2.4.0
16
+ #
17
+ # @example
18
+ # require 'hyrax/transactions'
19
+ #
20
+ # @see https://dry-rb.org/gems/dry-transaction/
21
+ module Transactions
22
+ end
23
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+ require "dry/transaction"
3
+ require "dry/transaction/operation"
4
+
5
+ module Hyrax
6
+ module Transactions
7
+ ##
8
+ # Provides a container for transaction steps related to creating, updating,
9
+ # and destroying PCDM Objects in Hyrax.
10
+ #
11
+ # In advanced use, the container could provide runtime dependency injection
12
+ # for particular step code. For the basic case, users can consider it as
13
+ # providing namespaceing and resolution for steps (as used in
14
+ # `Hyrax::Transaction::CreateWork`; e.g.
15
+ # `step :save_work, with: 'work.save_work'`).
16
+ #
17
+ # @since 2.4.0
18
+ #
19
+ # @see https://dry-rb.org/gems/dry-container/
20
+ class Container
21
+ require 'hyrax/transactions/create_work'
22
+ require 'hyrax/transactions/steps/apply_permission_template'
23
+ require 'hyrax/transactions/steps/ensure_admin_set'
24
+ require 'hyrax/transactions/steps/ensure_permission_template'
25
+ require 'hyrax/transactions/steps/save_work'
26
+ require 'hyrax/transactions/steps/set_default_admin_set'
27
+ require 'hyrax/transactions/steps/set_modified_date'
28
+ require 'hyrax/transactions/steps/set_uploaded_date'
29
+
30
+ extend Dry::Container::Mixin
31
+
32
+ namespace 'work' do |ops|
33
+ ops.register 'apply_permission_template' do
34
+ Steps::ApplyPermissionTemplate.new
35
+ end
36
+
37
+ ops.register 'ensure_admin_set' do
38
+ Steps::EnsureAdminSet.new
39
+ end
40
+
41
+ ops.register 'ensure_permission_template' do
42
+ Steps::EnsurePermissionTemplate.new
43
+ end
44
+
45
+ ops.register 'save_work' do
46
+ Steps::SaveWork.new
47
+ end
48
+
49
+ ops.register 'set_default_admin_set' do
50
+ Steps::SetDefaultAdminSet.new
51
+ end
52
+
53
+ ops.register 'set_modified_date' do
54
+ Steps::SetModifiedDate.new
55
+ end
56
+
57
+ ops.register 'set_uploaded_date' do
58
+ Steps::SetUploadedDate.new
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end