curation_concerns 1.7.8 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -6
- data/CONTRIBUTING.md +20 -68
- data/app/actors/curation_concerns/actors/add_as_member_of_collections_actor.rb +23 -0
- data/app/actors/curation_concerns/actors/add_to_work_actor.rb +4 -16
- data/app/actors/curation_concerns/actors/apply_order_actor.rb +5 -16
- data/app/assets/javascripts/curation_concerns/file_manager/sorting.es6 +7 -17
- data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +6 -2
- data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +2 -11
- data/app/controllers/concerns/curation_concerns/download_behavior.rb +0 -6
- data/app/forms/curation_concerns/forms/work_form.rb +10 -10
- data/app/indexers/curation_concerns/collection_indexer.rb +5 -0
- data/app/indexers/curation_concerns/work_indexer.rb +2 -0
- data/app/jobs/characterize_job.rb +5 -12
- data/app/jobs/create_derivatives_job.rb +5 -10
- data/app/jobs/ingest_file_job.rb +9 -13
- data/app/models/concerns/curation_concerns/ability.rb +0 -1
- data/app/models/concerns/curation_concerns/collection.rb +14 -0
- data/app/models/concerns/curation_concerns/required_metadata.rb +4 -0
- data/app/models/concerns/curation_concerns/solr_document_behavior.rb +4 -0
- data/app/models/concerns/curation_concerns/work_behavior.rb +0 -6
- data/app/presenters/curation_concerns/admin/workflow_role_presenter.rb +0 -4
- data/app/presenters/curation_concerns/collection_presenter.rb +4 -0
- data/app/presenters/curation_concerns/work_show_presenter.rb +52 -19
- data/app/search_builders/curation_concerns/collection_member_search_builder.rb +15 -1
- data/app/services/curation_concerns/actors/actor_factory.rb +1 -2
- data/app/services/curation_concerns/workflow/grant_edit_to_depositor.rb +1 -1
- data/app/services/curation_concerns/workflow/permission_query.rb +1 -4
- data/app/services/curation_concerns/workflow/workflow_factory.rb +1 -1
- data/app/services/curation_concerns/workflow/workflow_importer.rb +0 -1
- data/app/services/curation_concerns/workflow/workflow_schema.rb +0 -1
- data/app/views/catalog/_action_menu_partials/_default.html.erb +1 -7
- data/app/views/collections/_document_header.html.erb +0 -4
- data/app/views/collections/_edit_actions.html.erb +0 -1
- data/app/views/collections/_form.html.erb +1 -0
- data/app/views/collections/_show_actions.html.erb +1 -1
- data/app/views/collections/edit.html.erb +2 -2
- data/app/views/curation_concerns/admin/workflow_roles/index.html.erb +2 -1
- data/app/views/curation_concerns/base/_attributes.html.erb +3 -0
- data/app/views/curation_concerns/base/_file_manager_member_resource_options.html.erb +2 -2
- data/app/views/curation_concerns/base/_file_manager_members.html.erb +5 -13
- data/app/views/curation_concerns/base/_file_manager_resource_form.html.erb +1 -1
- data/app/views/curation_concerns/base/_form.html.erb +0 -5
- data/app/views/curation_concerns/base/_form_member_of_collections.html.erb +4 -0
- data/app/views/curation_concerns/base/_form_supplementary_fields.html.erb +1 -0
- data/app/views/curation_concerns/base/_member_of_collections.html.erb +10 -0
- data/app/views/curation_concerns/base/_show_actions.html.erb +0 -4
- data/app/views/curation_concerns/base/file_manager.html.erb +2 -2
- data/app/views/curation_concerns/base/show.json.jbuilder +1 -2
- data/config/locales/curation_concerns.en.yml +0 -4
- data/curation_concerns.gemspec +3 -2
- data/lib/curation_concerns/version.rb +1 -1
- data/lib/generators/curation_concerns/templates/catalog_controller.rb +1 -0
- data/spec/actors/curation_concerns/apply_order_actor_spec.rb +0 -20
- data/spec/actors/curation_concerns/work_actor_spec.rb +10 -14
- data/spec/controllers/curation_concerns/collections_controller_spec.rb +19 -14
- data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +1 -2
- data/spec/controllers/downloads_controller_spec.rb +6 -5
- data/spec/features/collection_spec.rb +21 -6
- data/spec/features/create_child_work_spec.rb +2 -16
- data/spec/features/create_work_spec.rb +6 -13
- data/spec/features/work_generator_spec.rb +0 -9
- data/spec/forms/work_form_spec.rb +0 -8
- data/spec/indexers/collection_indexer_spec.rb +14 -0
- data/spec/models/collection_spec.rb +11 -48
- data/spec/models/curation_concerns/work_behavior_spec.rb +3 -3
- data/spec/models/file_set_spec.rb +3 -2
- data/spec/presenters/curation_concerns/work_show_presenter_spec.rb +21 -27
- data/spec/services/curation_concerns/workflow/grant_edit_to_depositor_spec.rb +4 -15
- data/spec/services/curation_concerns/workflow/permission_query_spec.rb +1 -7
- data/spec/services/curation_concerns/workflow/workflow_importer_spec.rb +2 -5
- data/spec/services/curation_concerns/workflow/workflow_schema_spec.rb +0 -1
- data/spec/services/graph_exporter_spec.rb +3 -3
- data/spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb +1 -1
- data/spec/views/curation_concerns/base/file_manager.html.erb_spec.rb +8 -10
- data/spec/views/curation_concerns/base/show.json.jbuilder_spec.rb +1 -3
- metadata +28 -32
- data/app/actors/curation_concerns/actors/add_to_collection_actor.rb +0 -42
- data/app/actors/curation_concerns/optimistic_lock_validator.rb +0 -28
- data/app/forms/curation_concerns/forms/file_manager_form.rb +0 -27
- data/app/presenters/curation_concerns/member_presenter_factory.rb +0 -70
- data/app/search_builders/curation_concerns/member_search_builder.rb +0 -21
- data/app/views/catalog/_action_menu_partials/_collection.html.erb +0 -27
- data/app/views/curation_concerns/base/_form_in_works_error.html.erb +0 -3
- data/app/views/curation_concerns/base/_form_ordered_members_error.html.erb +0 -3
- data/db/migrate/20170308175556_add_allows_access_grant_to_workflow.rb +0 -5
- data/spec/actors/curation_concerns/add_to_collections_actor_spec.rb +0 -66
- data/spec/actors/curation_concerns/optimistic_lock_validator_spec.rb +0 -50
- data/spec/forms/curation_concerns/forms/file_manager_form_spec.rb +0 -19
- data/spec/presenters/curation_concerns/member_presenter_factory_spec.rb +0 -25
- data/spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb +0 -33
- data/spec/views/curation_concerns/base/_form.html.erb_spec.rb +0 -35
@@ -10,7 +10,6 @@ RSpec.describe CurationConcerns::Workflow::WorkflowImporter do
|
|
10
10
|
"name": "ulra_submission",
|
11
11
|
"label": "This is the label",
|
12
12
|
"description": "This description could get really long",
|
13
|
-
"allows_access_grant": true,
|
14
13
|
"actions": [{
|
15
14
|
"name": "approve",
|
16
15
|
"transition_to": "reviewed",
|
@@ -43,10 +42,8 @@ RSpec.describe CurationConcerns::Workflow::WorkflowImporter do
|
|
43
42
|
result = described_class.generate_from_json_file(path: path)
|
44
43
|
end.to change { Sipity::Workflow.count }.by(1)
|
45
44
|
expect(result).to match_array(kind_of(Sipity::Workflow))
|
46
|
-
|
47
|
-
expect(
|
48
|
-
expect(first_workflow.description).to eq "This description could get really long"
|
49
|
-
expect(first_workflow.allows_access_grant?).to be true
|
45
|
+
expect(result.first.label).to eq "This is the label"
|
46
|
+
expect(result.first.description).to eq "This description could get really long"
|
50
47
|
end
|
51
48
|
end
|
52
49
|
end
|
@@ -8,10 +8,10 @@ RSpec.describe CurationConcerns::GraphExporter do
|
|
8
8
|
|
9
9
|
describe "fetch" do
|
10
10
|
subject { service.fetch }
|
11
|
-
let(:ttl) { subject.dump(:
|
11
|
+
let(:ttl) { subject.dump(:ntriples) }
|
12
12
|
it "transforms suburis to hashcodes" do
|
13
|
-
expect(ttl).to match %r{<http://localhost/concern/generic_works/#{work.id}>
|
14
|
-
expect(ttl).to match %r{<http://purl\.org/dc/terms/title> "Test title"
|
13
|
+
expect(ttl).to match %r{<http://localhost/concern/generic_works/#{work.id}> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://projecthydra.org/works/models#Work>}
|
14
|
+
expect(ttl).to match %r{<http://purl\.org/dc/terms/title> "Test title"}
|
15
15
|
expect(ttl).to match %r{<http://www\.w3\.org/ns/auth/acl#accessControl> <http://localhost/catalog/}
|
16
16
|
|
17
17
|
query = subject.query([RDF::URI("http://localhost/concern/generic_works/#{work.id}"),
|
@@ -14,7 +14,7 @@ describe 'curation_concerns/base/show_actions' do
|
|
14
14
|
let(:editor) { true }
|
15
15
|
let(:collector) { true }
|
16
16
|
it "shows the add to collection link" do
|
17
|
-
expect(rendered).
|
17
|
+
expect(rendered).not_to have_link 'Add to a Collection'
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -26,21 +26,19 @@ RSpec.describe "curation_concerns/base/file_manager.html.erb" do
|
|
26
26
|
end
|
27
27
|
let(:resource) { FactoryGirl.build(:file_set) }
|
28
28
|
|
29
|
-
let(:parent) { build(:generic_work) }
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
let(:parent) { FactoryGirl.build(:generic_work) }
|
30
|
+
let(:parent_solr_doc) do
|
31
|
+
SolrDocument.new(parent.to_solr.merge(id: "resource"), nil)
|
32
|
+
end
|
33
|
+
let(:parent_presenter) do
|
34
|
+
CurationConcerns::WorkShowPresenter.new(parent_solr_doc, nil, view)
|
33
35
|
end
|
34
36
|
|
35
37
|
let(:blacklight_config) { CatalogController.new.blacklight_config }
|
36
38
|
|
37
39
|
before do
|
38
|
-
allow(
|
39
|
-
|
40
|
-
allow(parent).to receive(:id).and_return('resource')
|
41
|
-
|
42
|
-
allow(form).to receive(:member_presenters).and_return([file_set, member])
|
43
|
-
assign(:form, form)
|
40
|
+
allow(parent_presenter).to receive(:member_presenters).and_return([file_set, member])
|
41
|
+
assign(:presenter, parent_presenter)
|
44
42
|
# Blacklight nonsense
|
45
43
|
allow(view).to receive(:dom_class) { '' }
|
46
44
|
allow(view).to receive(:blacklight_config).and_return(blacklight_config)
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'curation_concerns/base/show.json.jbuilder' do
|
4
|
-
let(:curation_concern) { create(:generic_work) }
|
4
|
+
let(:curation_concern) { FactoryGirl.create(:generic_work) }
|
5
5
|
|
6
6
|
before do
|
7
|
-
allow(curation_concern).to receive(:etag).and_return('W/"87f79d2244ded4239ad1f0e822c8429b1e72b66c"')
|
8
7
|
assign(:curation_concern, curation_concern)
|
9
8
|
render
|
10
9
|
end
|
@@ -18,6 +17,5 @@ describe 'curation_concerns/base/show.json.jbuilder' do
|
|
18
17
|
expected_fields.each do |field_symbol|
|
19
18
|
expect(json).to have_key(field_symbol.to_s)
|
20
19
|
end
|
21
|
-
expect(json['version']).to eq 'W/"87f79d2244ded4239ad1f0e822c8429b1e72b66c"'
|
22
20
|
end
|
23
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curation_concerns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hydra-head
|
@@ -160,16 +160,16 @@ dependencies:
|
|
160
160
|
name: kaminari_route_prefix
|
161
161
|
requirement: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
|
-
- - "
|
163
|
+
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
165
|
+
version: 0.0.1
|
166
166
|
type: :runtime
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
|
-
- - "
|
170
|
+
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
172
|
+
version: 0.0.1
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
174
|
name: active_attr
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,14 +190,14 @@ dependencies:
|
|
190
190
|
requirements:
|
191
191
|
- - ">="
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: 0.
|
193
|
+
version: 0.15.0
|
194
194
|
type: :runtime
|
195
195
|
prerelease: false
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
198
|
- - ">="
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version: 0.
|
200
|
+
version: 0.15.0
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: active_fedora-noid
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -420,6 +420,20 @@ dependencies:
|
|
420
420
|
- - ">="
|
421
421
|
- !ruby/object:Gem::Version
|
422
422
|
version: '0'
|
423
|
+
- !ruby/object:Gem::Dependency
|
424
|
+
name: hydra-pcdm
|
425
|
+
requirement: !ruby/object:Gem::Requirement
|
426
|
+
requirements:
|
427
|
+
- - "~>"
|
428
|
+
- !ruby/object:Gem::Version
|
429
|
+
version: 0.9.0
|
430
|
+
type: :runtime
|
431
|
+
prerelease: false
|
432
|
+
version_requirements: !ruby/object:Gem::Requirement
|
433
|
+
requirements:
|
434
|
+
- - "~>"
|
435
|
+
- !ruby/object:Gem::Version
|
436
|
+
version: 0.9.0
|
423
437
|
- !ruby/object:Gem::Dependency
|
424
438
|
name: solr_wrapper
|
425
439
|
requirement: !ruby/object:Gem::Requirement
|
@@ -758,7 +772,7 @@ files:
|
|
758
772
|
- app/actors/curation_concerns/actors.rb
|
759
773
|
- app/actors/curation_concerns/actors/abstract_actor.rb
|
760
774
|
- app/actors/curation_concerns/actors/actor_stack.rb
|
761
|
-
- app/actors/curation_concerns/actors/
|
775
|
+
- app/actors/curation_concerns/actors/add_as_member_of_collections_actor.rb
|
762
776
|
- app/actors/curation_concerns/actors/add_to_work_actor.rb
|
763
777
|
- app/actors/curation_concerns/actors/apply_order_actor.rb
|
764
778
|
- app/actors/curation_concerns/actors/assign_representative_actor.rb
|
@@ -771,7 +785,6 @@ files:
|
|
771
785
|
- app/actors/curation_concerns/actors/interpret_visibility_actor.rb
|
772
786
|
- app/actors/curation_concerns/actors/lease_actor.rb
|
773
787
|
- app/actors/curation_concerns/actors/root_actor.rb
|
774
|
-
- app/actors/curation_concerns/optimistic_lock_validator.rb
|
775
788
|
- app/assets/images/audio.png
|
776
789
|
- app/assets/images/default.png
|
777
790
|
- app/assets/images/loading.gif
|
@@ -864,7 +877,6 @@ files:
|
|
864
877
|
- app/conversions/power_converters/sipity_workflow_state.rb
|
865
878
|
- app/forms/curation_concerns/forms.rb
|
866
879
|
- app/forms/curation_concerns/forms/collection_edit_form.rb
|
867
|
-
- app/forms/curation_concerns/forms/file_manager_form.rb
|
868
880
|
- app/forms/curation_concerns/forms/file_set_edit_form.rb
|
869
881
|
- app/forms/curation_concerns/forms/work_form.rb
|
870
882
|
- app/forms/curation_concerns/forms/workflow_action_form.rb
|
@@ -960,7 +972,6 @@ files:
|
|
960
972
|
- app/presenters/curation_concerns/file_set_presenter.rb
|
961
973
|
- app/presenters/curation_concerns/inspect_work_presenter.rb
|
962
974
|
- app/presenters/curation_concerns/lease_presenter.rb
|
963
|
-
- app/presenters/curation_concerns/member_presenter_factory.rb
|
964
975
|
- app/presenters/curation_concerns/model_proxy.rb
|
965
976
|
- app/presenters/curation_concerns/permission_badge.rb
|
966
977
|
- app/presenters/curation_concerns/presenter_factory.rb
|
@@ -992,7 +1003,6 @@ files:
|
|
992
1003
|
- app/search_builders/curation_concerns/filter_suppressed.rb
|
993
1004
|
- app/search_builders/curation_concerns/filter_suppressed_with_roles.rb
|
994
1005
|
- app/search_builders/curation_concerns/lease_search_builder.rb
|
995
|
-
- app/search_builders/curation_concerns/member_search_builder.rb
|
996
1006
|
- app/search_builders/curation_concerns/search_filters.rb
|
997
1007
|
- app/search_builders/curation_concerns/single_collection_search_builder.rb
|
998
1008
|
- app/search_builders/curation_concerns/single_result.rb
|
@@ -1057,7 +1067,6 @@ files:
|
|
1057
1067
|
- app/views/batch_select/_add_button.html.erb
|
1058
1068
|
- app/views/batch_select/_check_all.html.erb
|
1059
1069
|
- app/views/batch_select/_tools.html.erb
|
1060
|
-
- app/views/catalog/_action_menu_partials/_collection.html.erb
|
1061
1070
|
- app/views/catalog/_action_menu_partials/_default.html.erb
|
1062
1071
|
- app/views/catalog/_document.html.erb
|
1063
1072
|
- app/views/catalog/_document_list.html.erb
|
@@ -1134,9 +1143,8 @@ files:
|
|
1134
1143
|
- app/views/curation_concerns/base/_form_descriptive_fields.html.erb
|
1135
1144
|
- app/views/curation_concerns/base/_form_files_and_links.html.erb
|
1136
1145
|
- app/views/curation_concerns/base/_form_in_works.html.erb
|
1137
|
-
- app/views/curation_concerns/base/_form_in_works_error.html.erb
|
1138
1146
|
- app/views/curation_concerns/base/_form_media.html.erb
|
1139
|
-
- app/views/curation_concerns/base/
|
1147
|
+
- app/views/curation_concerns/base/_form_member_of_collections.html.erb
|
1140
1148
|
- app/views/curation_concerns/base/_form_permission.html.erb
|
1141
1149
|
- app/views/curation_concerns/base/_form_permission_embargo.html.erb
|
1142
1150
|
- app/views/curation_concerns/base/_form_permission_lease.html.erb
|
@@ -1149,6 +1157,7 @@ files:
|
|
1149
1157
|
- app/views/curation_concerns/base/_form_thumbnail.html.erb
|
1150
1158
|
- app/views/curation_concerns/base/_legally_binding_text.html.erb
|
1151
1159
|
- app/views/curation_concerns/base/_member.html.erb
|
1160
|
+
- app/views/curation_concerns/base/_member_of_collections.html.erb
|
1152
1161
|
- app/views/curation_concerns/base/_multiple_upload.html.erb
|
1153
1162
|
- app/views/curation_concerns/base/_related_files.html.erb
|
1154
1163
|
- app/views/curation_concerns/base/_representative_media.html.erb
|
@@ -1234,7 +1243,6 @@ files:
|
|
1234
1243
|
- db/migrate/20160427155928_create_operations.rb
|
1235
1244
|
- db/migrate/20160919151348_create_sipity.rb
|
1236
1245
|
- db/migrate/20161012182404_create_sipity_workflow_methods.rb
|
1237
|
-
- db/migrate/20170308175556_add_allows_access_grant_to_workflow.rb
|
1238
1246
|
- lib/curation_concerns.rb
|
1239
1247
|
- lib/curation_concerns/callbacks.rb
|
1240
1248
|
- lib/curation_concerns/callbacks/registry.rb
|
@@ -1316,7 +1324,6 @@ files:
|
|
1316
1324
|
- spec/abilities/file_set_abilities_spec.rb
|
1317
1325
|
- spec/abilities/generic_work_abilities_spec.rb
|
1318
1326
|
- spec/abilities/operation_ability_spec.rb
|
1319
|
-
- spec/actors/curation_concerns/add_to_collections_actor_spec.rb
|
1320
1327
|
- spec/actors/curation_concerns/apply_order_actor_spec.rb
|
1321
1328
|
- spec/actors/curation_concerns/embargo_actor_spec.rb
|
1322
1329
|
- spec/actors/curation_concerns/file_actor_spec.rb
|
@@ -1324,7 +1331,6 @@ files:
|
|
1324
1331
|
- spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
|
1325
1332
|
- spec/actors/curation_concerns/interpret_visibility_actor_spec.rb
|
1326
1333
|
- spec/actors/curation_concerns/lease_actor_spec.rb
|
1327
|
-
- spec/actors/curation_concerns/optimistic_lock_validator_spec.rb
|
1328
1334
|
- spec/actors/curation_concerns/work_actor_spec.rb
|
1329
1335
|
- spec/controllers/accepts_batches_controller_spec.rb
|
1330
1336
|
- spec/controllers/catalog_controller_spec.rb
|
@@ -1379,7 +1385,6 @@ files:
|
|
1379
1385
|
- spec/features/work_generator_spec.rb
|
1380
1386
|
- spec/features/workflow_roles_spec.rb
|
1381
1387
|
- spec/forms/collection_edit_form_spec.rb
|
1382
|
-
- spec/forms/curation_concerns/forms/file_manager_form_spec.rb
|
1383
1388
|
- spec/forms/curation_concerns/forms/workflow_action_form_spec.rb
|
1384
1389
|
- spec/forms/curation_concerns/forms/workflow_responsibility_form_spec.rb
|
1385
1390
|
- spec/forms/file_set_edit_form_spec.rb
|
@@ -1465,7 +1470,6 @@ files:
|
|
1465
1470
|
- spec/presenters/curation_concerns/collection_presenter_spec.rb
|
1466
1471
|
- spec/presenters/curation_concerns/file_set_presenter_spec.rb
|
1467
1472
|
- spec/presenters/curation_concerns/inspect_work_presenter_spec.rb
|
1468
|
-
- spec/presenters/curation_concerns/member_presenter_factory_spec.rb
|
1469
1473
|
- spec/presenters/curation_concerns/permission_badge_spec.rb
|
1470
1474
|
- spec/presenters/curation_concerns/presenter_factory_spec.rb
|
1471
1475
|
- spec/presenters/curation_concerns/single_use_link_presenter_spec.rb
|
@@ -1552,9 +1556,7 @@ files:
|
|
1552
1556
|
- spec/views/curation_concerns/admin/_total_objects_charts.html.erb_spec.rb
|
1553
1557
|
- spec/views/curation_concerns/admin/index.html.erb_spec.rb
|
1554
1558
|
- spec/views/curation_concerns/admin/widgets/_pie.html.erb_spec.rb
|
1555
|
-
- spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb
|
1556
1559
|
- spec/views/curation_concerns/base/_attributes.html.erb_spec.rb
|
1557
|
-
- spec/views/curation_concerns/base/_form.html.erb_spec.rb
|
1558
1560
|
- spec/views/curation_concerns/base/_form_rights_spec.rb
|
1559
1561
|
- spec/views/curation_concerns/base/_member.html.erb_spec.rb
|
1560
1562
|
- spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
|
@@ -1597,12 +1599,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1597
1599
|
version: '0'
|
1598
1600
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1599
1601
|
requirements:
|
1600
|
-
- - "
|
1602
|
+
- - ">"
|
1601
1603
|
- !ruby/object:Gem::Version
|
1602
|
-
version:
|
1604
|
+
version: 1.3.1
|
1603
1605
|
requirements: []
|
1604
1606
|
rubyforge_project:
|
1605
|
-
rubygems_version: 2.5.
|
1607
|
+
rubygems_version: 2.5.1
|
1606
1608
|
signing_key:
|
1607
1609
|
specification_version: 4
|
1608
1610
|
summary: A Rails Engine that allows an application to CRUD CurationConcern objects
|
@@ -1615,7 +1617,6 @@ test_files:
|
|
1615
1617
|
- spec/abilities/file_set_abilities_spec.rb
|
1616
1618
|
- spec/abilities/generic_work_abilities_spec.rb
|
1617
1619
|
- spec/abilities/operation_ability_spec.rb
|
1618
|
-
- spec/actors/curation_concerns/add_to_collections_actor_spec.rb
|
1619
1620
|
- spec/actors/curation_concerns/apply_order_actor_spec.rb
|
1620
1621
|
- spec/actors/curation_concerns/embargo_actor_spec.rb
|
1621
1622
|
- spec/actors/curation_concerns/file_actor_spec.rb
|
@@ -1623,7 +1624,6 @@ test_files:
|
|
1623
1624
|
- spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
|
1624
1625
|
- spec/actors/curation_concerns/interpret_visibility_actor_spec.rb
|
1625
1626
|
- spec/actors/curation_concerns/lease_actor_spec.rb
|
1626
|
-
- spec/actors/curation_concerns/optimistic_lock_validator_spec.rb
|
1627
1627
|
- spec/actors/curation_concerns/work_actor_spec.rb
|
1628
1628
|
- spec/controllers/accepts_batches_controller_spec.rb
|
1629
1629
|
- spec/controllers/catalog_controller_spec.rb
|
@@ -1678,7 +1678,6 @@ test_files:
|
|
1678
1678
|
- spec/features/work_generator_spec.rb
|
1679
1679
|
- spec/features/workflow_roles_spec.rb
|
1680
1680
|
- spec/forms/collection_edit_form_spec.rb
|
1681
|
-
- spec/forms/curation_concerns/forms/file_manager_form_spec.rb
|
1682
1681
|
- spec/forms/curation_concerns/forms/workflow_action_form_spec.rb
|
1683
1682
|
- spec/forms/curation_concerns/forms/workflow_responsibility_form_spec.rb
|
1684
1683
|
- spec/forms/file_set_edit_form_spec.rb
|
@@ -1764,7 +1763,6 @@ test_files:
|
|
1764
1763
|
- spec/presenters/curation_concerns/collection_presenter_spec.rb
|
1765
1764
|
- spec/presenters/curation_concerns/file_set_presenter_spec.rb
|
1766
1765
|
- spec/presenters/curation_concerns/inspect_work_presenter_spec.rb
|
1767
|
-
- spec/presenters/curation_concerns/member_presenter_factory_spec.rb
|
1768
1766
|
- spec/presenters/curation_concerns/permission_badge_spec.rb
|
1769
1767
|
- spec/presenters/curation_concerns/presenter_factory_spec.rb
|
1770
1768
|
- spec/presenters/curation_concerns/single_use_link_presenter_spec.rb
|
@@ -1851,9 +1849,7 @@ test_files:
|
|
1851
1849
|
- spec/views/curation_concerns/admin/_total_objects_charts.html.erb_spec.rb
|
1852
1850
|
- spec/views/curation_concerns/admin/index.html.erb_spec.rb
|
1853
1851
|
- spec/views/curation_concerns/admin/widgets/_pie.html.erb_spec.rb
|
1854
|
-
- spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb
|
1855
1852
|
- spec/views/curation_concerns/base/_attributes.html.erb_spec.rb
|
1856
|
-
- spec/views/curation_concerns/base/_form.html.erb_spec.rb
|
1857
1853
|
- spec/views/curation_concerns/base/_form_rights_spec.rb
|
1858
1854
|
- spec/views/curation_concerns/base/_member.html.erb_spec.rb
|
1859
1855
|
- spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module CurationConcerns
|
2
|
-
module Actors
|
3
|
-
class AddToCollectionActor < AbstractActor
|
4
|
-
def create(attributes)
|
5
|
-
collection_ids = attributes.delete(:collection_ids)
|
6
|
-
next_actor.create(attributes) && add_to_collections(collection_ids)
|
7
|
-
end
|
8
|
-
|
9
|
-
def update(attributes)
|
10
|
-
collection_ids = attributes.delete(:collection_ids)
|
11
|
-
add_to_collections(collection_ids) && next_actor.update(attributes)
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
# The default behavior of active_fedora's aggregates association,
|
17
|
-
# when assigning the id accessor (e.g. collection_ids = ['foo:1']) is to add
|
18
|
-
# to new collections, but not remove from old collections.
|
19
|
-
# This method ensures it's removed from the old collections.
|
20
|
-
def add_to_collections(new_collection_ids)
|
21
|
-
return true unless new_collection_ids
|
22
|
-
# remove from old collections
|
23
|
-
(curation_concern.in_collection_ids - new_collection_ids).each do |old_id|
|
24
|
-
collection = ::Collection.find(old_id)
|
25
|
-
# don't remove from collections current user doesn't have edit permissions for
|
26
|
-
if collection.edit_users.include? user.email
|
27
|
-
collection.members.delete(curation_concern)
|
28
|
-
collection.save
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# add to new
|
33
|
-
new_collection_ids.each do |coll_id|
|
34
|
-
collection = ::Collection.find(coll_id)
|
35
|
-
collection.members << curation_concern
|
36
|
-
collection.save
|
37
|
-
end
|
38
|
-
true
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module CurationConcerns
|
2
|
-
# Validates that the submitted version is the most recent version in the datastore.
|
3
|
-
# Caveat: we are not detecting if the version is changed by a different process between
|
4
|
-
# the time this validator is run and when the object is saved
|
5
|
-
class OptimisticLockValidator < Actors::AbstractActor
|
6
|
-
class_attribute :version_field
|
7
|
-
self.version_field = 'version'
|
8
|
-
|
9
|
-
def update(attributes)
|
10
|
-
validate_lock(version_attribute(attributes)) && next_actor.update(attributes)
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
# @return [Boolean] returns true if the lock is missing or
|
16
|
-
# if it matches the current object version.
|
17
|
-
def validate_lock(version)
|
18
|
-
return true if version.blank? || version == curation_concern.etag
|
19
|
-
curation_concern.errors.add(:base, :conflict)
|
20
|
-
false
|
21
|
-
end
|
22
|
-
|
23
|
-
# Removes the version attribute
|
24
|
-
def version_attribute(attributes)
|
25
|
-
attributes.delete(version_field)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module CurationConcerns
|
2
|
-
module Forms
|
3
|
-
class FileManagerForm
|
4
|
-
include HydraEditor::Form
|
5
|
-
self.terms = []
|
6
|
-
delegate :id, :thumbnail_id, :representative_id, :to_s, to: :model
|
7
|
-
attr_reader :current_ability, :request
|
8
|
-
def initialize(work, ability)
|
9
|
-
super(work)
|
10
|
-
@current_ability = ability
|
11
|
-
@request = nil
|
12
|
-
end
|
13
|
-
|
14
|
-
def version
|
15
|
-
model.etag
|
16
|
-
end
|
17
|
-
|
18
|
-
delegate :member_presenters, to: :member_presenter_factory
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def member_presenter_factory
|
23
|
-
MemberPresenterFactory.new(model, current_ability)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|