blacklight-spotlight 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +4 -2
- data/app/assets/stylesheets/spotlight/_footer.scss +1 -1
- data/app/assets/stylesheets/spotlight/_header.scss +0 -40
- data/app/controllers/spotlight/appearances_controller.rb +2 -2
- data/app/controllers/spotlight/custom_fields_controller.rb +1 -1
- data/app/controllers/spotlight/dashboards_controller.rb +11 -0
- data/app/controllers/spotlight/exhibits_controller.rb +2 -2
- data/app/controllers/spotlight/metadata_configurations_controller.rb +2 -2
- data/app/controllers/spotlight/roles_controller.rb +2 -2
- data/app/controllers/spotlight/search_configurations_controller.rb +2 -2
- data/app/helpers/spotlight/title_helper.rb +2 -2
- data/app/models/concerns/spotlight/solr_document.rb +10 -4
- data/app/models/concerns/spotlight/solr_document/finder.rb +14 -0
- data/app/models/spotlight/ability.rb +1 -3
- data/app/models/spotlight/blacklight_configuration.rb +2 -2
- data/app/models/spotlight/custom_field.rb +37 -15
- data/app/models/spotlight/solr_document_sidecar.rb +16 -1
- data/app/views/shared/_breadcrumbs.html.erb +5 -1
- data/app/views/shared/_exhibit_masthead.html.erb +0 -17
- data/app/views/shared/_footer.html.erb +1 -1
- data/app/views/spotlight/about_pages/index.html.erb +1 -1
- data/app/views/spotlight/appearances/edit.html.erb +2 -2
- data/app/views/spotlight/catalog/_edit_default.html.erb +1 -1
- data/app/views/spotlight/catalog/admin.html.erb +1 -1
- data/app/views/spotlight/catalog/new.html.erb +1 -1
- data/app/views/spotlight/contacts/edit.html.erb +1 -1
- data/app/views/spotlight/contacts/new.html.erb +1 -1
- data/app/views/spotlight/custom_fields/edit.html.erb +3 -3
- data/app/views/spotlight/custom_fields/new.html.erb +3 -4
- data/app/views/spotlight/dashboards/_analytics.html.erb +1 -3
- data/app/views/spotlight/dashboards/analytics.html.erb +15 -0
- data/app/views/spotlight/dashboards/show.html.erb +1 -3
- data/app/views/spotlight/exhibits/edit.html.erb +2 -2
- data/app/views/spotlight/exhibits/new.html.erb +1 -1
- data/app/views/spotlight/home_pages/_empty.html.erb +3 -3
- data/app/views/spotlight/metadata_configurations/edit.html.erb +2 -2
- data/app/views/spotlight/pages/index.html.erb +1 -1
- data/app/views/spotlight/resources/upload/new.html.erb +1 -1
- data/app/views/spotlight/roles/index.html.erb +2 -2
- data/app/views/spotlight/search_configurations/edit.html.erb +2 -2
- data/app/views/spotlight/searches/edit.html.erb +1 -1
- data/app/views/spotlight/searches/index.html.erb +4 -4
- data/app/views/spotlight/shared/_configuration_sidebar.html.erb +14 -0
- data/app/views/spotlight/shared/_curation_sidebar.html.erb +16 -26
- data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +8 -0
- data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
- data/app/views/spotlight/tags/index.html.erb +1 -1
- data/config/locales/spotlight.en.yml +12 -16
- data/config/routes.rb +3 -1
- data/db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb +13 -0
- data/db/migrate/20151124105543_update_custom_field_names.rb +31 -0
- data/lib/generators/spotlight/templates/catalog_controller.rb +1 -1
- data/lib/spotlight/engine.rb +4 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/spotlight/appearances_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/custom_fields_controller_spec.rb +4 -4
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +15 -0
- data/spec/controllers/spotlight/exhibits_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/metadata_configurations_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/roles_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +2 -2
- data/spec/features/create_exhibit_spec.rb +1 -1
- data/spec/features/edit_search_fields_spec.rb +4 -4
- data/spec/features/exhibits/administration_spec.rb +1 -1
- data/spec/features/exhibits/custom_metadata_fields_spec.rb +1 -1
- data/spec/features/exhibits/edit_metadata_fields_spec.rb +1 -1
- data/spec/features/import_exhibit_spec.rb +2 -2
- data/spec/features/javascript/search_config_admin_spec.rb +7 -7
- data/spec/features/metadata_admin_spec.rb +2 -2
- data/spec/helpers/spotlight/title_helper_spec.rb +4 -4
- data/spec/lib/spotlight/catalog/access_controls_enforcement_spec.rb +1 -1
- data/spec/models/solr_document_spec.rb +29 -4
- data/spec/models/spotlight/blacklight_configuration_spec.rb +4 -4
- data/spec/models/spotlight/custom_field_spec.rb +48 -25
- data/spec/models/spotlight/resources/upload_spec.rb +1 -1
- data/spec/models/spotlight/solr_document_sidecar_spec.rb +1 -1
- data/spec/test_app_templates/catalog_controller.rb +1 -1
- data/spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb +0 -1
- data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +33 -0
- data/spec/views/spotlight/search_configurations/_search_fields.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/searches/index.html.erb_spec.rb +3 -3
- data/spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb +20 -0
- metadata +11 -5
- data/app/views/spotlight/shared/_admin_sidebar.html.erb +0 -10
- data/spec/features/multiple_exhibits_spec.rb +0 -27
@@ -87,7 +87,7 @@ describe Spotlight::Resources::Upload, type: :model do
|
|
87
87
|
expect(subject.to_solr[:spotlight_full_image_width_ssm]).to eq 800
|
88
88
|
end
|
89
89
|
it 'has fields representing exhibit specific custom fields' do
|
90
|
-
expect(subject.to_solr[custom_field.
|
90
|
+
expect(subject.to_solr[custom_field.solr_field]).to eq 'Custom Field Data'
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -13,7 +13,7 @@ describe Spotlight::SolrDocumentSidecar, type: :model do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
its(:to_solr) { should include id: 'doc_id' }
|
16
|
-
its(:to_solr) { should include "exhibit_#{exhibit.
|
16
|
+
its(:to_solr) { should include "exhibit_#{exhibit.slug}_public_bsi".to_sym => true }
|
17
17
|
its(:to_solr) { should include 'a_tesim', 'b_tesim', 'c_tesim' }
|
18
18
|
end
|
19
19
|
end
|
@@ -85,7 +85,7 @@ class CatalogController < ApplicationController
|
|
85
85
|
config.add_show_field 'personal_name_ssm', label: 'Personal Names'
|
86
86
|
config.add_show_field 'corporate_name_ssm', label: 'Corporate Names'
|
87
87
|
|
88
|
-
config.add_search_field 'all_fields', label: '
|
88
|
+
config.add_search_field 'all_fields', label: 'Everything'
|
89
89
|
config.add_search_field 'title', label: 'Title', solr_local_parameters: { qf: 'full_title_tesim', pf: 'full_title_tesim' }
|
90
90
|
config.add_search_field 'author', label: 'Author', solr_local_parameters: { qf: '$qf_author', pf: '$pf_author' }
|
91
91
|
|
@@ -6,7 +6,6 @@ describe 'spotlight/dashboards/_analytics.html.erb', type: :view do
|
|
6
6
|
let(:page_data) { [OpenStruct.new(pageTitle: 'title', pagePath: '/path', pageviews: '123')] }
|
7
7
|
before do
|
8
8
|
allow(view).to receive_messages(current_exhibit: current_exhibit, exhibit_root_path: '/some/path')
|
9
|
-
allow(Spotlight::Analytics::Ga).to receive(:enabled?).and_return(true)
|
10
9
|
allow(current_exhibit).to receive(:analytics).and_return(ga_data)
|
11
10
|
allow(current_exhibit).to receive(:page_analytics).and_return(page_data)
|
12
11
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'spotlight/dashboards/analytics.html.erb', type: :view do
|
4
|
+
let(:current_exhibit) { FactoryGirl.create(:exhibit) }
|
5
|
+
|
6
|
+
before do
|
7
|
+
allow(view).to receive_messages(current_exhibit: current_exhibit, exhibit_root_path: '/some/path')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'has a header' do
|
11
|
+
render
|
12
|
+
expect(rendered).to have_selector '.page-header', text: 'Curation'
|
13
|
+
expect(rendered).to have_selector '.page-header small', text: 'Analytics'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'has directions for configuring analytics' do
|
17
|
+
render
|
18
|
+
expect(rendered).to have_link 'configure an analytics provider'
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'with a configured analytics integration' do
|
22
|
+
before do
|
23
|
+
allow(Spotlight::Analytics::Ga).to receive(:enabled?).and_return(true)
|
24
|
+
stub_template 'spotlight/dashboards/_analytics.html.erb' => 'Analytics data'
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'has analytics data' do
|
28
|
+
render
|
29
|
+
|
30
|
+
expect(rendered).to have_content 'Analytics data'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -32,7 +32,7 @@ module Spotlight
|
|
32
32
|
expect(rendered).to have_selector 'input[data-behavior="enable-feature"][data-target="#search_fields"]'
|
33
33
|
end
|
34
34
|
|
35
|
-
it 'has a read-only "
|
35
|
+
it 'has a read-only "everything" search option' do
|
36
36
|
render partial: 'spotlight/search_configurations/search_fields', locals: { f: f }
|
37
37
|
expect(rendered).to have_selector "input[name='blacklight_configuration[search_fields][all_fields][enabled]'][data-readonly='true']"
|
38
38
|
end
|
@@ -25,9 +25,9 @@ describe 'spotlight/searches/index.html.erb', type: :view do
|
|
25
25
|
render
|
26
26
|
expect(rendered).to have_css '.alert-warning', text: %(\
|
27
27
|
This exhibit is not currently searchable. To perform searches that can \
|
28
|
-
be saved as additional browse categories,
|
29
|
-
temporarily turn on the
|
30
|
-
of the
|
28
|
+
be saved as additional browse categories, \
|
29
|
+
temporarily turn on the Display search box option in the Options section \
|
30
|
+
of the Configuration > Search page.)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'spotlight/sir_trevor/blocks/_browse_block.html.erb', type: :view do
|
4
|
+
let(:p) { 'spotlight/sir_trevor/blocks/browse_block.html.erb' }
|
5
|
+
let(:page) { double('Page', display_sidebar?: true) }
|
6
|
+
let(:search) { FactoryGirl.create(:search) }
|
7
|
+
let(:block) do
|
8
|
+
assign(:page, page)
|
9
|
+
SirTrevorRails::Blocks::BrowseBlock.new({ type: 'block', data: {} }, page)
|
10
|
+
end
|
11
|
+
|
12
|
+
before do
|
13
|
+
allow(block).to receive(:searches).and_return([search])
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'links to the search' do
|
17
|
+
render partial: p, locals: { browse_block: block }
|
18
|
+
expect(rendered).to have_link search.title, href: spotlight.exhibit_browse_path(search.exhibit, search)
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-spotlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-11-
|
14
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -951,6 +951,7 @@ files:
|
|
951
951
|
- app/views/spotlight/dashboards/_page.html.erb
|
952
952
|
- app/views/spotlight/dashboards/_page_activity.html.erb
|
953
953
|
- app/views/spotlight/dashboards/_solr_document_activity.html.erb
|
954
|
+
- app/views/spotlight/dashboards/analytics.html.erb
|
954
955
|
- app/views/spotlight/dashboards/show.html.erb
|
955
956
|
- app/views/spotlight/exhibits/_confirmation_status.html.erb
|
956
957
|
- app/views/spotlight/exhibits/_contact.html.erb
|
@@ -1012,8 +1013,9 @@ files:
|
|
1012
1013
|
- app/views/spotlight/searches/_search.html.erb
|
1013
1014
|
- app/views/spotlight/searches/edit.html.erb
|
1014
1015
|
- app/views/spotlight/searches/index.html.erb
|
1015
|
-
- app/views/spotlight/shared/
|
1016
|
+
- app/views/spotlight/shared/_configuration_sidebar.html.erb
|
1016
1017
|
- app/views/spotlight/shared/_curation_sidebar.html.erb
|
1018
|
+
- app/views/spotlight/shared/_exhibit_sidebar.html.erb
|
1017
1019
|
- app/views/spotlight/shared/_report_a_problem.html.erb
|
1018
1020
|
- app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb
|
1019
1021
|
- app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb
|
@@ -1074,6 +1076,8 @@ files:
|
|
1074
1076
|
- db/migrate/20151016092343_remove_searchable_from_exhibit.rb
|
1075
1077
|
- db/migrate/20151110082345_add_metadata_to_spotlight_resource.rb
|
1076
1078
|
- db/migrate/20151117153210_change_spotlight_exhibit_published_default.rb
|
1079
|
+
- db/migrate/20151124101123_remove_default_from_spotlight_exhibit.rb
|
1080
|
+
- db/migrate/20151124105543_update_custom_field_names.rb
|
1077
1081
|
- lib/blacklight/spotlight.rb
|
1078
1082
|
- lib/generators/spotlight/install_generator.rb
|
1079
1083
|
- lib/generators/spotlight/templates/catalog_controller.rb
|
@@ -1169,7 +1173,6 @@ files:
|
|
1169
1173
|
- spec/features/javascript/search_context_spec.rb
|
1170
1174
|
- spec/features/main_navigation_spec.rb
|
1171
1175
|
- spec/features/metadata_admin_spec.rb
|
1172
|
-
- spec/features/multiple_exhibits_spec.rb
|
1173
1176
|
- spec/features/report_a_problem_spec.rb
|
1174
1177
|
- spec/features/site_masthead_spec.rb
|
1175
1178
|
- spec/features/slideshow_spec.rb
|
@@ -1261,6 +1264,7 @@ files:
|
|
1261
1264
|
- spec/views/spotlight/catalog/new.html.erb_spec.rb
|
1262
1265
|
- spec/views/spotlight/contacts/edit.html.erb_spec.rb
|
1263
1266
|
- spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb
|
1267
|
+
- spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
|
1264
1268
|
- spec/views/spotlight/exhibits/edit.html.erb_spec.rb
|
1265
1269
|
- spec/views/spotlight/exhibits/index.html.erb_spec.rb
|
1266
1270
|
- spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb
|
@@ -1279,6 +1283,7 @@ files:
|
|
1279
1283
|
- spec/views/spotlight/searches/_search.html.erb_spec.rb
|
1280
1284
|
- spec/views/spotlight/searches/edit.html.erb_spec.rb
|
1281
1285
|
- spec/views/spotlight/searches/index.html.erb_spec.rb
|
1286
|
+
- spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb
|
1282
1287
|
- spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb
|
1283
1288
|
- spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb
|
1284
1289
|
- spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb
|
@@ -1398,7 +1403,6 @@ test_files:
|
|
1398
1403
|
- spec/features/javascript/search_context_spec.rb
|
1399
1404
|
- spec/features/main_navigation_spec.rb
|
1400
1405
|
- spec/features/metadata_admin_spec.rb
|
1401
|
-
- spec/features/multiple_exhibits_spec.rb
|
1402
1406
|
- spec/features/report_a_problem_spec.rb
|
1403
1407
|
- spec/features/site_masthead_spec.rb
|
1404
1408
|
- spec/features/slideshow_spec.rb
|
@@ -1490,6 +1494,7 @@ test_files:
|
|
1490
1494
|
- spec/views/spotlight/catalog/new.html.erb_spec.rb
|
1491
1495
|
- spec/views/spotlight/contacts/edit.html.erb_spec.rb
|
1492
1496
|
- spec/views/spotlight/dashboards/_analytics.html.erb_spec.rb
|
1497
|
+
- spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
|
1493
1498
|
- spec/views/spotlight/exhibits/edit.html.erb_spec.rb
|
1494
1499
|
- spec/views/spotlight/exhibits/index.html.erb_spec.rb
|
1495
1500
|
- spec/views/spotlight/feature_pages/_empty.html.erb_spec.rb
|
@@ -1508,6 +1513,7 @@ test_files:
|
|
1508
1513
|
- spec/views/spotlight/searches/_search.html.erb_spec.rb
|
1509
1514
|
- spec/views/spotlight/searches/edit.html.erb_spec.rb
|
1510
1515
|
- spec/views/spotlight/searches/index.html.erb_spec.rb
|
1516
|
+
- spec/views/spotlight/sir_trevor/blocks/_browse_block.html.erb_spec.rb
|
1511
1517
|
- spec/views/spotlight/sir_trevor/blocks/_iframe_block.html.erb_spec.rb
|
1512
1518
|
- spec/views/spotlight/sir_trevor/blocks/_rule_block.html.erb_spec.rb
|
1513
1519
|
- spec/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb_spec.rb
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<h4><%=t(:'spotlight.administration.sidebar.header') %></h4>
|
2
|
-
<ul class="nav sidenav">
|
3
|
-
<% if can? :update, current_exhibit %>
|
4
|
-
<li><%= link_to t(:'spotlight.administration.sidebar.settings'), spotlight.edit_exhibit_path(current_exhibit) %></li>
|
5
|
-
<li><%= link_to t(:'spotlight.administration.sidebar.appearance'), spotlight.edit_exhibit_appearance_path(current_exhibit) %></li>
|
6
|
-
<% end %>
|
7
|
-
<% if can? :manage, Spotlight::Role.new(exhibit: current_exhibit) %>
|
8
|
-
<li><%= link_to t(:'spotlight.administration.sidebar.users'), spotlight.exhibit_roles_path(current_exhibit) %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
describe 'Home page', type: :feature do
|
3
|
-
let(:exhibit_visitor) { FactoryGirl.create(:exhibit_visitor) }
|
4
|
-
let!(:default_exhibit) { FactoryGirl.create(:exhibit, title: 'Default exhibit', published: true) }
|
5
|
-
let!(:second_exhibit) { FactoryGirl.create(:exhibit, title: 'Second exhibit', published: true) }
|
6
|
-
|
7
|
-
before { login_as exhibit_visitor }
|
8
|
-
|
9
|
-
it 'exists by default on exhibits' do
|
10
|
-
visit spotlight.url_for(default_exhibit)
|
11
|
-
|
12
|
-
expect(page).to have_selector '.site-title', text: 'Default exhibit'
|
13
|
-
expect(page).to have_link 'More Exhibits'
|
14
|
-
within '#exhibit-masthead .dropdown-menu' do
|
15
|
-
expect(page).to have_no_link 'Default exhibit'
|
16
|
-
click_link 'Second exhibit'
|
17
|
-
end
|
18
|
-
|
19
|
-
expect(page).to have_selector '.site-title', text: 'Second exhibit'
|
20
|
-
expect(page).to have_link 'More Exhibits'
|
21
|
-
within '#exhibit-masthead .dropdown-menu' do
|
22
|
-
expect(page).to have_no_link 'Second exhibit'
|
23
|
-
click_link 'Default exhibit'
|
24
|
-
end
|
25
|
-
expect(page).to have_selector '.site-title', text: 'Default exhibit'
|
26
|
-
end
|
27
|
-
end
|