curation_concerns 1.6.3 → 1.7.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/.travis.yml +2 -8
  4. data/README.md +27 -1
  5. data/app/actors/curation_concerns/actors/base_actor.rb +2 -3
  6. data/app/actors/curation_concerns/actors/file_set_actor.rb +1 -1
  7. data/app/actors/curation_concerns/actors/grant_edit_to_depositor_actor.rb +19 -0
  8. data/app/actors/curation_concerns/actors/initialize_workflow_actor.rb +19 -0
  9. data/app/assets/javascripts/curation_concerns/charts.js +47 -0
  10. data/app/assets/javascripts/curation_concerns/curation_concerns.js +2 -0
  11. data/app/assets/javascripts/curation_concerns/workflow_actions_affix.js +11 -0
  12. data/app/assets/stylesheets/curation_concerns/_admin.scss +18 -0
  13. data/app/assets/stylesheets/curation_concerns/_curation_concerns.scss +1 -0
  14. data/app/assets/stylesheets/curation_concerns/_positioning.scss +11 -0
  15. data/app/controllers/concerns/curation_concerns/act_as_admin_controller.rb +25 -0
  16. data/app/controllers/concerns/curation_concerns/admin_controller_behavior.rb +38 -0
  17. data/app/controllers/concerns/curation_concerns/admin_page.rb +18 -0
  18. data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +3 -2
  19. data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +158 -159
  20. data/app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb +4 -6
  21. data/app/controllers/concerns/curation_concerns/file_sets_controller_behavior.rb +2 -1
  22. data/app/controllers/concerns/curation_concerns/leases_controller_behavior.rb +4 -6
  23. data/app/controllers/concerns/curation_concerns/single_use_links_viewer_controller_behavior.rb +2 -1
  24. data/app/controllers/curation_concerns/admin/workflow_roles_controller.rb +36 -0
  25. data/app/controllers/curation_concerns/workflow_actions_controller.rb +25 -0
  26. data/app/conversions/power_converters/polymorphic_type.rb +7 -0
  27. data/app/conversions/power_converters/sipity_action.rb +9 -0
  28. data/app/conversions/power_converters/sipity_action_name.rb +8 -0
  29. data/app/conversions/power_converters/sipity_agent.rb +6 -0
  30. data/app/conversions/power_converters/sipity_entity.rb +12 -0
  31. data/app/conversions/power_converters/sipity_role.rb +8 -0
  32. data/app/conversions/power_converters/sipity_workflow_id.rb +16 -0
  33. data/app/conversions/power_converters/sipity_workflow_state.rb +10 -0
  34. data/app/conversions/power_converters.rb +6 -0
  35. data/app/forms/curation_concerns/forms/workflow_action_form.rb +62 -0
  36. data/app/forms/curation_concerns/forms/workflow_responsibility_form.rb +42 -0
  37. data/app/helpers/curation_concerns/charts_helper.rb +23 -0
  38. data/app/helpers/curation_concerns/main_app_helpers.rb +1 -0
  39. data/app/helpers/curation_concerns/url_helper.rb +2 -5
  40. data/app/indexers/curation_concerns/indexes_workflow.rb +44 -0
  41. data/app/indexers/curation_concerns/work_indexer.rb +1 -2
  42. data/app/jobs/import_export_job.rb +46 -0
  43. data/app/models/concerns/curation_concerns/ability.rb +2 -0
  44. data/app/models/concerns/curation_concerns/permissions/writable.rb +7 -8
  45. data/app/models/concerns/curation_concerns/publishable.rb +6 -0
  46. data/app/models/concerns/curation_concerns/solr_document_behavior.rb +8 -0
  47. data/app/models/concerns/curation_concerns/user.rb +5 -0
  48. data/app/models/curation_concerns/group.rb +23 -0
  49. data/app/models/curation_concerns/workflow_action_info.rb +13 -0
  50. data/app/models/sipity/agent.rb +21 -0
  51. data/app/models/sipity/comment.rb +13 -0
  52. data/app/models/sipity/entity.rb +32 -0
  53. data/app/models/sipity/entity_specific_responsibility.rb +21 -0
  54. data/app/models/sipity/method.rb +5 -0
  55. data/app/models/sipity/notifiable_context.rb +26 -0
  56. data/app/models/sipity/notification.rb +28 -0
  57. data/app/models/sipity/notification_recipient.rb +17 -0
  58. data/app/models/sipity/role.rb +43 -0
  59. data/app/models/sipity/workflow.rb +19 -0
  60. data/app/models/sipity/workflow_action.rb +25 -0
  61. data/app/models/sipity/workflow_responsibility.rb +23 -0
  62. data/app/models/sipity/workflow_role.rb +13 -0
  63. data/app/models/sipity/workflow_state.rb +26 -0
  64. data/app/models/sipity/workflow_state_action.rb +9 -0
  65. data/app/models/sipity/workflow_state_action_permission.rb +8 -0
  66. data/app/models/vocab/fedora_resource_status.rb +4 -1
  67. data/app/presenters/curation_concerns/admin/workflow_role_presenter.rb +40 -0
  68. data/app/presenters/curation_concerns/work_show_presenter.rb +4 -0
  69. data/app/presenters/curation_concerns/workflow_presenter.rb +43 -0
  70. data/app/renderers/curation_concerns/renderers/rights_attribute_renderer.rb +1 -1
  71. data/app/search_builders/curation_concerns/search_filters.rb +0 -1
  72. data/app/services/curation_concerns/actors/actor_factory.rb +3 -1
  73. data/app/services/curation_concerns/admin_set_service.rb +13 -4
  74. data/app/services/curation_concerns/work_form_service.rb +11 -0
  75. data/app/services/curation_concerns/workflow/action_taken_service.rb +57 -0
  76. data/app/services/curation_concerns/workflow/activate_object.rb +9 -0
  77. data/app/services/curation_concerns/workflow/deactivate_object.rb +11 -0
  78. data/app/services/curation_concerns/workflow/default_workflow_strategy.rb +13 -0
  79. data/app/services/curation_concerns/workflow/method_generator.rb +55 -0
  80. data/app/services/curation_concerns/workflow/notification_configuration_parameter.rb +42 -0
  81. data/app/services/curation_concerns/workflow/notification_generator.rb +64 -0
  82. data/app/services/curation_concerns/workflow/notification_service.rb +66 -0
  83. data/app/services/curation_concerns/workflow/permission_generator.rb +95 -0
  84. data/app/services/curation_concerns/workflow/permission_query.rb +432 -0
  85. data/app/services/curation_concerns/workflow/remove_depositor_permissions.rb +11 -0
  86. data/app/services/curation_concerns/workflow/sipity_actions_generator.rb +49 -0
  87. data/app/services/curation_concerns/workflow/state_machine_generator.rb +102 -0
  88. data/app/services/curation_concerns/workflow/status_list_service.rb +52 -0
  89. data/app/services/curation_concerns/workflow/workflow_action_service.rb +56 -0
  90. data/app/services/curation_concerns/workflow/workflow_by_model_name_strategy.rb +14 -0
  91. data/app/services/curation_concerns/workflow/workflow_factory.rb +64 -0
  92. data/app/services/curation_concerns/workflow/workflow_importer.rb +103 -0
  93. data/app/services/curation_concerns/workflow/workflow_permissions_generator.rb +49 -0
  94. data/app/services/curation_concerns/workflow/workflow_schema.rb +56 -0
  95. data/app/services/rights_service.rb +1 -1
  96. data/app/services/sipity.rb +2 -0
  97. data/app/sources/curation_concerns/resource_statistics_source.rb +101 -0
  98. data/app/values/curation_concerns/chart_data.rb +61 -0
  99. data/app/views/curation_concerns/admin/_admin_menu.html.erb +5 -0
  100. data/app/views/curation_concerns/admin/_resource_stats.html.erb +43 -0
  101. data/app/views/curation_concerns/admin/_sidebar.html.erb +3 -0
  102. data/app/views/curation_concerns/admin/_total_embargo_visibility.html.erb +21 -0
  103. data/app/views/curation_concerns/admin/_total_objects.html.erb +1 -0
  104. data/app/views/curation_concerns/admin/_total_objects_charts.html.erb +12 -0
  105. data/app/views/curation_concerns/admin/index.html.erb +11 -0
  106. data/app/views/curation_concerns/admin/widgets/_pie.html.erb +1 -0
  107. data/app/views/curation_concerns/admin/workflow.html.erb +31 -0
  108. data/app/views/curation_concerns/admin/workflow_roles/index.html.erb +45 -0
  109. data/app/views/curation_concerns/base/_form_rights.html.erb +1 -1
  110. data/app/views/curation_concerns/base/_workflow_actions.html.erb +39 -0
  111. data/app/views/curation_concerns/base/show.html.erb +2 -0
  112. data/app/views/curation_concerns/file_sets/media_display/_office_document.html.erb +0 -1
  113. data/app/views/layouts/_head_tag_content.html.erb +13 -0
  114. data/app/views/layouts/admin.html.erb +10 -0
  115. data/app/views/shared/_my_actions.html.erb +4 -1
  116. data/config/initializers/precompile_assets.rb +1 -0
  117. data/config/locales/curation_concerns.en.yml +97 -56
  118. data/config/routes.rb +7 -0
  119. data/curation_concerns.gemspec +9 -3
  120. data/db/migrate/20160919151348_create_sipity.rb +163 -0
  121. data/db/migrate/20161012182404_create_sipity_workflow_methods.rb +10 -0
  122. data/lib/curation_concerns/configuration.rb +68 -0
  123. data/lib/curation_concerns/engine.rb +9 -1
  124. data/lib/curation_concerns/rails/routes.rb +1 -0
  125. data/lib/curation_concerns/version.rb +1 -1
  126. data/lib/curation_concerns.rb +1 -1
  127. data/lib/generators/curation_concerns/admin_dashboard_generator.rb +15 -0
  128. data/lib/generators/curation_concerns/install_generator.rb +7 -0
  129. data/lib/generators/curation_concerns/sample_data_generator.rb +12 -0
  130. data/lib/generators/curation_concerns/templates/app/controllers/curation_concerns/admin_controller.rb +61 -0
  131. data/lib/generators/curation_concerns/templates/catalog_controller.rb +1 -3
  132. data/lib/generators/curation_concerns/templates/config/curation_concerns.rb +39 -0
  133. data/lib/generators/curation_concerns/templates/db/seeds.rb +94 -0
  134. data/lib/generators/curation_concerns/templates/spec/models/collection_spec.rb +1 -1
  135. data/lib/generators/curation_concerns/templates/spec/models/file_set_spec.rb +1 -1
  136. data/lib/generators/curation_concerns/templates/workflow.json.erb +19 -0
  137. data/lib/generators/curation_concerns/work/USAGE +1 -0
  138. data/lib/generators/curation_concerns/work/templates/actor_spec.rb.erb +1 -1
  139. data/lib/generators/curation_concerns/work/templates/controller_spec.rb.erb +1 -1
  140. data/lib/generators/curation_concerns/work/templates/feature_spec.rb.erb +1 -1
  141. data/lib/generators/curation_concerns/work/templates/form_spec.rb.erb +1 -1
  142. data/lib/generators/curation_concerns/work/templates/model_spec.rb.erb +1 -1
  143. data/spec/abilities/admin_ability_spec.rb +15 -0
  144. data/spec/actors/curation_concerns/file_set_actor_spec.rb +24 -0
  145. data/spec/actors/curation_concerns/grant_edit_to_depositor_actor_spec.rb +32 -0
  146. data/spec/actors/curation_concerns/initialize_workflow_actor_spec.rb +33 -0
  147. data/spec/actors/curation_concerns/interpret_visibility_actor_spec.rb +1 -0
  148. data/spec/actors/curation_concerns/work_actor_spec.rb +10 -5
  149. data/spec/controllers/curation_concerns/acts_as_admin_controller_spec.rb +22 -0
  150. data/spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb +26 -0
  151. data/spec/controllers/curation_concerns/admin_controller_spec.rb +64 -0
  152. data/spec/controllers/curation_concerns/generic_works_controller_json_spec.rb +11 -3
  153. data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +4 -4
  154. data/spec/controllers/curation_concerns/workflow_actions_controller_spec.rb +36 -0
  155. data/spec/conversions/power_converters/polymorphic_type_spec.rb +22 -0
  156. data/spec/conversions/power_converters/sipity_action_name_spec.rb +32 -0
  157. data/spec/conversions/power_converters/sipity_action_spec.rb +43 -0
  158. data/spec/conversions/power_converters/sipity_agent_spec.rb +20 -0
  159. data/spec/conversions/power_converters/sipity_entity_spec.rb +46 -0
  160. data/spec/conversions/power_converters/sipity_role_spec.rb +33 -0
  161. data/spec/conversions/power_converters/sipity_workflow_id_spec.rb +28 -0
  162. data/spec/conversions/power_converters/sipity_workflow_state_spec.rb +22 -0
  163. data/spec/factories/generic_works.rb +19 -6
  164. data/spec/factories/sipity_entities.rb +7 -0
  165. data/spec/factories/workflow_actions.rb +6 -0
  166. data/spec/factories/workflow_states.rb +6 -0
  167. data/spec/factories/workflows.rb +5 -0
  168. data/spec/features/admin_spec.rb +14 -0
  169. data/spec/features/create_child_work_spec.rb +1 -1
  170. data/spec/features/create_work_spec.rb +1 -1
  171. data/spec/features/embargo_spec.rb +1 -1
  172. data/spec/features/lease_spec.rb +1 -1
  173. data/spec/features/work_generator_spec.rb +2 -2
  174. data/spec/features/workflow_roles_spec.rb +48 -0
  175. data/spec/forms/curation_concerns/forms/workflow_action_form_spec.rb +111 -0
  176. data/spec/forms/curation_concerns/forms/workflow_responsibility_form_spec.rb +33 -0
  177. data/spec/helpers/curation_concerns/charts_helper_spec.rb +62 -0
  178. data/spec/helpers/url_helper_spec.rb +11 -11
  179. data/spec/indexers/work_indexer_spec.rb +13 -1
  180. data/spec/javascripts/charts_spec.coffee +10 -0
  181. data/spec/javascripts/fixtures/chart_example.html +1 -0
  182. data/spec/jobs/import_export_job_spec.rb +28 -0
  183. data/spec/models/curation_concerns/group_spec.rb +15 -0
  184. data/spec/models/file_set_spec.rb +6 -2
  185. data/spec/models/generic_work_spec.rb +12 -0
  186. data/spec/models/sipity/agent_spec.rb +9 -0
  187. data/spec/models/sipity/comment_spec.rb +16 -0
  188. data/spec/models/sipity/entity_spec.rb +27 -0
  189. data/spec/models/sipity/entity_specific_responsibility_spec.rb +8 -0
  190. data/spec/models/sipity/notifiable_context_spec.rb +8 -0
  191. data/spec/models/sipity/notification_recipient_spec.rb +10 -0
  192. data/spec/models/sipity/notification_spec.rb +15 -0
  193. data/spec/models/sipity/role_spec.rb +30 -0
  194. data/spec/models/sipity/workflow_action_spec.rb +10 -0
  195. data/spec/models/sipity/workflow_responsibility_spec.rb +7 -0
  196. data/spec/models/sipity/workflow_role_spec.rb +7 -0
  197. data/spec/models/sipity/workflow_spec.rb +15 -0
  198. data/spec/models/sipity/workflow_state_action_permission_spec.rb +7 -0
  199. data/spec/models/sipity/workflow_state_action_spec.rb +7 -0
  200. data/spec/models/sipity/workflow_state_spec.rb +7 -0
  201. data/spec/models/user_spec.rb +12 -1
  202. data/spec/presenters/curation_concerns/work_show_presenter_spec.rb +12 -1
  203. data/spec/presenters/curation_concerns/workflow_presenter_spec.rb +39 -0
  204. data/spec/routing/route_spec.rb +13 -0
  205. data/spec/services/curation_concerns/admin_set_service_spec.rb +13 -0
  206. data/spec/services/curation_concerns/qa_select_service_spec.rb +75 -0
  207. data/spec/services/curation_concerns/workflow/action_taken_service_spec.rb +76 -0
  208. data/spec/services/curation_concerns/workflow/activate_object_spec.rb +20 -0
  209. data/spec/services/curation_concerns/workflow/deactivate_object_spec.rb +20 -0
  210. data/spec/services/curation_concerns/workflow/method_generator_spec.rb +43 -0
  211. data/spec/services/curation_concerns/workflow/notification_configuration_parameter_spec.rb +25 -0
  212. data/spec/services/curation_concerns/workflow/notification_generator_spec.rb +27 -0
  213. data/spec/services/curation_concerns/workflow/notification_service_spec.rb +81 -0
  214. data/spec/services/curation_concerns/workflow/permission_generator_spec.rb +52 -0
  215. data/spec/services/curation_concerns/workflow/permission_query_spec.rb +179 -0
  216. data/spec/services/curation_concerns/workflow/remove_depositor_permissions_spec.rb +21 -0
  217. data/spec/services/curation_concerns/workflow/sipity_actions_generator_spec.rb +30 -0
  218. data/spec/services/curation_concerns/workflow/state_machine_generator_spec.rb +46 -0
  219. data/spec/services/curation_concerns/workflow/status_list_service_spec.rb +46 -0
  220. data/spec/services/curation_concerns/workflow/workflow_importer_spec.rb +50 -0
  221. data/spec/services/curation_concerns/workflow/workflow_permissions_generator_spec.rb +37 -0
  222. data/spec/services/curation_concerns/workflow/workflow_schema_spec.rb +85 -0
  223. data/spec/sources/curation_concerns/resource_statistics_source_spec.rb +137 -0
  224. data/spec/spec_helper.rb +8 -1
  225. data/spec/test_app_templates/lib/generators/test_app_generator.rb +11 -0
  226. data/spec/views/curation_concerns/admin/_admin_menu.html.erb_spec.rb +23 -0
  227. data/spec/views/curation_concerns/admin/_resource_stats.html.erb_spec.rb +33 -0
  228. data/spec/views/curation_concerns/admin/_total_objects_charts.html.erb_spec.rb +28 -0
  229. data/spec/views/curation_concerns/admin/index.html.erb_spec.rb +26 -0
  230. data/spec/views/curation_concerns/admin/widgets/_pie.html.erb_spec.rb +17 -0
  231. data/spec/views/curation_concerns/base/file_manager.html.erb_spec.rb +1 -1
  232. data/spec/views/curation_concerns/base/show.html.erb_spec.rb +33 -0
  233. data/spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb +1 -1
  234. data/spec/views/shared/_my_actions.html.erb_spec.rb +1 -0
  235. data/tasks/workflow.rake +8 -0
  236. metadata +335 -21
