curation_concerns 1.6.3 → 1.7.0.beta1
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.travis.yml +2 -8
- data/README.md +27 -1
- data/app/actors/curation_concerns/actors/base_actor.rb +2 -3
- data/app/actors/curation_concerns/actors/file_set_actor.rb +1 -1
- data/app/actors/curation_concerns/actors/grant_edit_to_depositor_actor.rb +19 -0
- data/app/actors/curation_concerns/actors/initialize_workflow_actor.rb +19 -0
- data/app/assets/javascripts/curation_concerns/charts.js +47 -0
- data/app/assets/javascripts/curation_concerns/curation_concerns.js +2 -0
- data/app/assets/javascripts/curation_concerns/workflow_actions_affix.js +11 -0
- data/app/assets/stylesheets/curation_concerns/_admin.scss +18 -0
- data/app/assets/stylesheets/curation_concerns/_curation_concerns.scss +1 -0
- data/app/assets/stylesheets/curation_concerns/_positioning.scss +11 -0
- data/app/controllers/concerns/curation_concerns/act_as_admin_controller.rb +25 -0
- data/app/controllers/concerns/curation_concerns/admin_controller_behavior.rb +38 -0
- data/app/controllers/concerns/curation_concerns/admin_page.rb +18 -0
- data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +3 -2
- data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +158 -159
- data/app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb +4 -6
- data/app/controllers/concerns/curation_concerns/file_sets_controller_behavior.rb +2 -1
- data/app/controllers/concerns/curation_concerns/leases_controller_behavior.rb +4 -6
- data/app/controllers/concerns/curation_concerns/single_use_links_viewer_controller_behavior.rb +2 -1
- data/app/controllers/curation_concerns/admin/workflow_roles_controller.rb +36 -0
- data/app/controllers/curation_concerns/workflow_actions_controller.rb +25 -0
- data/app/conversions/power_converters/polymorphic_type.rb +7 -0
- data/app/conversions/power_converters/sipity_action.rb +9 -0
- data/app/conversions/power_converters/sipity_action_name.rb +8 -0
- data/app/conversions/power_converters/sipity_agent.rb +6 -0
- data/app/conversions/power_converters/sipity_entity.rb +12 -0
- data/app/conversions/power_converters/sipity_role.rb +8 -0
- data/app/conversions/power_converters/sipity_workflow_id.rb +16 -0
- data/app/conversions/power_converters/sipity_workflow_state.rb +10 -0
- data/app/conversions/power_converters.rb +6 -0
- data/app/forms/curation_concerns/forms/workflow_action_form.rb +62 -0
- data/app/forms/curation_concerns/forms/workflow_responsibility_form.rb +42 -0
- data/app/helpers/curation_concerns/charts_helper.rb +23 -0
- data/app/helpers/curation_concerns/main_app_helpers.rb +1 -0
- data/app/helpers/curation_concerns/url_helper.rb +2 -5
- data/app/indexers/curation_concerns/indexes_workflow.rb +44 -0
- data/app/indexers/curation_concerns/work_indexer.rb +1 -2
- data/app/jobs/import_export_job.rb +46 -0
- data/app/models/concerns/curation_concerns/ability.rb +2 -0
- data/app/models/concerns/curation_concerns/permissions/writable.rb +7 -8
- data/app/models/concerns/curation_concerns/publishable.rb +6 -0
- data/app/models/concerns/curation_concerns/solr_document_behavior.rb +8 -0
- data/app/models/concerns/curation_concerns/user.rb +5 -0
- data/app/models/curation_concerns/group.rb +23 -0
- data/app/models/curation_concerns/workflow_action_info.rb +13 -0
- data/app/models/sipity/agent.rb +21 -0
- data/app/models/sipity/comment.rb +13 -0
- data/app/models/sipity/entity.rb +32 -0
- data/app/models/sipity/entity_specific_responsibility.rb +21 -0
- data/app/models/sipity/method.rb +5 -0
- data/app/models/sipity/notifiable_context.rb +26 -0
- data/app/models/sipity/notification.rb +28 -0
- data/app/models/sipity/notification_recipient.rb +17 -0
- data/app/models/sipity/role.rb +43 -0
- data/app/models/sipity/workflow.rb +19 -0
- data/app/models/sipity/workflow_action.rb +25 -0
- data/app/models/sipity/workflow_responsibility.rb +23 -0
- data/app/models/sipity/workflow_role.rb +13 -0
- data/app/models/sipity/workflow_state.rb +26 -0
- data/app/models/sipity/workflow_state_action.rb +9 -0
- data/app/models/sipity/workflow_state_action_permission.rb +8 -0
- data/app/models/vocab/fedora_resource_status.rb +4 -1
- data/app/presenters/curation_concerns/admin/workflow_role_presenter.rb +40 -0
- data/app/presenters/curation_concerns/work_show_presenter.rb +4 -0
- data/app/presenters/curation_concerns/workflow_presenter.rb +43 -0
- data/app/renderers/curation_concerns/renderers/rights_attribute_renderer.rb +1 -1
- data/app/search_builders/curation_concerns/search_filters.rb +0 -1
- data/app/services/curation_concerns/actors/actor_factory.rb +3 -1
- data/app/services/curation_concerns/admin_set_service.rb +13 -4
- data/app/services/curation_concerns/work_form_service.rb +11 -0
- data/app/services/curation_concerns/workflow/action_taken_service.rb +57 -0
- data/app/services/curation_concerns/workflow/activate_object.rb +9 -0
- data/app/services/curation_concerns/workflow/deactivate_object.rb +11 -0
- data/app/services/curation_concerns/workflow/default_workflow_strategy.rb +13 -0
- data/app/services/curation_concerns/workflow/method_generator.rb +55 -0
- data/app/services/curation_concerns/workflow/notification_configuration_parameter.rb +42 -0
- data/app/services/curation_concerns/workflow/notification_generator.rb +64 -0
- data/app/services/curation_concerns/workflow/notification_service.rb +66 -0
- data/app/services/curation_concerns/workflow/permission_generator.rb +95 -0
- data/app/services/curation_concerns/workflow/permission_query.rb +432 -0
- data/app/services/curation_concerns/workflow/remove_depositor_permissions.rb +11 -0
- data/app/services/curation_concerns/workflow/sipity_actions_generator.rb +49 -0
- data/app/services/curation_concerns/workflow/state_machine_generator.rb +102 -0
- data/app/services/curation_concerns/workflow/status_list_service.rb +52 -0
- data/app/services/curation_concerns/workflow/workflow_action_service.rb +56 -0
- data/app/services/curation_concerns/workflow/workflow_by_model_name_strategy.rb +14 -0
- data/app/services/curation_concerns/workflow/workflow_factory.rb +64 -0
- data/app/services/curation_concerns/workflow/workflow_importer.rb +103 -0
- data/app/services/curation_concerns/workflow/workflow_permissions_generator.rb +49 -0
- data/app/services/curation_concerns/workflow/workflow_schema.rb +56 -0
- data/app/services/rights_service.rb +1 -1
- data/app/services/sipity.rb +2 -0
- data/app/sources/curation_concerns/resource_statistics_source.rb +101 -0
- data/app/values/curation_concerns/chart_data.rb +61 -0
- data/app/views/curation_concerns/admin/_admin_menu.html.erb +5 -0
- data/app/views/curation_concerns/admin/_resource_stats.html.erb +43 -0
- data/app/views/curation_concerns/admin/_sidebar.html.erb +3 -0
- data/app/views/curation_concerns/admin/_total_embargo_visibility.html.erb +21 -0
- data/app/views/curation_concerns/admin/_total_objects.html.erb +1 -0
- data/app/views/curation_concerns/admin/_total_objects_charts.html.erb +12 -0
- data/app/views/curation_concerns/admin/index.html.erb +11 -0
- data/app/views/curation_concerns/admin/widgets/_pie.html.erb +1 -0
- data/app/views/curation_concerns/admin/workflow.html.erb +31 -0
- data/app/views/curation_concerns/admin/workflow_roles/index.html.erb +45 -0
- data/app/views/curation_concerns/base/_form_rights.html.erb +1 -1
- data/app/views/curation_concerns/base/_workflow_actions.html.erb +39 -0
- data/app/views/curation_concerns/base/show.html.erb +2 -0
- data/app/views/curation_concerns/file_sets/media_display/_office_document.html.erb +0 -1
- data/app/views/layouts/_head_tag_content.html.erb +13 -0
- data/app/views/layouts/admin.html.erb +10 -0
- data/app/views/shared/_my_actions.html.erb +4 -1
- data/config/initializers/precompile_assets.rb +1 -0
- data/config/locales/curation_concerns.en.yml +97 -56
- data/config/routes.rb +7 -0
- data/curation_concerns.gemspec +9 -3
- data/db/migrate/20160919151348_create_sipity.rb +163 -0
- data/db/migrate/20161012182404_create_sipity_workflow_methods.rb +10 -0
- data/lib/curation_concerns/configuration.rb +68 -0
- data/lib/curation_concerns/engine.rb +9 -1
- data/lib/curation_concerns/rails/routes.rb +1 -0
- data/lib/curation_concerns/version.rb +1 -1
- data/lib/curation_concerns.rb +1 -1
- data/lib/generators/curation_concerns/admin_dashboard_generator.rb +15 -0
- data/lib/generators/curation_concerns/install_generator.rb +7 -0
- data/lib/generators/curation_concerns/sample_data_generator.rb +12 -0
- data/lib/generators/curation_concerns/templates/app/controllers/curation_concerns/admin_controller.rb +61 -0
- data/lib/generators/curation_concerns/templates/catalog_controller.rb +1 -3
- data/lib/generators/curation_concerns/templates/config/curation_concerns.rb +39 -0
- data/lib/generators/curation_concerns/templates/db/seeds.rb +94 -0
- data/lib/generators/curation_concerns/templates/spec/models/collection_spec.rb +1 -1
- data/lib/generators/curation_concerns/templates/spec/models/file_set_spec.rb +1 -1
- data/lib/generators/curation_concerns/templates/workflow.json.erb +19 -0
- data/lib/generators/curation_concerns/work/USAGE +1 -0
- data/lib/generators/curation_concerns/work/templates/actor_spec.rb.erb +1 -1
- data/lib/generators/curation_concerns/work/templates/controller_spec.rb.erb +1 -1
- data/lib/generators/curation_concerns/work/templates/feature_spec.rb.erb +1 -1
- data/lib/generators/curation_concerns/work/templates/form_spec.rb.erb +1 -1
- data/lib/generators/curation_concerns/work/templates/model_spec.rb.erb +1 -1
- data/spec/abilities/admin_ability_spec.rb +15 -0
- data/spec/actors/curation_concerns/file_set_actor_spec.rb +24 -0
- data/spec/actors/curation_concerns/grant_edit_to_depositor_actor_spec.rb +32 -0
- data/spec/actors/curation_concerns/initialize_workflow_actor_spec.rb +33 -0
- data/spec/actors/curation_concerns/interpret_visibility_actor_spec.rb +1 -0
- data/spec/actors/curation_concerns/work_actor_spec.rb +10 -5
- data/spec/controllers/curation_concerns/acts_as_admin_controller_spec.rb +22 -0
- data/spec/controllers/curation_concerns/admin/workflow_roles_controller_spec.rb +26 -0
- data/spec/controllers/curation_concerns/admin_controller_spec.rb +64 -0
- data/spec/controllers/curation_concerns/generic_works_controller_json_spec.rb +11 -3
- data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +4 -4
- data/spec/controllers/curation_concerns/workflow_actions_controller_spec.rb +36 -0
- data/spec/conversions/power_converters/polymorphic_type_spec.rb +22 -0
- data/spec/conversions/power_converters/sipity_action_name_spec.rb +32 -0
- data/spec/conversions/power_converters/sipity_action_spec.rb +43 -0
- data/spec/conversions/power_converters/sipity_agent_spec.rb +20 -0
- data/spec/conversions/power_converters/sipity_entity_spec.rb +46 -0
- data/spec/conversions/power_converters/sipity_role_spec.rb +33 -0
- data/spec/conversions/power_converters/sipity_workflow_id_spec.rb +28 -0
- data/spec/conversions/power_converters/sipity_workflow_state_spec.rb +22 -0
- data/spec/factories/generic_works.rb +19 -6
- data/spec/factories/sipity_entities.rb +7 -0
- data/spec/factories/workflow_actions.rb +6 -0
- data/spec/factories/workflow_states.rb +6 -0
- data/spec/factories/workflows.rb +5 -0
- data/spec/features/admin_spec.rb +14 -0
- data/spec/features/create_child_work_spec.rb +1 -1
- data/spec/features/create_work_spec.rb +1 -1
- data/spec/features/embargo_spec.rb +1 -1
- data/spec/features/lease_spec.rb +1 -1
- data/spec/features/work_generator_spec.rb +2 -2
- data/spec/features/workflow_roles_spec.rb +48 -0
- data/spec/forms/curation_concerns/forms/workflow_action_form_spec.rb +111 -0
- data/spec/forms/curation_concerns/forms/workflow_responsibility_form_spec.rb +33 -0
- data/spec/helpers/curation_concerns/charts_helper_spec.rb +62 -0
- data/spec/helpers/url_helper_spec.rb +11 -11
- data/spec/indexers/work_indexer_spec.rb +13 -1
- data/spec/javascripts/charts_spec.coffee +10 -0
- data/spec/javascripts/fixtures/chart_example.html +1 -0
- data/spec/jobs/import_export_job_spec.rb +28 -0
- data/spec/models/curation_concerns/group_spec.rb +15 -0
- data/spec/models/file_set_spec.rb +6 -2
- data/spec/models/generic_work_spec.rb +12 -0
- data/spec/models/sipity/agent_spec.rb +9 -0
- data/spec/models/sipity/comment_spec.rb +16 -0
- data/spec/models/sipity/entity_spec.rb +27 -0
- data/spec/models/sipity/entity_specific_responsibility_spec.rb +8 -0
- data/spec/models/sipity/notifiable_context_spec.rb +8 -0
- data/spec/models/sipity/notification_recipient_spec.rb +10 -0
- data/spec/models/sipity/notification_spec.rb +15 -0
- data/spec/models/sipity/role_spec.rb +30 -0
- data/spec/models/sipity/workflow_action_spec.rb +10 -0
- data/spec/models/sipity/workflow_responsibility_spec.rb +7 -0
- data/spec/models/sipity/workflow_role_spec.rb +7 -0
- data/spec/models/sipity/workflow_spec.rb +15 -0
- data/spec/models/sipity/workflow_state_action_permission_spec.rb +7 -0
- data/spec/models/sipity/workflow_state_action_spec.rb +7 -0
- data/spec/models/sipity/workflow_state_spec.rb +7 -0
- data/spec/models/user_spec.rb +12 -1
- data/spec/presenters/curation_concerns/work_show_presenter_spec.rb +12 -1
- data/spec/presenters/curation_concerns/workflow_presenter_spec.rb +39 -0
- data/spec/routing/route_spec.rb +13 -0
- data/spec/services/curation_concerns/admin_set_service_spec.rb +13 -0
- data/spec/services/curation_concerns/qa_select_service_spec.rb +75 -0
- data/spec/services/curation_concerns/workflow/action_taken_service_spec.rb +76 -0
- data/spec/services/curation_concerns/workflow/activate_object_spec.rb +20 -0
- data/spec/services/curation_concerns/workflow/deactivate_object_spec.rb +20 -0
- data/spec/services/curation_concerns/workflow/method_generator_spec.rb +43 -0
- data/spec/services/curation_concerns/workflow/notification_configuration_parameter_spec.rb +25 -0
- data/spec/services/curation_concerns/workflow/notification_generator_spec.rb +27 -0
- data/spec/services/curation_concerns/workflow/notification_service_spec.rb +81 -0
- data/spec/services/curation_concerns/workflow/permission_generator_spec.rb +52 -0
- data/spec/services/curation_concerns/workflow/permission_query_spec.rb +179 -0
- data/spec/services/curation_concerns/workflow/remove_depositor_permissions_spec.rb +21 -0
- data/spec/services/curation_concerns/workflow/sipity_actions_generator_spec.rb +30 -0
- data/spec/services/curation_concerns/workflow/state_machine_generator_spec.rb +46 -0
- data/spec/services/curation_concerns/workflow/status_list_service_spec.rb +46 -0
- data/spec/services/curation_concerns/workflow/workflow_importer_spec.rb +50 -0
- data/spec/services/curation_concerns/workflow/workflow_permissions_generator_spec.rb +37 -0
- data/spec/services/curation_concerns/workflow/workflow_schema_spec.rb +85 -0
- data/spec/sources/curation_concerns/resource_statistics_source_spec.rb +137 -0
- data/spec/spec_helper.rb +8 -1
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +11 -0
- data/spec/views/curation_concerns/admin/_admin_menu.html.erb_spec.rb +23 -0
- data/spec/views/curation_concerns/admin/_resource_stats.html.erb_spec.rb +33 -0
- data/spec/views/curation_concerns/admin/_total_objects_charts.html.erb_spec.rb +28 -0
- data/spec/views/curation_concerns/admin/index.html.erb_spec.rb +26 -0
- data/spec/views/curation_concerns/admin/widgets/_pie.html.erb_spec.rb +17 -0
- data/spec/views/curation_concerns/base/file_manager.html.erb_spec.rb +1 -1
- data/spec/views/curation_concerns/base/show.html.erb_spec.rb +33 -0
- data/spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb +1 -1
- data/spec/views/shared/_my_actions.html.erb_spec.rb +1 -0
- data/tasks/workflow.rake +8 -0
- metadata +335 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 976d4594c0d89e8f8fc0fb3eb2e3fda2bc0de0e7
|
|
4
|
+
data.tar.gz: 0bba18a25f0eb32c5998c071544accdd09bcebd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2edb7a435f0b294fa1018bca41904327219d0b75ddc8ed736b20851b5d57bce7142085241e9d73e2d4df6c2784fad14fbe8851ff4f8302040af7e1cd2fb4472b
|
|
7
|
+
data.tar.gz: 1b31bc0aefd9067b0874e1dd0ab3e383a2a4c5f8b6190a2d977892d17b78edc9acdea5f7a8b3795d087f75cbc23d6ec1b0810da1851ab6bee974c28463bbd5eb
|
data/.rubocop.yml
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require: rubocop-rspec
|
|
2
2
|
AllCops:
|
|
3
3
|
DisplayCopNames: true
|
|
4
|
+
TargetRubyVersion: 2.1
|
|
4
5
|
Include:
|
|
5
6
|
- '**/Rakefile'
|
|
6
7
|
- '**/config.ru'
|
|
@@ -47,6 +48,8 @@ Metrics/ModuleLength:
|
|
|
47
48
|
- 'app/controllers/concerns/curation_concerns/file_sets_controller_behavior.rb'
|
|
48
49
|
- 'app/models/concerns/curation_concerns/solr_document_behavior.rb'
|
|
49
50
|
- 'app/controllers/concerns/curation_concerns/collections_controller_behavior.rb'
|
|
51
|
+
- 'app/services/curation_concerns/workflow/permission_query.rb'
|
|
52
|
+
- 'spec/services/curation_concerns/workflow/permission_query_spec.rb'
|
|
50
53
|
|
|
51
54
|
Style/ZeroLengthPredicate:
|
|
52
55
|
Enabled: false
|
|
@@ -165,6 +168,7 @@ RSpec/DescribeClass:
|
|
|
165
168
|
- 'spec/views/**/*'
|
|
166
169
|
- 'spec/routing/**/*'
|
|
167
170
|
- 'spec/inputs/**/*'
|
|
171
|
+
- 'spec/conversions/**/*'
|
|
168
172
|
|
|
169
173
|
RSpec/DescribedClass:
|
|
170
174
|
Exclude:
|
data/.travis.yml
CHANGED
|
@@ -7,15 +7,9 @@ env:
|
|
|
7
7
|
global:
|
|
8
8
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
|
9
9
|
matrix:
|
|
10
|
-
- RAILS_VERSION=4.2.7
|
|
10
|
+
- RAILS_VERSION=4.2.7.1
|
|
11
11
|
RDF_VERSION=1.99.1
|
|
12
|
-
- RAILS_VERSION=5.0.0
|
|
12
|
+
- RAILS_VERSION=5.0.0.1
|
|
13
13
|
RDF_VERSION=2.1.0
|
|
14
|
-
notifications:
|
|
15
|
-
irc:
|
|
16
|
-
channels:
|
|
17
|
-
- "irc.freenode.org#projecthydra"
|
|
18
|
-
template:
|
|
19
|
-
- "%{repository}//%{branch}@%{commit} by %{author}: %{message} - %{build_url}"
|
|
20
14
|
before_script:
|
|
21
15
|
- jdk_switcher use oraclejdk8
|
data/README.md
CHANGED
|
@@ -11,7 +11,6 @@ Docs: [](http://slack.projecthydra.org/) [](http://waffle.io/projecthydra/curation_concerns)
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on [Hydra::Works](http://github.com/projecthydra/hydra-works)) and providing a generator for defining object types with custom workflows, views, access controls, etc.
|
|
16
15
|
|
|
17
16
|
## Prerequisites
|
|
@@ -109,6 +108,33 @@ rake engine_cart:generate
|
|
|
109
108
|
rake curation_concerns:spec
|
|
110
109
|
```
|
|
111
110
|
|
|
111
|
+
### Workflow
|
|
112
|
+
|
|
113
|
+
Load the workflows, workflow states, transitions and user roles:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
$ rails curation_concerns:workflow:load
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Now that the Roles are loaded, grant the appropriate roles to the users by visiting the "Workflow Roles" section of the admin dashboard
|
|
120
|
+
|
|
121
|
+
[Further documentation](https://github.com/projecthydra/curation_concerns/wiki/Defining-a-Workflow) for defining and customizing workflows.
|
|
122
|
+
|
|
123
|
+
_Something about notification should go here._
|
|
124
|
+
|
|
125
|
+
### Adding Sample Data to Test Application
|
|
126
|
+
|
|
127
|
+
Sometimes when working with the test application, it can be helpful to have a repository populated with some number of objects. Rather than having to create them all through the user interface, which can be timely, the test application bundled with CurationConcerns provides a rake task that automatically creates 24 objects in the test application repository with different titles, levels of visibility, embargoes, and leases:
|
|
128
|
+
|
|
129
|
+
``` bash
|
|
130
|
+
cd .internal_test_app
|
|
131
|
+
rake db:seed
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Configuring the Administration Panel
|
|
135
|
+
|
|
136
|
+
To configure the Administration Pane see [Admin Menu Guide](https://github.com/projecthydra/curation_concerns/wiki/Admin-Menu)
|
|
137
|
+
|
|
112
138
|
## Help
|
|
113
139
|
|
|
114
140
|
If you have questions or need help, please email the [Hydra community tech list](mailto:hydra-tech@googlegroups.com) or stop by the [Hydra community IRC channel](irc://irc.freenode.net/projecthydra).
|
|
@@ -12,7 +12,7 @@ module CurationConcerns
|
|
|
12
12
|
@cloud_resources = attributes.delete(:cloud_resources.to_s)
|
|
13
13
|
apply_creation_data_to_curation_concern
|
|
14
14
|
apply_save_data_to_curation_concern(attributes)
|
|
15
|
-
next_actor.create(attributes) &&
|
|
15
|
+
save && next_actor.create(attributes) && run_callbacks(:after_create_concern)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def update(attributes)
|
|
@@ -38,8 +38,7 @@ module CurationConcerns
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def apply_depositor_metadata
|
|
41
|
-
curation_concern.
|
|
42
|
-
curation_concern.edit_users += [user.user_key]
|
|
41
|
+
curation_concern.depositor = user.user_key
|
|
43
42
|
end
|
|
44
43
|
|
|
45
44
|
def apply_deposit_date
|
|
@@ -125,7 +125,7 @@ module CurationConcerns
|
|
|
125
125
|
end
|
|
126
126
|
|
|
127
127
|
def assign_visibility?(file_set_params = {})
|
|
128
|
-
!((file_set_params || {}).keys & %w(visibility embargo_release_date lease_expiration_date)).empty?
|
|
128
|
+
!((file_set_params || {}).keys.map(&:to_s) & %w(visibility embargo_release_date lease_expiration_date)).empty?
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
# copy visibility from source_concern to destination_concern
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
module Actors
|
|
3
|
+
# Grants edit access to the depositor. This is implemented as a separate actor,
|
|
4
|
+
# so that it can be removed from the stack in cases where the depositor should not
|
|
5
|
+
# have edit access (e.g. mediated deposit)
|
|
6
|
+
class GrantEditToDepositorActor < AbstractActor
|
|
7
|
+
def create(attributes)
|
|
8
|
+
grant_edit_access
|
|
9
|
+
next_actor.create(attributes)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def grant_edit_access
|
|
15
|
+
curation_concern.edit_users += [user.user_key]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
module Actors
|
|
3
|
+
class InitializeWorkflowActor < AbstractActor
|
|
4
|
+
class_attribute :workflow_factory
|
|
5
|
+
self.workflow_factory = ::CurationConcerns::Workflow::WorkflowFactory
|
|
6
|
+
|
|
7
|
+
def create(attributes)
|
|
8
|
+
next_actor.create(attributes) && create_workflow(attributes)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
# @return [TrueClass]
|
|
14
|
+
def create_workflow(attributes)
|
|
15
|
+
workflow_factory.create(curation_concern, attributes, user)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//= require highcharts
|
|
2
|
+
//= require highcharts/highcharts-more
|
|
3
|
+
//= require highcharts/modules/drilldown
|
|
4
|
+
|
|
5
|
+
(function( $ ){
|
|
6
|
+
$.fn.pie_chart = function(title, data) {
|
|
7
|
+
// Create the chart
|
|
8
|
+
$(this).highcharts({
|
|
9
|
+
chart: {
|
|
10
|
+
type: 'pie'
|
|
11
|
+
},
|
|
12
|
+
plotOptions: {
|
|
13
|
+
series: {
|
|
14
|
+
dataLabels: {
|
|
15
|
+
enabled: true,
|
|
16
|
+
format: '{point.name}: {point.y}'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
credits: {
|
|
22
|
+
enabled: false
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
tooltip: {
|
|
26
|
+
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
|
|
27
|
+
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.percentage:.2f}%</b> of total<br/>'
|
|
28
|
+
},
|
|
29
|
+
series: [{
|
|
30
|
+
name: title,
|
|
31
|
+
colorByPoint: true,
|
|
32
|
+
data: data.series
|
|
33
|
+
}],
|
|
34
|
+
title: null,
|
|
35
|
+
drilldown: data.drilldown
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
})( jQuery );
|
|
39
|
+
|
|
40
|
+
Blacklight.onLoad(function () {
|
|
41
|
+
$('.stats-pie').each (function () {
|
|
42
|
+
series = $(this).data('series');
|
|
43
|
+
title = $(this).data('title');
|
|
44
|
+
drilldown = $(this).data('drilldown');
|
|
45
|
+
$(this).pie_chart(title, series, drilldown);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
//= require curation_concerns/collections
|
|
11
11
|
//= require curation_concerns/file_manager
|
|
12
12
|
//= require curation_concerns/boot
|
|
13
|
+
//= require curation_concerns/charts
|
|
13
14
|
//= require babel/polyfill
|
|
15
|
+
//= require curation_concerns/workflow_actions_affix
|
|
14
16
|
|
|
15
17
|
// Initialize plugins and Bootstrap dropdowns on jQuery's ready event as well as
|
|
16
18
|
// Turbolinks's page change event.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Blacklight.ready(function() {
|
|
2
|
+
$(document).on('scroll', function() {
|
|
3
|
+
var workflowDiv = $('#workflow_controls');
|
|
4
|
+
if($(window).scrollTop() + $(window).height() == $(document).height()){
|
|
5
|
+
workflowDiv.removeClass('workflow-affix');
|
|
6
|
+
}
|
|
7
|
+
if($(window).scrollTop() + $(window).height() < $('.form-actions').position().top) {
|
|
8
|
+
workflowDiv.addClass('workflow-affix');
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@mixin widget-partial($col: 12) {
|
|
2
|
+
@include make-sm-column(12);
|
|
3
|
+
@include make-md-column($col);
|
|
4
|
+
.partial-wrapper {
|
|
5
|
+
@extend .panel;
|
|
6
|
+
@extend .panel-default;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.partial-total_objects {
|
|
11
|
+
@include widget-partial;
|
|
12
|
+
}
|
|
13
|
+
.partial-total_objects_charts {
|
|
14
|
+
@include widget-partial(6);
|
|
15
|
+
}
|
|
16
|
+
.partial-total_embargo_visibility {
|
|
17
|
+
@include widget-partial(6);
|
|
18
|
+
}
|
|
@@ -138,3 +138,14 @@ legend + .form-group {
|
|
|
138
138
|
display: block;
|
|
139
139
|
padding: 0.5em 0;
|
|
140
140
|
}
|
|
141
|
+
|
|
142
|
+
.workflow-affix {
|
|
143
|
+
position: fixed;
|
|
144
|
+
bottom: 0;
|
|
145
|
+
background: #FFF;
|
|
146
|
+
z-index: 2;
|
|
147
|
+
left: 0;
|
|
148
|
+
right: 0;
|
|
149
|
+
max-width: 1140px;
|
|
150
|
+
margin: 0 auto;
|
|
151
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
# Behavior to allow any controller to be displayed within
|
|
3
|
+
# the administrative dashboard
|
|
4
|
+
#
|
|
5
|
+
# Example useage:
|
|
6
|
+
#
|
|
7
|
+
# module CurationConcerns
|
|
8
|
+
# class Admin::MyController < ApplicationController
|
|
9
|
+
# include CurationConcerns::ActAsAdminController
|
|
10
|
+
#
|
|
11
|
+
# # do my stuff ...
|
|
12
|
+
# end
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
module ActAsAdminController
|
|
16
|
+
extend ActiveSupport::Concern
|
|
17
|
+
included do
|
|
18
|
+
before_action :load_configuration
|
|
19
|
+
layout 'admin'
|
|
20
|
+
end
|
|
21
|
+
def load_configuration
|
|
22
|
+
@configuration = CurationConcerns::AdminController.configuration
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
module AdminControllerBehavior
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
include AdminPage
|
|
7
|
+
before_action :require_permissions
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def index
|
|
11
|
+
@resource_statistics = @configuration.fetch(:data_sources).fetch(:resource_stats).new
|
|
12
|
+
render 'index'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def search_builder
|
|
16
|
+
@search_builder ||= ::CatalogController.new.search_builder
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def repository
|
|
20
|
+
@repository ||= ::CatalogController.new.repository
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def workflow
|
|
24
|
+
@status_list = CurationConcerns::Workflow::StatusListService.new(current_user)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
private
|
|
28
|
+
|
|
29
|
+
def require_permissions
|
|
30
|
+
authorize! :read, :admin_dashboard
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Loads the index action if it's only defined in the configuration.
|
|
34
|
+
def action_missing(action)
|
|
35
|
+
index if @configuration[:actions].include?(action)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module CurationConcerns
|
|
2
|
+
module AdminPage
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
cattr_accessor :configuration
|
|
7
|
+
self.configuration = CurationConcerns.config.dashboard_configuration
|
|
8
|
+
before_action :load_configuration
|
|
9
|
+
layout "admin"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def load_configuration
|
|
15
|
+
@configuration = self.class.configuration.with_indifferent_access
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -17,7 +17,7 @@ module CurationConcerns
|
|
|
17
17
|
# Catch permission errors
|
|
18
18
|
rescue_from Hydra::AccessDenied, CanCan::AccessDenied do |exception|
|
|
19
19
|
if exception.action == :edit
|
|
20
|
-
redirect_to(
|
|
20
|
+
redirect_to(url_for(action: 'show'), alert: 'You do not have sufficient privileges to edit this document')
|
|
21
21
|
elsif current_user && current_user.persisted?
|
|
22
22
|
redirect_to root_url, alert: exception.message
|
|
23
23
|
else
|
|
@@ -273,7 +273,8 @@ module CurationConcerns
|
|
|
273
273
|
end
|
|
274
274
|
end
|
|
275
275
|
|
|
276
|
-
# Include 'catalog' and 'curation_concerns/base' in the search path for views
|
|
276
|
+
# Include 'catalog' and 'curation_concerns/base' in the search path for views, while prefering
|
|
277
|
+
# our local paths. Thus we are unable to just override `self.local_prefixes`
|
|
277
278
|
def _prefixes
|
|
278
279
|
@_prefixes ||= super + ['catalog', 'curation_concerns/base']
|
|
279
280
|
end
|