curation_concerns 0.10.0 → 0.11.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -3
  3. data/CONTRIBUTING.md +111 -0
  4. data/Gemfile +1 -1
  5. data/README.md +16 -0
  6. data/VERSION +1 -1
  7. data/app/assets/javascripts/curation_concerns/file_manager/save_manager.es6 +1 -1
  8. data/app/assets/stylesheets/curation_concerns/_positioning.scss +0 -4
  9. data/app/controllers/concerns/curation_concerns/catalog_controller.rb +1 -4
  10. data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +4 -8
  11. data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +15 -11
  12. data/app/controllers/concerns/curation_concerns/file_sets_controller_behavior.rb +5 -13
  13. data/app/controllers/curation_concerns/permissions_controller.rb +3 -3
  14. data/app/forms/curation_concerns/forms/collection_edit_form.rb +1 -1
  15. data/app/forms/curation_concerns/forms/work_form.rb +2 -0
  16. data/app/helpers/curation_concerns/collections_helper.rb +21 -4
  17. data/app/jobs/visibility_copy_job.rb +2 -4
  18. data/app/presenters/curation_concerns/collection_presenter.rb +1 -1
  19. data/app/presenters/curation_concerns/work_show_presenter.rb +27 -4
  20. data/app/search_builders/curation_concerns/filter_by_type.rb +8 -1
  21. data/app/search_builders/curation_concerns/search_builder.rb +7 -14
  22. data/app/search_builders/curation_concerns/search_filters.rb +18 -0
  23. data/app/search_builders/curation_concerns/single_result.rb +1 -1
  24. data/app/search_builders/curation_concerns/single_use_link_search_builder.rb +1 -1
  25. data/app/search_builders/curation_concerns/work_search_builder.rb +1 -1
  26. data/app/views/curation_concerns/base/{_form_descriptive_fields.erb → _form_descriptive_fields.html.erb} +0 -0
  27. data/app/views/curation_concerns/base/_member.html.erb +12 -0
  28. data/app/views/curation_concerns/base/_related_files.html.erb +2 -2
  29. data/curation_concerns.gemspec +2 -1
  30. data/lib/curation_concerns/version.rb +1 -1
  31. data/lib/curation_concerns.rb +1 -0
  32. data/lib/generators/curation_concerns/assets_generator.rb +16 -0
  33. data/lib/generators/curation_concerns/install_generator.rb +7 -14
  34. data/lib/generators/curation_concerns/templates/catalog_controller.rb +4 -4
  35. data/lib/generators/curation_concerns/work/templates/controller.rb.erb +1 -1
  36. data/lib/generators/curation_concerns/work/templates/feature_spec.rb.erb +26 -0
  37. data/lib/generators/curation_concerns/work/work_generator.rb +5 -0
  38. data/spec/actors/curation_concerns/file_actor_spec.rb +1 -1
  39. data/spec/actors/curation_concerns/file_set_actor_spec.rb +4 -3
  40. data/spec/controllers/curation_concerns/file_sets_controller_spec.rb +14 -1
  41. data/spec/controllers/curation_concerns/permissions_controller_spec.rb +1 -1
  42. data/spec/features/add_file_spec.rb +1 -1
  43. data/spec/features/collection_spec.rb +1 -11
  44. data/spec/features/create_work_spec.rb +1 -1
  45. data/spec/features/embargo_spec.rb +1 -1
  46. data/spec/features/lease_spec.rb +1 -1
  47. data/spec/features/update_file_spec.rb +1 -1
  48. data/spec/features/work_generator_spec.rb +1 -1
  49. data/spec/forms/work_form_spec.rb +5 -0
  50. data/spec/helpers/curation_concerns/collections_helper_spec.rb +19 -5
  51. data/spec/indexers/collection_indexer_spec.rb +1 -1
  52. data/spec/javascripts/save_manager_spec.coffee +1 -0
  53. data/spec/jobs/audit_job_spec.rb +3 -7
  54. data/spec/jobs/characterize_job_spec.rb +4 -4
  55. data/spec/jobs/create_derivatives_job_spec.rb +4 -4
  56. data/spec/jobs/import_url_job_spec.rb +6 -6
  57. data/spec/jobs/ingest_file_job_spec.rb +6 -6
  58. data/spec/jobs/visibility_copy_job_spec.rb +3 -3
  59. data/spec/models/file_set_spec.rb +6 -0
  60. data/spec/models/generic_work_spec.rb +6 -0
  61. data/spec/presenters/curation_concerns/work_show_presenter_spec.rb +25 -1
  62. data/spec/search_builders/curation_concerns/file_set_search_builder_spec.rb +2 -2
  63. data/spec/search_builders/curation_concerns/search_builder_spec.rb +16 -3
  64. data/spec/spec_helper.rb +2 -2
  65. data/spec/test_app_templates/Gemfile.extra +0 -1
  66. data/spec/views/curation_concerns/{file_sets/_file_set.html.erb_spec.rb → base/_member.html.erb_spec.rb} +2 -2
  67. data/vendor/assets/{javascrips → javascripts}/fileupload/jquery.fileupload-process.js +0 -0
  68. data/vendor/assets/{javascrips → javascripts}/fileupload/jquery.fileupload-ui.js +0 -0
  69. data/vendor/assets/{javascrips → javascripts}/fileupload/jquery.fileupload-validate.js +0 -0
  70. data/vendor/assets/{javascrips → javascripts}/fileupload/jquery.fileupload.js +0 -0
  71. data/vendor/assets/{javascrips → javascripts}/fileupload/locale.js +0 -0
  72. data/vendor/assets/{javascrips → javascripts}/fileupload/tmpl.js +0 -0
  73. metadata +36 -21
  74. data/app/views/curation_concerns/file_sets/_file_set.html.erb +0 -12
  75. data/lib/curation_concerns/form_builder.rb +0 -16
  76. data/spec/jobs/active_fedora_id_based_job_spec.rb +0 -16