@@ -0,0 +1,45 @@
1
+ <div class="<%= "dashboard-#{action_name}" %>">
2
+ <div class="wrapper">
3
+ <div class="widget widget-default">
4
+ <table class="table table-striped">
5
+ <thead>
6
+ <th><%= t('.header.user') %></th>
7
+ <th><%= t('.header.roles') %></th>
8
+ </thead>
9
+ <tbody>
10
+ <% @presenter.users.each do |user| %>
11
+ <tr>
12
+ <td><%= user.user_key %></td>
13
+ <% agent_presenter = @presenter.presenter_for(user) %>
14
+ <% if agent_presenter %>
15
+ <td>
16
+ <ul>
17
+ <% agent_presenter.responsibilities do |responsibility_presenter| %>
18
+ <li><%= responsibility_presenter.label %>
19
+ <%= link_to admin_workflow_role_path(responsibility_presenter.responsibility),
20
+ method: :delete,
21
+ data: { confirm: t('.delete.confirm') } do %>
22
+ <span class="delete">&times;</span>
23
+ <% end %>
24
+ </li>
25
+ <% end %>
26
+ </ul>
27
+ </td>
28
+ <% else %>
29
+ <td><%= t('.no_roles') %></td>
30
+ <% end %>
31
+ </tr>
32
+ <% end %>
33
+ </tbody>
34
+ </table>
35
+
36
+ <h2><%= t('.new_role') %></h2>
37
+ <%= simple_form_for CurationConcerns::Forms::WorkflowResponsibilityForm.new, url: admin_workflow_roles_path do |f| %>
38
+ <%= f.input :user_id, as: :select, collection: f.object.user_options %>
39
+ <%= f.input :workflow_role_id, as: :select, collection: f.object.workflow_role_options %>
40
+ <%= f.submit %>
41
+ <% end %>
42
+ </div>
43
+ </div>
44
+ </div>
45
+
@@ -9,7 +9,7 @@
9
9
  <a href="http://creativecommons.org/licenses/" target="_blank">Here's some help</a> if you don't know which license to choose.
