commonwealth-vlr-engine 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/advanced_search.scss +1 -1
- data/app/assets/stylesheets/commonwealth-vlr-engine/basic_search.scss +6 -1
- data/app/assets/stylesheets/commonwealth-vlr-engine/commonwealth-vlr-engine.css +1 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/folders.scss +1 -1
- data/app/assets/stylesheets/commonwealth-vlr-engine/header.scss +9 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/home.scss +9 -0
- data/app/assets/stylesheets/commonwealth-vlr-engine/twitter_typeahead.scss +9 -0
- data/app/controllers/blacklight_advanced_search/advanced_controller.rb +12 -48
- data/app/controllers/bookmarks_controller.rb +8 -8
- data/app/controllers/collections_controller.rb +10 -26
- data/app/controllers/folder_items_actions_controller.rb +2 -2
- data/app/controllers/folders_controller.rb +10 -6
- data/app/controllers/image_viewer_controller.rb +2 -2
- data/app/controllers/institutions_controller.rb +13 -12
- data/app/controllers/ocr_search_controller.rb +2 -8
- data/app/controllers/saved_searches_controller.rb +8 -0
- data/app/controllers/search_history_controller.rb +8 -0
- data/app/helpers/commonwealth_vlr_engine/application_helper.rb +37 -37
- data/app/helpers/commonwealth_vlr_engine/blacklight_helper.rb +3 -11
- data/app/helpers/commonwealth_vlr_engine/blacklight_url_helper.rb +1 -16
- data/app/helpers/commonwealth_vlr_engine/catalog_helper.rb +1 -1
- data/app/helpers/commonwealth_vlr_engine/collections_helper_behavior.rb +1 -1
- data/app/helpers/commonwealth_vlr_engine/institutions_helper_behavior.rb +2 -2
- data/app/helpers/commonwealth_vlr_engine/vlr_blacklight_maps_helper_behavior.rb +10 -6
- data/app/views/advanced/_advanced_search_fields.html.erb +2 -2
- data/app/views/advanced/_advanced_search_form.html.erb +2 -2
- data/app/views/advanced/index.html.erb +1 -1
- data/app/views/bookmarks/index.html.erb +1 -1
- data/app/views/catalog/_basic_search.html.erb +5 -3
- data/app/views/catalog/_constraints.html.erb +1 -1
- data/app/views/catalog/_facet_limit_series.html.erb +7 -5
- data/app/views/catalog/_index_gallery.html.erb +1 -3
- data/app/views/catalog/{_index_map_institutions.html.erb → _index_mapview_institutions.html.erb} +0 -0
- data/app/views/catalog/_search_form.html.erb +14 -4
- data/app/views/catalog/_show_partials/_show_default_metadata.html.erb +9 -0
- data/app/views/catalog/_show_partials/_show_flagged_notice.html.erb +1 -1
- data/app/views/catalog/_show_tools.html.erb +2 -2
- data/app/views/catalog/_zero_results.html.erb +1 -1
- data/app/views/collections/_search_form_collection.html.erb +1 -1
- data/app/views/collections/show.html.erb +1 -1
- data/app/views/feedback/complete.html.erb +1 -1
- data/app/views/institutions/_search_form_institution.html.erb +1 -1
- data/app/views/layouts/commonwealth-vlr-engine.html.erb +2 -2
- data/app/views/ocr_search/_search_form_ocr.html.erb +1 -1
- data/app/views/pages/home.html.erb +2 -1
- data/app/views/saved_searches/index.html.erb +4 -4
- data/app/views/search_history/index.html.erb +5 -5
- data/app/views/shared/_folder_item_actions.html.erb +1 -2
- data/app/views/shared/_footer.html.erb +1 -1
- data/app/views/shared/_header_navbar.html.erb +1 -1
- data/app/views/shared/_nav_links.html.erb +2 -2
- data/app/views/shared/_search_form_header.html.erb +9 -3
- data/app/views/shared/_sitelinks_search_box.html.erb +12 -0
- data/app/views/shared/_tools.html.erb +2 -2
- data/app/views/shared/_user_util_links.html.erb +2 -2
- data/app/views/users/show.html.erb +2 -2
- data/commonwealth-vlr-engine.gemspec +4 -4
- data/config/initializers/assets.rb +2 -0
- data/config/locales/commonwealth-vlr-engine.en.yml +4 -0
- data/config/routes.rb +1 -0
- data/lib/commonwealth-vlr-engine.rb +6 -16
- data/lib/commonwealth-vlr-engine/controller_override.rb +82 -47
- data/lib/commonwealth-vlr-engine/engine.rb +6 -4
- data/lib/commonwealth-vlr-engine/render_constraints_override.rb +3 -2
- data/lib/commonwealth-vlr-engine/search_builder/collections_search_builder.rb +14 -0
- data/lib/commonwealth-vlr-engine/{commonwealth_search_builder.rb → search_builder/commonwealth_search_builder_behavior.rb} +9 -2
- data/lib/commonwealth-vlr-engine/search_builder/flagged_search_builder.rb +14 -0
- data/lib/commonwealth-vlr-engine/search_builder/institutions_search_builder.rb +11 -0
- data/lib/commonwealth-vlr-engine/search_builder/mlt_search_builder.rb +15 -0
- data/lib/commonwealth-vlr-engine/search_builder/ocr_search_builder.rb +10 -0
- data/lib/commonwealth-vlr-engine/version.rb +1 -1
- data/lib/generators/commonwealth_vlr_engine/controller_generator.rb +1 -2
- data/lib/generators/commonwealth_vlr_engine/localassets_generator.rb +1 -1
- data/lib/generators/commonwealth_vlr_engine/model_generator.rb +3 -16
- data/lib/generators/commonwealth_vlr_engine/routes_generator.rb +8 -0
- data/lib/generators/commonwealth_vlr_engine/templates/commonwealth_search_builder.rb +17 -0
- data/lib/generators/commonwealth_vlr_engine/templates/{commonwealth_vlr_engine.css.scss → commonwealth_vlr_engine.scss} +0 -0
- data/spec/controllers/catalog_controller_spec.rb +20 -3
- data/spec/controllers/collections_controller_spec.rb +2 -2
- data/spec/controllers/folder_items_actions_controller_spec.rb +2 -2
- data/spec/controllers/institutions_controller_spec.rb +13 -0
- data/spec/controllers/ocr_search_controller_spec.rb +4 -0
- data/spec/features/more_like_this_search_spec.rb +1 -1
- data/spec/features/ocr_search/index_spec.rb +1 -1
- data/spec/helpers/institutions_helper_spec.rb +10 -5
- data/spec/lib/commonwealth-vlr-engine/search_builder/collections_search_builder_spec.rb +19 -0
- data/spec/lib/commonwealth-vlr-engine/search_builder/commonwealth_search_builder_behavior_spec.rb +116 -0
- data/spec/lib/commonwealth-vlr-engine/search_builder/flagged_search_builder_spec.rb +19 -0
- data/spec/lib/commonwealth-vlr-engine/search_builder/institutions_search_builder_spec.rb +19 -0
- data/spec/lib/commonwealth-vlr-engine/search_builder/mlt_search_builder_spec.rb +19 -0
- data/spec/lib/commonwealth-vlr-engine/search_builder/ocr_search_builder_spec.rb +19 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -0
- data/tasks/vlr_engine.rake +1 -1
- metadata +38 -23
- data/app/views/bookmarks/_tools.html.erb +0 -25
- data/app/views/catalog/_index_list_default.html.erb +0 -13
- data/lib/commonwealth-vlr-engine/route_sets.rb +0 -49
- data/lib/commonwealth-vlr-engine/routes.rb +0 -21
- data/spec/lib/commonwealth-vlr-engine/commonwealth_search_builder_spec.rb +0 -101
- data/spec/lib/commonwealth-vlr-engine/controller_override_spec.rb +0 -41
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CommonwealthFlaggedSearchBuilder do
|
4
|
+
|
5
|
+
class CommonwealthFlaggedSearchBuilderTestClass < CommonwealthFlaggedSearchBuilder
|
6
|
+
end
|
7
|
+
|
8
|
+
before { @obj = CommonwealthFlaggedSearchBuilderTestClass.new(CatalogController.new) }
|
9
|
+
|
10
|
+
describe 'processor chain' do
|
11
|
+
|
12
|
+
it 'should add the right methods to the processor chain' do
|
13
|
+
expect(@obj.processor_chain).to include(:flagged_filter)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CommonwealthInstitutionsSearchBuilder do
|
4
|
+
|
5
|
+
class CommonwealthInstitutionsSearchBuilderTestClass < CommonwealthInstitutionsSearchBuilder
|
6
|
+
end
|
7
|
+
|
8
|
+
before { @obj = CommonwealthInstitutionsSearchBuilderTestClass.new(CatalogController.new) }
|
9
|
+
|
10
|
+
describe 'processor chain' do
|
11
|
+
|
12
|
+
it 'should add the right methods to the processor chain' do
|
13
|
+
expect(@obj.processor_chain).to include(:institutions_filter)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CommonwealthMltSearchBuilder do
|
4
|
+
|
5
|
+
class CommonwealthMltSearchBuilderTestClass < CommonwealthMltSearchBuilder
|
6
|
+
end
|
7
|
+
|
8
|
+
before { @obj = CommonwealthMltSearchBuilderTestClass.new(CatalogController.new) }
|
9
|
+
|
10
|
+
describe 'processor chain' do
|
11
|
+
|
12
|
+
it 'should add the right methods to the processor chain' do
|
13
|
+
expect(@obj.processor_chain).to include(:set_solr_id_for_mlt)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CommonwealthOcrSearchBuilder do
|
4
|
+
|
5
|
+
class CommonwealthOcrSearchBuilderTestClass < CommonwealthOcrSearchBuilder
|
6
|
+
end
|
7
|
+
|
8
|
+
before { @obj = CommonwealthOcrSearchBuilderTestClass.new(CatalogController.new) }
|
9
|
+
|
10
|
+
describe 'processor chain' do
|
11
|
+
|
12
|
+
it 'should add the right methods to the processor chain' do
|
13
|
+
expect(@obj.processor_chain).to include(:ocr_search_params)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
end
|
data/tasks/vlr_engine.rake
CHANGED
@@ -18,7 +18,7 @@ namespace :vlr_engine do
|
|
18
18
|
@controller = BlacklightGeojsonTestClass.new
|
19
19
|
@controller.request = ActionDispatch::TestRequest.new
|
20
20
|
|
21
|
-
(@response, @document_list) = @controller.search_results({}
|
21
|
+
(@response, @document_list) = @controller.search_results({})
|
22
22
|
|
23
23
|
geojson_features = serialize_geojson(map_facet_values, 'index')
|
24
24
|
if geojson_features
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonwealth-vlr-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eben English
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -29,58 +29,58 @@ dependencies:
|
|
29
29
|
name: blacklight
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 6.1.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 6.1.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: blacklight_advanced_search
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 6.0.2
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 6.0.2
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: blacklight-gallery
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.
|
62
|
+
version: 0.5.0
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.5.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: blacklight-maps
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.
|
76
|
+
version: 0.5.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.
|
83
|
+
version: 0.5.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: bootstrap-sass
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -450,6 +450,7 @@ files:
|
|
450
450
|
- app/assets/stylesheets/commonwealth-vlr-engine/searches.scss
|
451
451
|
- app/assets/stylesheets/commonwealth-vlr-engine/show.scss
|
452
452
|
- app/assets/stylesheets/commonwealth-vlr-engine/signin.scss
|
453
|
+
- app/assets/stylesheets/commonwealth-vlr-engine/twitter_typeahead.scss
|
453
454
|
- app/assets/stylesheets/commonwealth-vlr-engine/users.scss
|
454
455
|
- app/assets/stylesheets/commonwealth-vlr-engine/vlr_dependencies.css
|
455
456
|
- app/assets/stylesheets/ie_fixes.css
|
@@ -468,6 +469,8 @@ files:
|
|
468
469
|
- app/controllers/institutions_controller.rb
|
469
470
|
- app/controllers/ocr_search_controller.rb
|
470
471
|
- app/controllers/pages_controller.rb
|
472
|
+
- app/controllers/saved_searches_controller.rb
|
473
|
+
- app/controllers/search_history_controller.rb
|
471
474
|
- app/controllers/users/omniauth_callbacks_controller.rb
|
472
475
|
- app/controllers/users/registrations_controller.rb
|
473
476
|
- app/controllers/users/sessions_controller.rb
|
@@ -508,7 +511,6 @@ files:
|
|
508
511
|
- app/views/advanced/_facet_limit.html.erb
|
509
512
|
- app/views/advanced/index.html.erb
|
510
513
|
- app/views/blacklight_advanced_search/_facet_limit.html.erb
|
511
|
-
- app/views/bookmarks/_tools.html.erb
|
512
514
|
- app/views/bookmarks/index.html.erb
|
513
515
|
- app/views/bookmarks/update.js.erb
|
514
516
|
- app/views/bpluser/folders/_folder.html.erb
|
@@ -526,8 +528,7 @@ files:
|
|
526
528
|
- app/views/catalog/_index_gallery.html.erb
|
527
529
|
- app/views/catalog/_index_header_default.html.erb
|
528
530
|
- app/views/catalog/_index_list_collection.html.erb
|
529
|
-
- app/views/catalog/
|
530
|
-
- app/views/catalog/_index_map_institutions.html.erb
|
531
|
+
- app/views/catalog/_index_mapview_institutions.html.erb
|
531
532
|
- app/views/catalog/_index_masonry.html.erb
|
532
533
|
- app/views/catalog/_index_slideshow.html.erb
|
533
534
|
- app/views/catalog/_more_like_this.html.erb
|
@@ -620,17 +621,18 @@ files:
|
|
620
621
|
- app/views/shared/_header_navbar.html.erb
|
621
622
|
- app/views/shared/_nav_links.html.erb
|
622
623
|
- app/views/shared/_search_form_header.html.erb
|
624
|
+
- app/views/shared/_sitelinks_search_box.html.erb
|
623
625
|
- app/views/shared/_tools.html.erb
|
624
626
|
- app/views/shared/_user_util_links.html.erb
|
625
627
|
- app/views/users/show.html.erb
|
626
628
|
- commonwealth-vlr-engine.gemspec
|
629
|
+
- config/initializers/assets.rb
|
627
630
|
- config/initializers/patch_blacklight_advanced_search.rb
|
628
631
|
- config/initializers/patch_blacklight_maps.rb
|
629
632
|
- config/jetty.yml
|
630
633
|
- config/locales/commonwealth-vlr-engine.en.yml
|
631
634
|
- config/routes.rb
|
632
635
|
- lib/commonwealth-vlr-engine.rb
|
633
|
-
- lib/commonwealth-vlr-engine/commonwealth_search_builder.rb
|
634
636
|
- lib/commonwealth-vlr-engine/controller.rb
|
635
637
|
- lib/commonwealth-vlr-engine/controller_override.rb
|
636
638
|
- lib/commonwealth-vlr-engine/engine.rb
|
@@ -639,8 +641,12 @@ files:
|
|
639
641
|
- lib/commonwealth-vlr-engine/notifier.rb
|
640
642
|
- lib/commonwealth-vlr-engine/pages.rb
|
641
643
|
- lib/commonwealth-vlr-engine/render_constraints_override.rb
|
642
|
-
- lib/commonwealth-vlr-engine/
|
643
|
-
- lib/commonwealth-vlr-engine/
|
644
|
+
- lib/commonwealth-vlr-engine/search_builder/collections_search_builder.rb
|
645
|
+
- lib/commonwealth-vlr-engine/search_builder/commonwealth_search_builder_behavior.rb
|
646
|
+
- lib/commonwealth-vlr-engine/search_builder/flagged_search_builder.rb
|
647
|
+
- lib/commonwealth-vlr-engine/search_builder/institutions_search_builder.rb
|
648
|
+
- lib/commonwealth-vlr-engine/search_builder/mlt_search_builder.rb
|
649
|
+
- lib/commonwealth-vlr-engine/search_builder/ocr_search_builder.rb
|
644
650
|
- lib/commonwealth-vlr-engine/version.rb
|
645
651
|
- lib/generators/commonwealth_vlr_engine/controller_generator.rb
|
646
652
|
- lib/generators/commonwealth_vlr_engine/environment_generator.rb
|
@@ -648,7 +654,8 @@ files:
|
|
648
654
|
- lib/generators/commonwealth_vlr_engine/localassets_generator.rb
|
649
655
|
- lib/generators/commonwealth_vlr_engine/model_generator.rb
|
650
656
|
- lib/generators/commonwealth_vlr_engine/routes_generator.rb
|
651
|
-
- lib/generators/commonwealth_vlr_engine/templates/
|
657
|
+
- lib/generators/commonwealth_vlr_engine/templates/commonwealth_search_builder.rb
|
658
|
+
- lib/generators/commonwealth_vlr_engine/templates/commonwealth_vlr_engine.scss
|
652
659
|
- lib/generators/commonwealth_vlr_engine/templates/config/contact_emails.yml.sample
|
653
660
|
- lib/generators/commonwealth_vlr_engine/templates/config/fedora.yml.sample
|
654
661
|
- lib/generators/commonwealth_vlr_engine/templates/config/geojson_static_file.yml.sample
|
@@ -702,12 +709,16 @@ files:
|
|
702
709
|
- spec/helpers/institutions_helper_spec.rb
|
703
710
|
- spec/helpers/ocr_search_helper_spec.rb
|
704
711
|
- spec/helpers/pages_helper_spec.rb
|
705
|
-
- spec/lib/commonwealth-vlr-engine/commonwealth_search_builder_spec.rb
|
706
|
-
- spec/lib/commonwealth-vlr-engine/controller_override_spec.rb
|
707
712
|
- spec/lib/commonwealth-vlr-engine/controller_spec.rb
|
708
713
|
- spec/lib/commonwealth-vlr-engine/finder_spec.rb
|
709
714
|
- spec/lib/commonwealth-vlr-engine/iiif_manifest_spec.rb
|
710
715
|
- spec/lib/commonwealth-vlr-engine/render_constraints_override_spec.rb
|
716
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/collections_search_builder_spec.rb
|
717
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/commonwealth_search_builder_behavior_spec.rb
|
718
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/flagged_search_builder_spec.rb
|
719
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/institutions_search_builder_spec.rb
|
720
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/mlt_search_builder_spec.rb
|
721
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/ocr_search_builder_spec.rb
|
711
722
|
- spec/mailers/notifier_spec.rb
|
712
723
|
- spec/models/carousel_slide_spec.rb
|
713
724
|
- spec/spec_helper.rb
|
@@ -775,12 +786,16 @@ test_files:
|
|
775
786
|
- spec/helpers/institutions_helper_spec.rb
|
776
787
|
- spec/helpers/ocr_search_helper_spec.rb
|
777
788
|
- spec/helpers/pages_helper_spec.rb
|
778
|
-
- spec/lib/commonwealth-vlr-engine/commonwealth_search_builder_spec.rb
|
779
|
-
- spec/lib/commonwealth-vlr-engine/controller_override_spec.rb
|
780
789
|
- spec/lib/commonwealth-vlr-engine/controller_spec.rb
|
781
790
|
- spec/lib/commonwealth-vlr-engine/finder_spec.rb
|
782
791
|
- spec/lib/commonwealth-vlr-engine/iiif_manifest_spec.rb
|
783
792
|
- spec/lib/commonwealth-vlr-engine/render_constraints_override_spec.rb
|
793
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/collections_search_builder_spec.rb
|
794
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/commonwealth_search_builder_behavior_spec.rb
|
795
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/flagged_search_builder_spec.rb
|
796
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/institutions_search_builder_spec.rb
|
797
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/mlt_search_builder_spec.rb
|
798
|
+
- spec/lib/commonwealth-vlr-engine/search_builder/ocr_search_builder_spec.rb
|
784
799
|
- spec/mailers/notifier_spec.rb
|
785
800
|
- spec/models/carousel_slide_spec.rb
|
786
801
|
- spec/spec_helper.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<ul class="bookmarkTools nav nav-pills">
|
2
|
-
<li class="cite">
|
3
|
-
<%= link_to t('blacklight.tools.citation'),
|
4
|
-
citation_catalog_path(:sort=>params[:sort],
|
5
|
-
:per_page=>params[:per_page],
|
6
|
-
:id => @response.documents.map {|doc| doc.id}),
|
7
|
-
{:id => 'citeLink', :name => 'citation', :class => 'btn btn-default', :data => {:ajax_modal => 'trigger'}} %>
|
8
|
-
</li>
|
9
|
-
<li class="email">
|
10
|
-
<%= link_to t('blacklight.tools.email'),
|
11
|
-
email_catalog_path(:sort=>params[:sort],
|
12
|
-
:per_page=>params[:per_page],
|
13
|
-
:id => @response.documents.map {|doc| doc.id}),
|
14
|
-
:class => 'lightboxLink btn btn-default',
|
15
|
-
:id => 'emailLink',
|
16
|
-
:data => {:ajax_modal => 'trigger'} %>
|
17
|
-
</li>
|
18
|
-
<li>
|
19
|
-
<%= link_to t('blacklight.bookmarks.clear.action_title'),
|
20
|
-
clear_bookmarks_path,
|
21
|
-
:method => :delete,
|
22
|
-
:data => { :confirm => t('blacklight.bookmarks.clear.action_confirm') },
|
23
|
-
:class => 'btn btn-default' %>
|
24
|
-
</li>
|
25
|
-
</ul>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<%# copy of catalog/index_default %>
|
2
|
-
<%# need this partial or catalog#index will attempt to render blacklight-maps/index_map %>
|
3
|
-
<%# whenever rendering a doc with 'map' as the value of blacklight_config.display_type_field %>
|
4
|
-
<dl class="document-metadata dl-horizontal dl-invert">
|
5
|
-
|
6
|
-
<% index_fields(document).each do |field_name, field| -%>
|
7
|
-
<% if should_render_index_field? document, field %>
|
8
|
-
<dt class="blacklight-<%= field_name.parameterize %>"><%= render_index_field_label document, field: field_name %></dt>
|
9
|
-
<dd class="blacklight-<%= field_name.parameterize %>"><%= render_index_field_value document, field: field_name %></dd>
|
10
|
-
<% end -%>
|
11
|
-
<% end -%>
|
12
|
-
|
13
|
-
</dl>
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# monkey-patching Blacklight::Routes::RouteSets
|
2
|
-
# to use 'search' as path with Blacklight::CatalogController routes
|
3
|
-
# stopgap solution until patch can be submitted
|
4
|
-
# that will allow local app to provide :path option for resources passed as
|
5
|
-
# args to blacklight/lib/blacklight/rails/routes.rb#blacklight_for
|
6
|
-
module CommonwealthVlrEngine
|
7
|
-
module RouteSets
|
8
|
-
|
9
|
-
extend ActiveSupport::Concern
|
10
|
-
included do
|
11
|
-
|
12
|
-
def map_resource(key)
|
13
|
-
add_routes do |options|
|
14
|
-
get "search/facet/:id", :to => "#{key}#facet", :as => "#{key}_facet"
|
15
|
-
get "search", :to => "#{key}#index", :as => "#{key}_index"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def export(primary_resource)
|
20
|
-
add_routes do |options|
|
21
|
-
get "search/opensearch", :to => "#{primary_resource}#opensearch", :as => "opensearch_#{primary_resource}"
|
22
|
-
get "search/citation", :to => "#{primary_resource}#citation", :as => "citation_#{primary_resource}"
|
23
|
-
match 'search/email', :to => "#{primary_resource}#email", :as => "email_#{primary_resource}", :via => [:get, :post]
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def solr_document(primary_resource)
|
28
|
-
add_routes do |options|
|
29
|
-
|
30
|
-
args = {only: [:show]}
|
31
|
-
args[:constraints] = options[:constraints] if options[:constraints]
|
32
|
-
|
33
|
-
resources :solr_document, args.merge(path: "search", controller: primary_resource) do
|
34
|
-
member do
|
35
|
-
post "track"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
# :show and :update are for backwards-compatibility with catalog_url named routes
|
40
|
-
resources primary_resource, args
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
Blacklight::Routes::RouteSets.send(:include, CommonwealthVlrEngine::RouteSets)
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module CommonwealthVlrEngine
|
2
|
-
module Routes
|
3
|
-
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
included do |klass|
|
6
|
-
klass.default_route_sets.unshift(:bookmark_item_actions)
|
7
|
-
end
|
8
|
-
|
9
|
-
# route bookmark items actions (cite, email, delete) to folder_items_actions
|
10
|
-
# this needs to be before BL bookmarks stuff, so we add it at the beginning of
|
11
|
-
# the default_route_sets array
|
12
|
-
def bookmark_item_actions(_)
|
13
|
-
add_routes do |options|
|
14
|
-
put 'bookmarks/item_actions', :to => 'folder_items_actions#folder_item_actions', :as => 'selected_bookmarks_actions'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
Blacklight::Routes.send(:include, CommonwealthVlrEngine::Routes)
|
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe CommonwealthVlrEngine::CommonwealthSearchBuilder do
|
4
|
-
|
5
|
-
class CommonwealthSearchBuilderTestClass
|
6
|
-
cattr_accessor :blacklight_config, :blacklight_params
|
7
|
-
|
8
|
-
include Blacklight::SearchHelper
|
9
|
-
include CommonwealthVlrEngine::CommonwealthSearchBuilder
|
10
|
-
|
11
|
-
def initialize blacklight_config, blacklight_params
|
12
|
-
self.blacklight_config = blacklight_config
|
13
|
-
self.blacklight_params = blacklight_params
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
let(:blacklight_config) { CatalogController.blacklight_config }
|
19
|
-
let(:blacklight_params) { Hash.new }
|
20
|
-
let(:solr_parameters) { Blacklight::Solr::Request.new }
|
21
|
-
|
22
|
-
before { @obj = CommonwealthSearchBuilderTestClass.new blacklight_config, blacklight_params }
|
23
|
-
|
24
|
-
describe 'exclude_unwanted_models' do
|
25
|
-
|
26
|
-
it 'should add parameters to exclude unwanted models' do
|
27
|
-
expect(@obj.exclude_unwanted_models(solr_parameters).to_s).to include('afmodel:Bplmodels_File')
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
|
32
|
-
describe 'exclude_unpublished_items' do
|
33
|
-
|
34
|
-
let(:excluded_unpublished) { @obj.exclude_unpublished_items(solr_parameters).to_s }
|
35
|
-
|
36
|
-
it 'should add parameters to exclude non-published items' do
|
37
|
-
expect(excluded_unpublished).to include('draft')
|
38
|
-
expect(excluded_unpublished).to include('needs_review')
|
39
|
-
expect(excluded_unpublished).to include('derivatives')
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
describe 'exclude_institutions' do
|
45
|
-
|
46
|
-
it 'should add parameters to exclude institutions' do
|
47
|
-
expect(@obj.exclude_institutions(solr_parameters).to_s).to include('-active_fedora_model_suffix_ssi:\"Institution\"')
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
describe 'flagged_filter' do
|
53
|
-
|
54
|
-
it 'should add parameters to exclude flagged items' do
|
55
|
-
expect(@obj.flagged_filter(solr_parameters).to_s).to include("-#{blacklight_config.flagged_field}:[* TO *]")
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
describe 'institutions_filter' do
|
61
|
-
|
62
|
-
it 'should add parameters to require institutions' do
|
63
|
-
expect(@obj.institutions_filter(solr_parameters).to_s).to include('+active_fedora_model_suffix_ssi:\"Institution\"')
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
describe 'set_solr_id_for_mlt' do
|
69
|
-
|
70
|
-
before {blacklight_params[:mlt_id] = 'bpl-dev:12345678'}
|
71
|
-
|
72
|
-
it 'should set the id param to the mlt_id value' do
|
73
|
-
expect(@obj.set_solr_id_for_mlt(solr_parameters)).to eq('bpl-dev:12345678')
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
|
78
|
-
describe 'collections_filter' do
|
79
|
-
|
80
|
-
it 'should add parameters to require institutions' do
|
81
|
-
expect(@obj.collections_filter(solr_parameters).to_s).to include('+active_fedora_model_suffix_ssi:\"Collection\"')
|
82
|
-
end
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
describe 'ocr_search_params' do
|
87
|
-
|
88
|
-
before do
|
89
|
-
@obj.ocr_search_params(solr_parameters)
|
90
|
-
end
|
91
|
-
|
92
|
-
it 'should add parameters for field highlighting' do
|
93
|
-
expect(solr_parameters.to_s).to include('"hl"=>true')
|
94
|
-
expect(solr_parameters.to_s).to include('hl.fragsize')
|
95
|
-
expect(solr_parameters.to_s).to include("\"hl.fl\"=>\"#{blacklight_config.ocr_search_field}\"")
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
99
|
-
|
100
|
-
|
101
|
-
end
|