@@ -12,7 +12,7 @@ describe CurationConcerns::FileSetSearchBuilder do
12
12
  before { subject.only_file_sets(solr_params) }
13
13
 
14
14
  it 'adds FileSet to query' do
15
- expect(solr_params[:fq].first).to include('{!raw f=has_model_ssim}FileSet')
15
+ expect(solr_params[:fq].first).to include('{!field f=has_model_ssim}FileSet')
16
16
  end
17
17
  end
18
18
 
@@ -23,7 +23,7 @@ describe CurationConcerns::FileSetSearchBuilder do
23
23
  end
24
24
 
25
25
  it 'adds id to query' do
26
- expect(solr_params[:fq].first).to include('{!raw f=id}12345')
26
+ expect(solr_params[:fq].first).to include('{!field f=id}12345')
27
27
  end
28
28
  end
29
29
  end
@@ -32,10 +32,23 @@ describe CurationConcerns::SearchBuilder do
32
32
  end
33
33
 
34
34
  describe '#filter_models' do
35
- before { subject.filter_models(solr_params) }
35
+ context "with default work types" do
36
+ before { subject.filter_models(solr_params) }
36
37
 
37
- it 'limits query to collection and generic work' do
38
- expect(solr_params[:fq].first).to match(/{!raw f=has_model_ssim}GenericWork.*OR.*{!raw f=has_model_ssim}Collection/)
38
+ it 'limits query to collection and generic work' do
39
+ expect(solr_params[:fq].first).to match(/{!field f=has_model_ssim}GenericWork.*OR.*{!field f=has_model_ssim}Collection/)
40
+ end
41
+ end
42
+
43
+ context 'when work_types is overridden' do
44
+ before do
45
+ allow(subject).to receive(:work_types).and_return([FileSet])
46
+ subject.filter_models(solr_params)
47
+ end
48
+
49
+ it "doesn't have GenericWork" do
50
+ expect(solr_params[:fq].first).not_to match(/{!field f=has_model_ssim}GenericWork/)
51
+ end
39
52
  end
40
53
  end
41
54
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- if ENV['CI']
1
+ if ENV['CI'] || ENV['COVERAGE']
2
2
  require 'coveralls'
3
3
  Coveralls.wear!
4
4
  end
@@ -29,7 +29,7 @@ if ENV['COVERAGE'] || $in_travis
29
29
  require 'simplecov'
30
30
 
31
31
  SimpleCov.root(File.expand_path('../..', __FILE__))
32
- SimpleCov.formatter = Coveralls::SimpleCov::Formatter
32
+ SimpleCov.formatters = $in_travis ? Coveralls::SimpleCov::Formatter : SimpleCov::Formatter::HTMLFormatter
33
33
  SimpleCov.start('rails') do
34
34
  add_filter '/spec'