10
10
  </p>
11
11
 
12
- <% license_service = CurationConcerns::LicenseService.new %>
12
+ <% license_service = CurationConcerns.config.license_service_class.new %>
13
13
  <%= f.input :rights, as: :multi_value_select,
14
14
  collection: license_service.select_active_options,
15
15
  include_blank: true,
@@ -0,0 +1,39 @@
1
+ <div id="workflow_controls"class="panel panel-default workflow-affix">
2
+ <div class="panel-heading">
3
+ <a data-toggle="collapse" href="#workflow_controls_collapse">
4
+ <h2 class="panel-title">Review and Approval</h2>
5
+ </a>
6
+ </div>
7
+ <div id="workflow_controls_collapse" class="row panel-body panel-collapse collapse">
8
+ <%= form_tag main_app.curation_concerns_workflow_action_path(presenter), method: :put do %>
9
+ <div class="col-sm-3 workflow-actions">
10
+ <h3>Actions</h3>
11
+
12
+ <% presenter.workflow.actions.each do |key, label| %>
13
+ <div class="radio">
14
+ <label>
15
+ <input type="radio" name="workflow_action[name]" id="workflow_action_name_<%= key %>" value="<%= key %>">
16
+ <%= label %>
17
+ </label>
18
+ </div>
19
+ <% end %>
20
+ </div>
21
+ <div class="col-sm-9 workflow-comments">
22
+ <div class="form-group">
23
+ <label for="workflow_action_comment">Review comment:</label>
24
+ <textarea class="form-control" name="workflow_action[comment]" id="workflow_action_comment"></textarea>
25
+ </div>
26
+
27
+ <input class="btn btn-primary" type="submit" value="Submit">
28
+
29
+ <h4>Previous Comments</h4>
30
+ <dl>
31
+ <% presenter.workflow.comments.each do |comment| %>
32
+ <dt><%= comment.name_of_commentor %></dt>
33
+ <dd><%= comment.comment %></dd>
34
+ <% end %>
35
+ </dl>
36
+ </div>
37
+ <% end %>
38
+ </div>
39
+ </div>
@@ -1,6 +1,7 @@
1
1
  <% provide :page_title, @presenter.page_title %>
2
2
  <% provide :page_header do %>
3
3
  <h1><%= @presenter %> </h1>
4
+ <span class="state state-<%= @presenter.workflow.state %>"><%= @presenter.workflow.state_label %></span>
4
5
  <% if @parent_presenter %>
5
6
  <ul class="breadcrumb">
6
7
  <li><%= link_to @parent_presenter, polymorphic_path([main_app, @parent_presenter]) %></li>
@@ -21,4 +22,5 @@
21
22
  <%= render 'multiple_upload', presenter: @presenter %>
22
23
  <% end %>
23
24
 
25
+ <%= render 'workflow_actions', presenter: @presenter if @presenter.workflow.actions.present? %>
24
26
  <%= render "show_actions", collector: collector, editor: editor%>
@@ -6,7 +6,6 @@
6
6
  alt: "",
7
7
  role: "presentation" %>
8
8
  <%= link_to main_app.download_path(file_set),
9
- target: "_new",
10
9
  data: { turbolinks: false },
11
10
  target: :_blank,
12
11
  class: "btn btn-default" do %>
@@ -0,0 +1,13 @@
1
+ <%= csrf_meta_tag %>
2
+ <meta charset="utf-8" />
3
+
4
+ <!-- added for use on small devices like phones -->
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
+
7
+ <title><%= content_for?(:page_title) ? yield(:page_title) : default_page_title %></title>
8
+
9
+ <!-- application css -->
10
+ <%= stylesheet_link_tag 'application' %>
11
+
12
+ <!-- application js -->
13
+ <%= javascript_include_tag 'application' %>
@@ -0,0 +1,10 @@
1
+ <% content_for(:main) do %>
2
+ <div class="col-md-3 sidebar">
3
+ <%= render 'curation_concerns/admin/sidebar' %>
4
+ </div>
5
+ <div class="col-md-9 <%= yield(:content_class) %>">
6
+ <%= yield %>
7
+ </div>
8
+ <% end %>
9
+
10
+ <%= render template: "layouts/#{theme}" %>
@@ -20,6 +20,9 @@
20
20
  <% if can? :discover, Hydra::AccessControls::Lease %>