35
35
  add_filter '/lib/generators/curation_concerns/templates'
@@ -1,5 +1,4 @@
1
1
  # placeholder to use for pinning against specific gem commit references
2
- gem 'kaminari', github: 'jcoyne/kaminari', branch: 'sufia'
3
2
 
4
3
  group :development do
5
4
  gem 'better_errors'
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'curation_concerns/file_sets/_file_set.html.erb' do
3
+ describe 'curation_concerns/base/_member.html.erb' do
4
4
  let(:solr_document) { SolrDocument.new(id: '999',
5
5
  has_model_ssim: ['FileSet'],
6
6
  active_fedora_model_ssi: 'FileSet',
@@ -25,7 +25,7 @@ describe 'curation_concerns/file_sets/_file_set.html.erb' do
25
25
  allow(view).to receive(:can?).with(:read, kind_of(String)).and_return(true)
26
26
  allow(view).to receive(:can?).with(:edit, kind_of(String)).and_return(true)
27
27
  allow(view).to receive(:can?).with(:destroy, String).and_return(true)
28
- render 'curation_concerns/file_sets/file_set.html.erb', file_set: presenter
28
+ render 'curation_concerns/base/member.html.erb', member: presenter
29
29
  end
30
30
 
31
31
  it 'renders the view' do
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: 0.10.0
4
+ version: 0.11.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: 2016-03-04 00:00:00.000000000 Z
13
+ date: 2016-03-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hydra-head
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '9.6'
21
+ version: '9.9'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '9.6'
28
+ version: '9.9'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: blacklight
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -88,14 +88,14 @@ dependencies:
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.10.0
91
+ version: 0.11.0.rc1
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.10.0
98
+ version: 0.11.0.rc1
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: hydra-editor
101
101
  requirement: !ruby/object:Gem::Requirement
@@ -152,6 +152,20 @@ dependencies:
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
+ - !ruby/object:Gem::Dependency
156
+ name: kaminari_route_prefix
157
+ requirement: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
160
+ - !ruby/object:Gem::Version
161
+ version: 0.0.1
162
+ type: :runtime
163
+ prerelease: false
164
+ version_requirements: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - "~>"
167
+ - !ruby/object:Gem::Version
168
+ version: 0.0.1
155
169
  - !ruby/object:Gem::Dependency
156
170
  name: solr_wrapper
157
171
  requirement: !ruby/object:Gem::Requirement
@@ -405,6 +419,7 @@ files:
405
419
  - ".rspec"
406
420
  - ".rubocop.yml"
407
421
  - ".travis.yml"
422
+ - CONTRIBUTING.md
408
423
  - Gemfile
409
424
  - LICENSE.txt
410
425
  - README.md
@@ -526,6 +541,7 @@ files:
526
541
  - app/search_builders/curation_concerns/filter_by_type.rb
527
542
  - app/search_builders/curation_concerns/lease_search_builder.rb
528
543
  - app/search_builders/curation_concerns/search_builder.rb
544
+ - app/search_builders/curation_concerns/search_filters.rb
529
545
  - app/search_builders/curation_concerns/single_result.rb
530
546
  - app/search_builders/curation_concerns/single_use_link_search_builder.rb
531
547
  - app/search_builders/curation_concerns/work_search_builder.rb
@@ -583,7 +599,7 @@ files:
583
599
  - app/views/curation_concerns/base/_file_manager_thumbnail.html.erb
584
600
  - app/views/curation_concerns/base/_form.html.erb
585
601
  - app/views/curation_concerns/base/_form_additional_information.html.erb
586
- - app/views/curation_concerns/base/_form_descriptive_fields.erb
602
+ - app/views/curation_concerns/base/_form_descriptive_fields.html.erb
587
603
  - app/views/curation_concerns/base/_form_files_and_links.html.erb
588
604
  - app/views/curation_concerns/base/_form_media.html.erb
589
605
  - app/views/curation_concerns/base/_form_permission.html.erb
@@ -598,6 +614,7 @@ files:
598
614
  - app/views/curation_concerns/base/_form_supplementary_fields.html.erb
599
615
  - app/views/curation_concerns/base/_form_thumbnail.html.erb
600
616
  - app/views/curation_concerns/base/_legally_binding_text.html.erb
617
+ - app/views/curation_concerns/base/_member.html.erb
601
618
  - app/views/curation_concerns/base/_multiple_upload.html.erb
602
619
  - app/views/curation_concerns/base/_related_files.html.erb
603
620
  - app/views/curation_concerns/base/_representative_media.html.erb
@@ -614,7 +631,6 @@ files:
614
631
  - app/views/curation_concerns/classify_concerns/new.html.erb
615
632
  - app/views/curation_concerns/collections/_form_additional_information.html.erb
616
633
  - app/views/curation_concerns/file_sets/_actions.html.erb
617
- - app/views/curation_concerns/file_sets/_file_set.html.erb
618
634
  - app/views/curation_concerns/file_sets/_form.html.erb
619
635
  - app/views/curation_concerns/file_sets/_rights_modal.html.erb
620
636
  - app/views/curation_concerns/file_sets/_show_actions.html.erb
@@ -678,11 +694,11 @@ files:
678
694
  - lib/curation_concerns/callbacks/registry.rb
679
695
  - lib/curation_concerns/controller_resource.rb
680
696
  - lib/curation_concerns/engine.rb
681
- - lib/curation_concerns/form_builder.rb
682
697
  - lib/curation_concerns/rails/routes.rb
683
698
  - lib/curation_concerns/single_use_error.rb
684
699
  - lib/curation_concerns/spec_support.rb
685
700
  - lib/curation_concerns/version.rb
701
+ - lib/generators/curation_concerns/assets_generator.rb
686
702
  - lib/generators/curation_concerns/install_generator.rb
687
703
  - lib/generators/curation_concerns/templates/catalog_controller.rb
688
704
  - lib/generators/curation_concerns/templates/config/authorities/resource_types.yml
@@ -696,6 +712,7 @@ files:
696
712
  - lib/generators/curation_concerns/work/templates/actor_spec.rb.erb
697
713
  - lib/generators/curation_concerns/work/templates/controller.rb.erb
698
714
  - lib/generators/curation_concerns/work/templates/controller_spec.rb.erb
715
+ - lib/generators/curation_concerns/work/templates/feature_spec.rb.erb
699
716
  - lib/generators/curation_concerns/work/templates/form.rb.erb
700
717
  - lib/generators/curation_concerns/work/templates/form_spec.rb.erb
701
718
  - lib/generators/curation_concerns/work/templates/model.rb.erb
@@ -784,7 +801,6 @@ files:
784
801
  - spec/javascripts/save_manager_spec.coffee
785
802
  - spec/javascripts/support/jasmine.yml
786
803
  - spec/javascripts/support/jasmine_helper.rb
787
- - spec/jobs/active_fedora_id_based_job_spec.rb
788
804
  - spec/jobs/audit_job_spec.rb
789
805
  - spec/jobs/characterize_job_spec.rb
790
806
  - spec/jobs/create_derivatives_job_spec.rb
@@ -861,11 +877,11 @@ files:
861
877
  - spec/views/collections/_sort_and_per_page.html.erb_spec.rb
862
878
  - spec/views/curation_concerns/base/_attributes.html.erb_spec.rb
863
879
  - spec/views/curation_concerns/base/_form_permission.html.erb_spec.rb
880
+ - spec/views/curation_concerns/base/_member.html.erb_spec.rb
864
881
  - spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
865
882
  - spec/views/curation_concerns/base/file_manager.html.erb_spec.rb
866
883
  - spec/views/curation_concerns/base/show.html.erb_spec.rb
867
884
  - spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
868
- - spec/views/curation_concerns/file_sets/_file_set.html.erb_spec.rb
869
885
  - spec/views/curation_concerns/file_sets/show.html.erb_spec.rb
870
886
  - spec/views/curation_concerns/file_sets/show.json.jbuilder_spec.rb
871
887
  - spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb
@@ -880,12 +896,12 @@ files:
880
896
  - tasks/release.rake
881
897
  - vendor/assets/images/ui-bg_glass_100_fdf5ce_1x400.png
882
898
  - vendor/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
883
- - vendor/assets/javascrips/fileupload/jquery.fileupload-process.js
884
- - vendor/assets/javascrips/fileupload/jquery.fileupload-ui.js
885
- - vendor/assets/javascrips/fileupload/jquery.fileupload-validate.js
886
- - vendor/assets/javascrips/fileupload/jquery.fileupload.js
887
- - vendor/assets/javascrips/fileupload/locale.js
888
- - vendor/assets/javascrips/fileupload/tmpl.js
899
+ - vendor/assets/javascripts/fileupload/jquery.fileupload-process.js
900
+ - vendor/assets/javascripts/fileupload/jquery.fileupload-ui.js
901
+ - vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js
902
+ - vendor/assets/javascripts/fileupload/jquery.fileupload.js
903
+ - vendor/assets/javascripts/fileupload/locale.js
904
+ - vendor/assets/javascripts/fileupload/tmpl.js
889
905
  homepage: ''
890
906
  licenses:
891
907
  - APACHE2
@@ -901,9 +917,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
901
917
  version: '0'
902
918
  required_rubygems_version: !ruby/object:Gem::Requirement
903
919
  requirements:
904
- - - ">="
920
+ - - ">"
905
921
  - !ruby/object:Gem::Version
906
- version: '0'
922
+ version: 1.3.1
907
923
  requirements: []
908
924
  rubyforge_project:
909
925
  rubygems_version: 2.5.1
@@ -978,7 +994,6 @@ test_files:
978
994
  - spec/javascripts/save_manager_spec.coffee
979
995
  - spec/javascripts/support/jasmine.yml
980
996
  - spec/javascripts/support/jasmine_helper.rb
981
- - spec/jobs/active_fedora_id_based_job_spec.rb
982
997
  - spec/jobs/audit_job_spec.rb
983
998
  - spec/jobs/characterize_job_spec.rb
984
999
  - spec/jobs/create_derivatives_job_spec.rb
@@ -1055,11 +1070,11 @@ test_files:
1055
1070
  - spec/views/collections/_sort_and_per_page.html.erb_spec.rb
1056
1071
  - spec/views/curation_concerns/base/_attributes.html.erb_spec.rb
1057
1072
  - spec/views/curation_concerns/base/_form_permission.html.erb_spec.rb
1073
+ - spec/views/curation_concerns/base/_member.html.erb_spec.rb
1058
1074
  - spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
1059
1075
  - spec/views/curation_concerns/base/file_manager.html.erb_spec.rb
1060
1076
  - spec/views/curation_concerns/base/show.html.erb_spec.rb
1061
1077
  - spec/views/curation_concerns/base/show.json.jbuilder_spec.rb
1062
- - spec/views/curation_concerns/file_sets/_file_set.html.erb_spec.rb
1063
1078
  - spec/views/curation_concerns/file_sets/show.html.erb_spec.rb
1064
1079
  - spec/views/curation_concerns/file_sets/show.json.jbuilder_spec.rb
1065
1080
  - spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb
@@ -1,12 +0,0 @@
1
- <tr class="<%= dom_class(file_set) %> attributes">
2
- <td class="thumbnail">
3
- <%= render_thumbnail_tag file_set %>
4
- </td>
5
- <td class="attribute filename"><%= link_to(file_set.link_name, main_app.curation_concerns_file_set_path(file_set)) %></td>
6
- <td class="attribute date_uploaded"><%= file_set.date_uploaded %></td>
7
- <td class="attribute permission"><%= file_set.permission_badge %></td>
8
- <td>
9
- <%= render 'curation_concerns/file_sets/actions', file_set: file_set %>
10
- </td>
11
- </tr>
12
-
@@ -1,16 +0,0 @@
1
- module CurationConcerns
2
- class FormBuilder < SimpleForm::FormBuilder
3
- def input_label(attribute_name, options = {})
4
- options = options.dup
5
- options[:input_html] = options.except(:as, :boolean_style, :collection, :label_method, :value_method, *ATTRIBUTE_COMPONENTS)
6
- options = @defaults.deep_dup.deep_merge(options) if @defaults
7
-
8
- input = find_input(attribute_name, options)
9
- wrapper = find_wrapper(input.input_type, options)
10
- components = (wrapper.components.map(&:namespace) & ATTRIBUTE_COMPONENTS) + [:input]
11
- components.map { |component| SimpleForm::Wrappers::Leaf.new(component) }
12
-
13
- input.label.html_safe
14
- end
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ActiveFedoraIdBasedJob do
4
- let(:file_set) { FileSet.new }
5
- let(:file_set_id) { 'abc123' }
6
-
7
- before do
8
- allow(ActiveFedora::Base).to receive(:find).with(file_set_id).and_return(file_set)
9
- end
10
-
11
- it 'finds object' do
12
- job = described_class.new
13
- job.id = file_set_id
14
- expect(job.file_set).to eq file_set
15
- end
16
- end