21
21
  <li><%= link_to 'Leases', main_app.leases_path, role: 'menuitem' %></li>
22
22
  <% end %>
23
+ <% if can? :read, :admin_dashboard %>
24
+ <li><%= link_to 'Admin Dashboard', curation_concerns.admin_index_path, role: 'menuitem' %></li>
25
+ <% end %>
23
26
 
24
27
  <% if include_works_link || include_collections_link %>
25
28
  <li class="divider"></li>
@@ -27,4 +30,4 @@
27
30
  <li><%= link_to 'Log Out', main_app.destroy_user_session_path, class: 'log-out', role: 'menuitem' %></li>
28
31
  </ul>
29
32
  </li>
30
- </ul>
33
+ </ul>
@@ -0,0 +1 @@
1
+ Rails.application.config.assets.precompile += %w( curation_concerns/admin.css )
@@ -1,38 +1,15 @@
1
1
  en:
2
2
  curation_concerns:
3
- product_name: "Repository"
4
- institution_name: &INSTITUTION_NAME "Institution Name"
5
- catalog:
6
- index:
7
- type_tabs:
8
- all: All
9
- collections:
10
- search_form:
11
- placeholder: "Search Collection"
12
- label: "Search Collection %{title}"
13
- division:
14
- name: "Your Division at Institution"
15
- homepage_url: "#"
16
- document_language: "en"
17
- institution:
18
- name: "Your Institution"
19
- homepage_url: "#"
20
- show:
21
- related_files:
22
- heading: 'Members'
23
- downloadable_content:
24
- heading: 'Downloadable Content'
25
- default_link: 'Download file'
26
- image_link: 'Download image'
27
- office_link: 'Download file'
28
- pdf_link: 'Download PDF'
29
- search:
30
- form:
31
- q:
32
- label: "Search Repository"
33
- placeholder: "Type keywords in here"
34
- bread_crumb:
35
- works_list: "the works browser"
3
+ admin:
4
+ workflow_roles:
5
+ index:
6
+ header:
7
+ user: User
8
+ roles: Roles
9
+ no_roles: No roles
10
+ new_role: "Grant a role to a user:"
11
+ delete:
12
+ confirm: Are you sure?
36
13
  api:
37
14
  accepted:
38
15
  default: "Your request has been accepted for processing, but processing is not complete. See job for more info."
@@ -53,6 +30,31 @@ en:
53
30
  default: "Unable to process your request. See errors for more info."
54
31
  internal_error:
55
32
  default: "The server encountered an error."
33
+ bread_crumb:
34
+ works_list: "the works browser"
35
+ catalog:
36
+ index:
37
+ type_tabs:
38
+ all: All
39
+ collections:
40
+ search_form:
41
+ placeholder: "Search Collection"
42
+ label: "Search Collection %{title}"
43
+ dashboard:
44
+ menu:
45
+ index: "Admin Dashboard"
46
+ resource_details: "Resource Details"
47
+ workflow: "Workflow"
48
+ workflow_roles: "Workflow Roles"
49
+ division:
50
+ name: "Your Division at Institution"
51
+ homepage_url: "#"
52
+ document_language: "en"
53
+ institution:
54
+ name: "Your Institution"
55
+ homepage_url: "#"
56
+ institution_name: &INSTITUTION_NAME "Institution Name"
57
+ product_name: "Repository"
56
58
  schema_org:
57
59
  resource_type:
58
60
  Article: "http://schema.org/Article"
@@ -99,7 +101,41 @@ en:
99
101
  property: keywords
100
102
  title:
101
103
  property: name
102
-
104
+ search:
105
+ form:
106
+ q:
107
+ label: "Search Repository"
108
+ placeholder: "Type keywords in here"
109
+ show:
110
+ related_files:
111
+ heading: 'Members'
112
+ downloadable_content:
113
+ heading: 'Downloadable Content'
114
+ default_link: 'Download file'
115
+ image_link: 'Download image'
116
+ office_link: 'Download file'
117
+ pdf_link: 'Download PDF'
118
+ single_use_links:
119
+ title: Single-Use Links
120
+ table:
121
+ link: Link
122
+ key: Key
123
+ expires: Expires
124
+ actions: Actions
125
+ no_links: No links have been generated
126
+ download:
127
+ type: Download
128
+ generate: Generate Download Link
129
+ show:
130
+ type: Show
131
+ generate: Generate Show Link
132
+ copy:
133
+ tooltip: Copied!
134
+ button: Copy to Clipboard
135
+ delete: Delete
136
+ expiration:
137
+ time: "in %{value} hours"
138
+ lesser_time: in less than one hour
103
139
  visibility:
104
140
  open:
105
141
  text: "Open Access"
@@ -113,36 +149,38 @@ en:
113
149
  text: "Embargo"
114
150
  class: "label-warning"
115
151
  label_html: <span class="label label-warning">Embargo</span>
152
+ expired:
153
+ authenticated:
154
+ text: "Embargo (Expired, Authenticated)"
155
+ open:
156
+ text: "Embargo (Expired, Open)"
157
+ active:
158
+ authenticated:
159
+ text: "Embargo (Active, Authenticated)"
160
+ restricted:
161
+ text: "Embargo (Active, Restricted)"
116
162
  lease:
117
163
  text: "Lease"
118
164
  class: "label-warning"
119
165
  label_html: <span class="label label-warning">Lease</span>
166
+ active:
167
+ authenticated:
168
+ text: "Lease (Active, Authenticated)"
169
+ open:
170
+ text: "Lease (Active, Open)"
171
+ expired:
172
+ authenticated:
173
+ text: "Lease (Expired, Authenticated)"
174
+ restricted:
175
+ text: "Lease (Expired, Restricted)"
120
176
  private:
121
177
  label_html: <span class="label label-danger">Private</span> Only users and/or groups that have been given specific access in the "Share With" section.
122
178
  restricted:
123
179
  text: "Private"
124
180
  class: "label-danger"
125
- single_use_links:
126
- title: Single-Use Links
127
- table:
128
- link: Link
129
- key: Key
130
- expires: Expires
131
- actions: Actions
132
- no_links: No links have been generated
133
- download:
134
- type: Download
135
- generate: Generate Download Link
136
- show:
137
- type: Show
138
- generate: Generate Show Link
139
- copy:
140
- tooltip: Copied!
141
- button: Copy to Clipboard
142
- delete: Delete
143
- expiration:
144
- time: "in %{value} hours"
145
- lesser_time: in less than one hour
181
+ workflow:
182
+ default:
183
+ deposit: "Deposit"
146
184
  blacklight:
147
185
  search:
148
186
  fields:
@@ -191,13 +229,16 @@ en:
191
229
  identifier_tesim: "Identifier"
192
230
  file_manager:
193
231
  link_text: 'File Manager'
232
+ helpers:
233
+ submit:
234
+ sipity_workflow_responsibility:
235
+ create: "Add"
194
236
  simple_form:
195
237
  required:
196
238
  html: '<span class="label label-info required-tag">required</span>'
197
239
  hints:
198
240
  defaults:
199
241
  description: 'Please keep your description to 300 words or fewer.'
200
- files: 'A PDF is preferred.'
201
242
  labels:
202
243
  defaults:
203
244
  lease_expiration_date: 'until'
data/config/routes.rb CHANGED
@@ -6,6 +6,13 @@ CurationConcerns::Engine.routes.draw do
6
6
  get 'single_use_link/generated/:id' => 'single_use_links#index', as: :generated_single_use_links
7
7
  delete 'single_use_link/:id/delete/:link_id' => 'single_use_links#destroy', as: :delete_single_use_link
8
8
 
9
+ namespace :admin do
10
+ get '/', action: :index, as: :index
11
+ get :resource_details
12
+ get :workflow
13
+ resources :workflow_roles
14
+ end
15
+
9
16
  # mount BrowseEverything::Engine => '/remote_files/browse'
10
17
  resources :classify_concerns, only: [:new, :create]
11
18
 
@@ -25,13 +25,12 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'jquery-ui-rails'
26
26
  spec.add_dependency 'simple_form', '~> 3.1'
27
27
  spec.add_dependency 'hydra-editor', '>= 2', '< 4'
28
- spec.add_dependency 'blacklight_advanced_search', '~> 6.0'
29
28
  spec.add_dependency 'rails_autolink'
30
29
  spec.add_dependency 'sprockets-es6'
31
30
  spec.add_dependency 'kaminari_route_prefix', '~> 0.0.1'
32
31
  spec.add_dependency 'active_attr'
33
32
  spec.add_dependency 'hydra-works', '>= 0.14.0'
34
- spec.add_dependency 'active_fedora-noid', '~> 2.0.0.beta1'
33
+ spec.add_dependency 'active_fedora-noid', '~> 2.0.0.beta5'
35
34
  spec.add_dependency 'qa', '~> 0.5'
36
35
  spec.add_dependency 'redlock', '~> 0.1.2'
37
36
  spec.add_dependency 'solrizer', '~> 3.4'
@@ -40,6 +39,12 @@ Gem::Specification.new do |spec|
40
39
  spec.add_dependency 'awesome_nested_set', '~> 3.0'
41
40
  spec.add_dependency 'browse-everything', '~> 0.10'
42
41
  spec.add_dependency 'clipboard-rails', '~> 1.5'
42
+ spec.add_dependency 'power_converter', '~> 0.1', '>= 0.1.2'
43
+ spec.add_dependency 'dry-validation', '~> 0.9'
44
+ spec.add_dependency 'dry-equalizer', '~> 0.2'
45
+ spec.add_dependency 'dry-struct', '~> 0.1'
46
+ spec.add_dependency 'flot-rails', '~> 0.0.7'
47
+ spec.add_dependency 'highcharts-rails'
43
48
 
44
49
  spec.add_development_dependency 'solr_wrapper', '~> 0.16'
45
50
  spec.add_development_dependency 'fcrepo_wrapper', '~> 0.1'
@@ -49,8 +54,9 @@ Gem::Specification.new do |spec|
49
54
  spec.add_development_dependency "engine_cart", "~> 1.0"
50
55
  spec.add_development_dependency "sqlite3"
51
56
  spec.add_development_dependency "rspec-its"
52
- spec.add_development_dependency "rspec-rails"
57
+ spec.add_development_dependency "rspec-rails", '~> 3.5'
53
58
  spec.add_development_dependency 'rspec-html-matchers'
59
+ spec.add_development_dependency 'shoulda-matchers'
54
60
  spec.add_development_dependency 'equivalent-xml'
55
61
  spec.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0'
56
62
  spec.add_development_dependency "capybara", '~> 2.5'
@@ -0,0 +1,163 @@
1
+ class CreateSipity < ActiveRecord::Migration
2
+ def change
3
+ create_table "sipity_notification_recipients" do |t|
4
+ t.integer "notification_id", null: false
5
+ t.integer "role_id", null: false
6
+ t.string "recipient_strategy", null: false
7
+ t.datetime "created_at", null: false
8
+ t.datetime "updated_at", null: false
9
+ end
10
+
11
+ add_index "sipity_notification_recipients", ["notification_id", "role_id", "recipient_strategy"], name: "sipity_notifications_recipients_surrogate"
12
+ add_index "sipity_notification_recipients", ["notification_id"], name: "sipity_notification_recipients_notification"
13
+ add_index "sipity_notification_recipients", ["recipient_strategy"], name: "sipity_notification_recipients_recipient_strategy"
14
+ add_index "sipity_notification_recipients", ["role_id"], name: "sipity_notification_recipients_role"
15
+
16
+ create_table "sipity_notifications" do |t|
17
+ t.string "name", null: false
18
+ t.string "notification_type", null: false
19
+ t.datetime "created_at", null: false
20
+ t.datetime "updated_at", null: false
21
+ end
22
+
23
+ add_index "sipity_notifications", ["name"], name: "index_sipity_notifications_on_name", unique: true
24
+ add_index "sipity_notifications", ["notification_type"], name: "index_sipity_notifications_on_notification_type"
25
+
26
+ create_table "sipity_notifiable_contexts" do |t|
27
+ t.integer "scope_for_notification_id", null: false
28
+ t.string "scope_for_notification_type", null: false
29
+ t.string "reason_for_notification", null: false
30
+ t.integer "notification_id", null: false
31
+ t.datetime "created_at", null: false
32
+ t.datetime "updated_at", null: false
33
+ end
34
+
35
+ add_index "sipity_notifiable_contexts", ["notification_id"], name: "sipity_notifiable_contexts_notification_id"
36
+ add_index "sipity_notifiable_contexts", ["scope_for_notification_id", "scope_for_notification_type", "reason_for_notification", "notification_id"], name: "sipity_notifiable_contexts_concern_surrogate", unique: true
37
+ add_index "sipity_notifiable_contexts", ["scope_for_notification_id", "scope_for_notification_type", "reason_for_notification"], name: "sipity_notifiable_contexts_concern_context"
38
+ add_index "sipity_notifiable_contexts", ["scope_for_notification_id", "scope_for_notification_type"], name: "sipity_notifiable_contexts_concern"
39
+
40
+ create_table "sipity_agents" do |t|
41
+ t.string "proxy_for_id", null: false
42
+ t.string "proxy_for_type", null: false
43
+ t.datetime "created_at", null: false
44
+ t.datetime "updated_at", null: false
45
+ end
46
+
47
+ add_index "sipity_agents", ["proxy_for_id", "proxy_for_type"], name: "sipity_agents_proxy_for", unique: true
48
+
49
+ create_table "sipity_comments" do |t|
50
+ t.integer "entity_id", null: false
51
+ t.integer "agent_id", null: false
52
+ t.text "comment"
53
+ t.datetime "created_at", null: false
54
+ t.datetime "updated_at", null: false
55
+ end
56
+
57
+ add_index "sipity_comments", ["agent_id"], name: "index_sipity_comments_on_agent_id"
58
+ add_index "sipity_comments", ["created_at"], name: "index_sipity_comments_on_created_at"
59
+ add_index "sipity_comments", ["entity_id"], name: "index_sipity_comments_on_entity_id"
60
+
61
+ create_table "sipity_entities" do |t|
62
+ t.string "proxy_for_global_id", null: false
63
+ t.integer "workflow_id", null: false
64
+ t.integer "workflow_state_id", null: true
65
+ t.datetime "created_at", null: false
66
+ t.datetime "updated_at", null: false
67
+ end
68
+
69
+ add_index "sipity_entities", ["proxy_for_global_id"], name: "sipity_entities_proxy_for_global_id", unique: true
70
+ add_index "sipity_entities", ["workflow_id"], name: "index_sipity_entities_on_workflow_id"
71
+ add_index "sipity_entities", ["workflow_state_id"], name: "index_sipity_entities_on_workflow_state_id"
72
+
73
+ create_table "sipity_entity_specific_responsibilities" do |t|
74
+ t.integer "workflow_role_id", null: false
75
+ t.string "entity_id", null: false
76
+ t.integer "agent_id", null: false
77
+ t.datetime "created_at", null: false
78
+ t.datetime "updated_at", null: false
79
+ end
80
+
81
+ add_index "sipity_entity_specific_responsibilities", ["agent_id"], name: "sipity_entity_specific_responsibilities_agent"
82
+ add_index "sipity_entity_specific_responsibilities", ["entity_id"], name: "sipity_entity_specific_responsibilities_entity"
83
+ add_index "sipity_entity_specific_responsibilities", ["workflow_role_id", "entity_id", "agent_id"], name: "sipity_entity_specific_responsibilities_aggregate", unique: true
84
+ add_index "sipity_entity_specific_responsibilities", ["workflow_role_id"], name: "sipity_entity_specific_responsibilities_role"
85
+
86
+ create_table "sipity_workflows" do |t|
87
+ t.string "name", null: false
88
+ t.string "label"
89
+ t.text "description"
90
+ t.datetime "created_at", null: false
91
+ t.datetime "updated_at", null: false
92
+ end
93
+
94
+ add_index "sipity_workflows", ["name"], name: "index_sipity_workflows_on_name", unique: true
95
+
96
+ create_table "sipity_workflow_actions" do |t|
97
+ t.integer "workflow_id", null: false
98
+ t.integer "resulting_workflow_state_id"
99
+ t.string "name", null: false
100
+ t.datetime "created_at", null: false
101
+ t.datetime "updated_at", null: false
102
+ end
103
+
104
+ add_index "sipity_workflow_actions", ["resulting_workflow_state_id"], name: "sipity_workflow_actions_resulting_workflow_state"
105
+ add_index "sipity_workflow_actions", ["workflow_id", "name"], name: "sipity_workflow_actions_aggregate", unique: true
106
+ add_index "sipity_workflow_actions", ["workflow_id"], name: "sipity_workflow_actions_workflow"
107
+
108
+ create_table "sipity_workflow_responsibilities" do |t|
109
+ t.integer "agent_id", null: false
110
+ t.integer "workflow_role_id", null: false
111
+ t.datetime "created_at", null: false
112
+ t.datetime "updated_at", null: false
113
+ end
114
+
115
+ add_index "sipity_workflow_responsibilities", ["agent_id", "workflow_role_id"], name: "sipity_workflow_responsibilities_aggregate", unique: true
116
+
117
+ create_table "sipity_workflow_roles" do |t|
118
+ t.integer "workflow_id", null: false
119
+ t.integer "role_id", null: false
120
+ t.datetime "created_at", null: false
121
+ t.datetime "updated_at", null: false
122
+ end
123
+
124
+ add_index "sipity_workflow_roles", ["workflow_id", "role_id"], name: "sipity_workflow_roles_aggregate", unique: true
125
+
126
+ create_table "sipity_workflow_state_action_permissions" do |t|
127
+ t.integer "workflow_role_id", null: false
128
+ t.integer "workflow_state_action_id", null: false
129
+ t.datetime "created_at", null: false
130
+ t.datetime "updated_at", null: false
131
+ end
132
+
133
+ add_index "sipity_workflow_state_action_permissions", ["workflow_role_id", "workflow_state_action_id"], name: "sipity_workflow_state_action_permissions_aggregate", unique: true
134
+
135
+ create_table "sipity_workflow_state_actions" do |t|
136
+ t.integer "originating_workflow_state_id", null: false
137
+ t.integer "workflow_action_id", null: false
138
+ t.datetime "created_at", null: false
139
+ t.datetime "updated_at", null: false
140
+ end
141
+
142
+ add_index "sipity_workflow_state_actions", ["originating_workflow_state_id", "workflow_action_id"], name: "sipity_workflow_state_actions_aggregate", unique: true
143
+
144
+ create_table "sipity_workflow_states" do |t|
145
+ t.integer "workflow_id", null: false
146
+ t.string "name", null: false
147
+ t.datetime "created_at", null: false
148
+ t.datetime "updated_at", null: false
149
+ end
150
+
151
+ add_index "sipity_workflow_states", ["name"], name: "index_sipity_workflow_states_on_name"
152
+ add_index "sipity_workflow_states", ["workflow_id", "name"], name: "sipity_type_state_aggregate", unique: true
153
+
154
+ create_table "sipity_roles" do |t|
155
+ t.string "name", null: false
156
+ t.text "description"
157
+ t.datetime "created_at", null: false
158
+ t.datetime "updated_at", null: false
159
+ end
160
+
161
+ add_index "sipity_roles", ["name"], name: "index_sipity_roles_on_name", unique: true
162
+ end
163
+ end
@@ -0,0 +1,10 @@
1
+ class CreateSipityWorkflowMethods < ActiveRecord::Migration
2
+ def change
3
+ create_table :sipity_workflow_methods do |t|
4
+ t.string "service_name", null: false
5
+ t.integer "weight", null: false
6
+ t.integer "workflow_action_id", index: true, null: false
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end