blacklight-spotlight 2.13.0 → 3.0.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/blacklight/add_circle.svg +1 -0
- data/app/assets/images/blacklight/arrow_back_ios.svg +1 -0
- data/app/assets/images/blacklight/arrow_forward_ios.svg +1 -0
- data/app/assets/images/blacklight/check.svg +1 -0
- data/app/assets/images/blacklight/check_circle.svg +1 -0
- data/app/assets/images/blacklight/chevron_right.svg +1 -0
- data/app/assets/images/blacklight/custom_fullscreen.svg +1 -0
- data/app/assets/images/blacklight/edit.svg +1 -0
- data/app/assets/images/blacklight/error.svg +1 -0
- data/app/assets/images/blacklight/info.svg +1 -0
- data/app/assets/images/blacklight/remove_circle.svg +1 -0
- data/app/assets/images/blacklight/remove_circle_outline.svg +1 -0
- data/app/assets/images/blacklight/resize_small.svg +1 -0
- data/app/assets/images/blacklight/warning.svg +1 -0
- data/app/assets/javascripts/spotlight/admin/block_mixins/autocompleteable.js +1 -1
- data/app/assets/javascripts/spotlight/admin/block_mixins/plustextable.js +2 -2
- data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +1 -1
- data/app/assets/javascripts/spotlight/admin/blocks/pages_block.js +1 -1
- data/app/assets/javascripts/spotlight/admin/blocks/resources_block.js +7 -7
- data/app/assets/javascripts/spotlight/admin/blocks/solr_documents_base_block.js +3 -3
- data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -7
- data/app/assets/javascripts/spotlight/admin/catalog_edit.js +2 -2
- data/app/assets/javascripts/spotlight/admin/multi_image_selector.js +2 -2
- data/app/assets/javascripts/spotlight/admin/reindex_monitor.js +1 -1
- data/app/assets/javascripts/spotlight/admin/search_typeahead.js +2 -2
- data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +1 -1
- data/app/assets/javascripts/spotlight/admin/users.js +1 -1
- data/app/assets/javascripts/spotlight/user/index.js +1 -0
- data/app/assets/javascripts/spotlight/user/zpr_links.js.erb +6 -6
- data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +44 -4
- data/app/assets/stylesheets/spotlight/_blacklight_overrides.scss +4 -8
- data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +31 -14
- data/app/assets/stylesheets/spotlight/_browse.scss +16 -13
- data/app/assets/stylesheets/spotlight/_catalog.scss +13 -7
- data/app/assets/stylesheets/spotlight/_collapse_toggle.scss +10 -14
- data/app/assets/stylesheets/spotlight/_curation.scss +34 -32
- data/app/assets/stylesheets/spotlight/_exhibit_admin.scss +4 -29
- data/app/assets/stylesheets/spotlight/_exhibits_index.scss +16 -14
- data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +22 -20
- data/app/assets/stylesheets/spotlight/_footer.scss +2 -2
- data/app/assets/stylesheets/spotlight/_header.scss +18 -39
- data/app/assets/stylesheets/spotlight/_item_text_block.scss +1 -24
- data/app/assets/stylesheets/spotlight/_mixins.scss +3 -8
- data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +1 -1
- data/app/assets/stylesheets/spotlight/_nestable.scss +1 -2
- data/app/assets/stylesheets/spotlight/_pages.scss +33 -54
- data/app/assets/stylesheets/spotlight/_report_a_problem.scss +7 -1
- data/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss +9 -9
- data/app/assets/stylesheets/spotlight/_slideshow_block.scss +13 -11
- data/app/assets/stylesheets/spotlight/_spotlight.scss +0 -1
- data/app/assets/stylesheets/spotlight/_translations.scss +12 -12
- data/app/assets/stylesheets/spotlight/_variables.scss +14 -15
- data/app/assets/stylesheets/spotlight/_variables_bootstrap.scss +7 -7
- data/app/assets/stylesheets/spotlight/typeahead.css +1 -1
- data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +3 -2
- data/app/controllers/concerns/spotlight/catalog.rb +1 -1
- data/app/controllers/concerns/spotlight/controller.rb +3 -3
- data/app/controllers/concerns/spotlight/search_helper.rb +23 -0
- data/app/controllers/spotlight/browse_controller.rb +18 -4
- data/app/controllers/spotlight/catalog_controller.rb +13 -17
- data/app/controllers/spotlight/dashboards_controller.rb +5 -1
- data/app/controllers/spotlight/exhibits_controller.rb +1 -1
- data/app/controllers/spotlight/home_pages_controller.rb +32 -3
- data/app/controllers/spotlight/pages_controller.rb +19 -1
- data/app/controllers/spotlight/search_configurations_controller.rb +3 -3
- data/app/controllers/spotlight/searches_controller.rb +4 -1
- data/app/controllers/spotlight/solr_controller.rb +1 -2
- data/app/helpers/spotlight/application_helper.rb +1 -1
- data/app/helpers/spotlight/browse_helper.rb +1 -1
- data/app/helpers/spotlight/crud_link_helpers.rb +19 -0
- data/app/helpers/spotlight/pages_helper.rb +1 -1
- data/app/mailers/spotlight/contact_mailer.rb +1 -1
- data/app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb +2 -2
- data/app/models/concerns/spotlight/exhibit_analytics.rb +1 -3
- data/app/models/concerns/spotlight/exhibit_documents.rb +1 -1
- data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +11 -3
- data/app/models/spotlight/ability.rb +1 -1
- data/app/models/spotlight/analytics/ga.rb +25 -35
- data/app/models/spotlight/analytics/ga_model.rb +29 -0
- data/app/models/spotlight/blacklight_configuration.rb +5 -3
- data/app/models/spotlight/contact_form.rb +11 -4
- data/app/models/spotlight/exhibit.rb +0 -4
- data/app/models/spotlight/field_metadata.rb +3 -9
- data/app/models/spotlight/page.rb +0 -3
- data/app/models/spotlight/page_configurations.rb +1 -1
- data/app/models/spotlight/role.rb +0 -4
- data/app/models/spotlight/search.rb +3 -17
- data/app/presenters/spotlight/iiif_manifest_presenter.rb +5 -1
- data/app/serializers/spotlight/exhibit_export_serializer.rb +69 -28
- data/app/serializers/spotlight/page_representer.rb +1 -1
- data/app/views/catalog/_save_search.html.erb +6 -4
- data/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
- data/app/views/layouts/spotlight/base.html.erb +48 -0
- data/app/views/layouts/spotlight/spotlight.html.erb +16 -54
- data/app/views/shared/_about_navbar.html.erb +2 -2
- data/app/views/shared/_browse_navbar.html.erb +2 -2
- data/app/views/shared/_curated_features_navbar.html.erb +4 -4
- data/app/views/shared/_exhibit_navbar.html.erb +5 -5
- data/app/views/shared/_header_navbar.html.erb +8 -13
- data/app/views/shared/_masthead.html.erb +1 -1
- data/app/views/shared/_site_sidebar.html.erb +6 -6
- data/app/views/shared/_user_util_links.html.erb +47 -0
- data/app/views/spotlight/about_pages/_contact.html.erb +3 -4
- data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
- data/app/views/spotlight/about_pages/_sidebar.html.erb +3 -5
- data/app/views/spotlight/about_pages/index.html.erb +7 -6
- data/app/views/spotlight/admin_users/index.html.erb +78 -79
- data/app/views/spotlight/appearances/edit.html.erb +26 -23
- data/app/views/spotlight/browse/_search.html.erb +2 -2
- data/app/views/spotlight/browse/_search_box.html.erb +9 -6
- data/app/views/spotlight/browse/_search_title.html.erb +1 -1
- data/app/views/spotlight/browse/_sort_and_per_page.html.erb +3 -5
- data/app/views/spotlight/browse/index.html.erb +4 -6
- data/app/views/spotlight/browse/show.html.erb +1 -1
- data/app/views/spotlight/catalog/_admin_header.html.erb +2 -2
- data/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb +1 -1
- data/app/views/spotlight/catalog/_document_admin_table.html.erb +4 -4
- data/app/views/spotlight/catalog/_edit_sidecar.html.erb +1 -1
- data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -2
- data/app/views/spotlight/catalog/_reindex_progress_panel.html.erb +3 -5
- data/app/views/spotlight/catalog/admin.html.erb +12 -12
- data/app/views/spotlight/contact_forms/new.html.erb +1 -3
- data/app/views/spotlight/contacts/edit.html.erb +6 -5
- data/app/views/spotlight/contacts/new.html.erb +6 -5
- data/app/views/spotlight/custom_fields/edit.html.erb +6 -5
- data/app/views/spotlight/custom_fields/new.html.erb +6 -5
- data/app/views/spotlight/dashboards/_analytics.html.erb +3 -3
- data/app/views/spotlight/dashboards/_page.html.erb +6 -6
- data/app/views/spotlight/dashboards/_page_activity.html.erb +5 -5
- data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +12 -12
- data/app/views/spotlight/dashboards/analytics.html.erb +11 -11
- data/app/views/spotlight/dashboards/show.html.erb +13 -13
- data/app/views/spotlight/exhibits/_confirmation_status.html.erb +3 -4
- data/app/views/spotlight/exhibits/_contact.html.erb +3 -3
- data/app/views/spotlight/exhibits/_delete.html.erb +7 -5
- data/app/views/spotlight/exhibits/_exhibit_card.html.erb +2 -2
- data/app/views/spotlight/exhibits/_exhibit_card_front.html.erb +2 -2
- data/app/views/spotlight/exhibits/_form.html.erb +5 -5
- data/app/views/spotlight/exhibits/_languages.html.erb +2 -2
- data/app/views/spotlight/exhibits/_new_exhibit_form.html.erb +0 -2
- data/app/views/spotlight/exhibits/edit.html.erb +43 -42
- data/app/views/spotlight/exhibits/index.html.erb +40 -41
- data/app/views/spotlight/exhibits/new.html.erb +4 -5
- data/app/views/spotlight/feature_pages/_header.html.erb +12 -14
- data/app/views/spotlight/feature_pages/_sidebar.html.erb +2 -4
- data/app/views/spotlight/featured_images/_form.html.erb +4 -4
- data/app/views/spotlight/filters/_form.html.erb +1 -1
- data/app/views/spotlight/home_pages/_edit_page_link.html.erb +1 -1
- data/app/views/spotlight/home_pages/_sidebar.html.erb +1 -3
- data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +4 -4
- data/app/views/spotlight/metadata_configurations/edit.html.erb +5 -4
- data/app/views/spotlight/pages/_edit_page_link.html.erb +1 -1
- data/app/views/spotlight/pages/_form.html.erb +7 -7
- data/app/views/spotlight/pages/_order_pages.html.erb +2 -2
- data/app/views/spotlight/pages/_page.html.erb +11 -11
- data/app/views/spotlight/pages/_view_type_group.html.erb +1 -1
- data/app/views/spotlight/pages/edit.html.erb +2 -4
- data/app/views/spotlight/pages/index.html.erb +5 -4
- data/app/views/spotlight/pages/show.html.erb +5 -4
- data/app/views/spotlight/resources/_external_resources_form.html.erb +2 -2
- data/app/views/spotlight/resources/_form.html.erb +1 -1
- data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
- data/app/views/spotlight/resources/iiif/_form.html.erb +1 -1
- data/app/views/spotlight/resources/json_upload/_form.html.erb +1 -1
- data/app/views/spotlight/resources/new.html.erb +25 -23
- data/app/views/spotlight/resources/upload/_form.html.erb +2 -2
- data/app/views/spotlight/roles/index.html.erb +60 -57
- data/app/views/spotlight/search_configurations/_facet_metadata.html.erb +3 -1
- data/app/views/spotlight/search_configurations/_facets.html.erb +19 -18
- data/app/views/spotlight/search_configurations/_search_fields.html.erb +6 -6
- data/app/views/spotlight/search_configurations/_sort.html.erb +6 -6
- data/app/views/spotlight/search_configurations/edit.html.erb +42 -40
- data/app/views/spotlight/searches/_form.html.erb +15 -10
- data/app/views/spotlight/searches/_search.html.erb +29 -22
- data/app/views/spotlight/searches/edit.html.erb +6 -5
- data/app/views/spotlight/searches/index.html.erb +32 -31
- data/app/views/spotlight/shared/_configuration_sidebar.html.erb +6 -6
- data/app/views/spotlight/shared/_curation_sidebar.html.erb +8 -9
- data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +6 -8
- data/app/views/spotlight/shared/_locale_picker.html.erb +3 -3
- data/app/views/spotlight/shared/_report_a_problem.html.erb +2 -2
- data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
- data/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb +2 -2
- data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +2 -2
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +8 -8
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +8 -8
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb +3 -4
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +32 -31
- data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +5 -5
- data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +8 -10
- data/app/views/spotlight/sites/edit.html.erb +31 -34
- data/app/views/spotlight/sites/edit_exhibits.html.erb +28 -29
- data/app/views/spotlight/tags/index.html.erb +25 -24
- data/app/views/spotlight/translations/_browse_categories.html.erb +20 -15
- data/app/views/spotlight/translations/_general.html.erb +69 -91
- data/app/views/spotlight/translations/_metadata.html.erb +18 -14
- data/app/views/spotlight/translations/_page.html.erb +2 -2
- data/app/views/spotlight/translations/_search_fields.html.erb +26 -20
- data/app/views/spotlight/translations/edit.html.erb +16 -14
- data/config/locales/spotlight.en.yml +3 -0
- data/config/routes.rb +1 -1
- data/lib/generators/spotlight/install_generator.rb +2 -2
- data/lib/generators/spotlight/scaffold_resource_generator.rb +1 -1
- data/lib/generators/spotlight/templates/spotlight.scss +0 -1
- data/lib/spotlight/engine.rb +12 -0
- data/lib/spotlight/version.rb +1 -1
- data/spec/controllers/application_controller_spec.rb +2 -2
- data/spec/controllers/spotlight/browse_controller_spec.rb +1 -1
- data/spec/controllers/spotlight/catalog_controller_spec.rb +13 -13
- data/spec/controllers/spotlight/dashboards_controller_spec.rb +2 -1
- data/spec/controllers/spotlight/search_configurations_controller_spec.rb +1 -1
- data/spec/examples.txt +50 -1489
- data/spec/features/add_items_spec.rb +2 -2
- data/spec/features/browse_category_admin_spec.rb +3 -3
- data/spec/features/browse_category_spec.rb +3 -3
- data/spec/features/catalog_spec.rb +1 -1
- data/spec/features/exhibits/translation_editing_spec.rb +21 -21
- data/spec/features/feature_page_spec.rb +1 -1
- data/spec/features/home_page_spec.rb +3 -3
- data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +1 -1
- data/spec/features/javascript/blocks/link_to_search_block_spec.rb +1 -1
- data/spec/features/javascript/blocks/search_result_block_spec.rb +9 -4
- data/spec/features/javascript/blocks/solr_documents_block_spec.rb +23 -15
- data/spec/features/javascript/blocks/solr_documents_carousel_block_spec.rb +29 -0
- data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +2 -2
- data/spec/features/javascript/edit_in_place_spec.rb +1 -0
- data/spec/features/javascript/feature_page_admin_spec.rb +11 -11
- data/spec/features/javascript/locale_selector_spec.rb +0 -1
- data/spec/features/javascript/multi_image_select_spec.rb +3 -3
- data/spec/features/javascript/reindex_monitor_spec.rb +2 -2
- data/spec/features/javascript/roles_admin_spec.rb +2 -2
- data/spec/features/javascript/search_context_spec.rb +4 -6
- data/spec/features/site_users_management_spec.rb +1 -1
- data/spec/helpers/spotlight/application_helper_spec.rb +2 -1
- data/spec/helpers/spotlight/crud_link_helpers_spec.rb +19 -0
- data/spec/helpers/spotlight/languages_helper_spec.rb +1 -0
- data/spec/lib/spotlight/controller_spec.rb +2 -2
- data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +38 -0
- data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +7 -6
- data/spec/models/spotlight/analytics/ga_spec.rb +16 -1
- data/spec/models/spotlight/contact_form_spec.rb +37 -5
- data/spec/models/spotlight/exhibit_spec.rb +8 -4
- data/spec/presenters/spotlight/iiif_manifest_presenter_spec.rb +4 -0
- data/spec/routing/spotlight/exhibit_catalog_spec.rb +15 -11
- data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +60 -0
- data/spec/test_app_templates/Gemfile.extra +3 -0
- data/spec/test_app_templates/catalog_controller.rb +4 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -2
- data/spec/views/shared/_header_navbar.html.erb_spec.rb +1 -1
- data/spec/views/shared/_masthead.html.erb_spec.rb +1 -1
- data/spec/views/{_user_util_links.html.erb_spec.rb → shared/_user_util_links.html.erb_spec.rb} +1 -1
- data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/browse/_search.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/browse/_sort_and_per_page.html.erb_spec.rb +2 -13
- data/spec/views/spotlight/browse/show.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +5 -5
- data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +7 -7
- data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -2
- data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +2 -1
- data/spec/views/spotlight/pages/index.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/pages/show.html.erb_spec.rb +3 -3
- data/spec/views/spotlight/searches/_search.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/searches/edit.html.erb_spec.rb +3 -3
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +3 -3
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb +2 -2
- data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +1 -1
- data/spec/views/spotlight/translations/_page.html.erb_spec.rb +2 -2
- data/vendor/assets/javascripts/bootstrap-tagsinput.js +1 -1
- data/vendor/assets/stylesheets/sir-trevor/_variables.scss +15 -8
- metadata +31 -28
- data/app/assets/stylesheets/spotlight/_navbar.scss +0 -48
- data/app/views/_user_util_links.html.erb +0 -50
- data/app/views/shared/_modal.html.erb +0 -6
@@ -31,6 +31,7 @@ describe 'Edit in place', type: :feature, js: true do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'rejects blank values' do
|
34
|
+
skip('Throws Selenium::WebDriver::Error::ElementNotInteractableError')
|
34
35
|
skip('Passes locally, but soooo flakey on Travis.') if ENV['CI']
|
35
36
|
visit spotlight.exhibit_dashboard_path(exhibit)
|
36
37
|
|
@@ -40,10 +40,10 @@ feature 'Feature Pages Adminstration', js: true do
|
|
40
40
|
within("[data-id='#{page1.id}']") do
|
41
41
|
within('h3') do
|
42
42
|
expect(page).to have_content('FeaturePage1')
|
43
|
-
expect(page).to have_css('
|
43
|
+
expect(page).to have_css('.title-field', visible: false)
|
44
44
|
click_link('FeaturePage1')
|
45
|
-
expect(page).to have_css('
|
46
|
-
find('
|
45
|
+
expect(page).to have_css('.title-field', visible: true)
|
46
|
+
find('.title-field').set('NewFeaturePage1')
|
47
47
|
end
|
48
48
|
end
|
49
49
|
click_button('Save changes')
|
@@ -85,10 +85,10 @@ feature 'Feature Pages Adminstration', js: true do
|
|
85
85
|
within("[data-id='#{page1.id}']") do
|
86
86
|
within('h3') do
|
87
87
|
expect(page).to have_content('FeaturePage1')
|
88
|
-
expect(page).to have_css('
|
88
|
+
expect(page).to have_css('.title-field', visible: false)
|
89
89
|
click_link('FeaturePage1')
|
90
|
-
expect(page).to have_css('
|
91
|
-
find('
|
90
|
+
expect(page).to have_css('.title-field', visible: true)
|
91
|
+
find('.title-field').set('NewFancyTitle')
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -120,19 +120,19 @@ feature 'Feature Pages Adminstration', js: true do
|
|
120
120
|
click_link 'Feature pages'
|
121
121
|
|
122
122
|
within('.home_page') do
|
123
|
-
within('h3.
|
123
|
+
within('h3.card-title') do
|
124
124
|
expect(page).to have_content(exhibit.home_page.title)
|
125
|
-
expect(page).to have_css('
|
125
|
+
expect(page).to have_css('.title-field', visible: false)
|
126
126
|
click_link(exhibit.home_page.title)
|
127
|
-
expect(page).to have_css('
|
128
|
-
find('
|
127
|
+
expect(page).to have_css('.title-field', visible: true)
|
128
|
+
find('.title-field').set('New Home Page Title')
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
132
|
click_button('Save changes')
|
133
133
|
|
134
134
|
within('.home_page') do
|
135
|
-
within('h3.
|
135
|
+
within('h3.card-title') do
|
136
136
|
expect(page).to have_content('New Home Page Title')
|
137
137
|
end
|
138
138
|
end
|
@@ -13,9 +13,9 @@ describe 'Multi image selector', type: :feature, js: true, versioning: true, def
|
|
13
13
|
|
14
14
|
fill_in_typeahead_field with: 'xd327cm9378'
|
15
15
|
|
16
|
-
expect(page).to have_selector '.
|
16
|
+
expect(page).to have_selector '.card'
|
17
17
|
|
18
|
-
within('.
|
18
|
+
within('.card') do
|
19
19
|
expect(page).to have_content(/Image \d of \d/)
|
20
20
|
expect(page).to have_link 'Change'
|
21
21
|
end
|
@@ -29,7 +29,7 @@ describe 'Multi image selector', type: :feature, js: true, versioning: true, def
|
|
29
29
|
|
30
30
|
click_link('Edit')
|
31
31
|
|
32
|
-
within('.
|
32
|
+
within('.card') do
|
33
33
|
expect(page).to have_content(/Image \d of \d/)
|
34
34
|
find('a', text: 'Change').click
|
35
35
|
end
|
@@ -14,8 +14,8 @@ feature 'Reindex Monitor', js: true, default_max_wait_time: 10 do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'is rendered on the item admin page' do
|
17
|
-
expect(page).to have_css('.
|
18
|
-
within('.
|
17
|
+
expect(page).to have_css('.card.index-status', visible: true)
|
18
|
+
within('.card.index-status') do
|
19
19
|
expect(page).to have_css('p', text: /Began reindexing a total of \d+ items/)
|
20
20
|
expect(page).to have_css('p', text: /Reindexed \d+ of \d+ items/)
|
21
21
|
end
|
@@ -23,7 +23,7 @@ describe 'Roles Admin', type: :feature, js: true do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'persists invited users to the exhibits user list' do
|
26
|
-
expect(page).not_to have_css('.
|
26
|
+
expect(page).not_to have_css('.badge-warning pending-label', text: 'pending', visible: true)
|
27
27
|
|
28
28
|
click_link 'Add a new user'
|
29
29
|
fill_in 'User key', with: 'user@example.com'
|
@@ -31,7 +31,7 @@ describe 'Roles Admin', type: :feature, js: true do
|
|
31
31
|
|
32
32
|
within('tr.invite-pending') do
|
33
33
|
expect(page).to have_css('td', text: 'user@example.com')
|
34
|
-
expect(page).to have_css('.
|
34
|
+
expect(page).to have_css('.badge-warning.pending-label', text: 'pending', visible: true)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -32,12 +32,11 @@ feature 'Search contexts' do
|
|
32
32
|
|
33
33
|
# verify that the item + image widget is displaying an image from the document.
|
34
34
|
within(:css, '.items-block') do
|
35
|
-
expect(page).to have_css('.thumbnail')
|
36
|
-
expect(page).to have_css('.thumbnail a img')
|
35
|
+
expect(page).to have_css('.img-thumbnail')
|
37
36
|
expect(page).not_to have_css('.title')
|
38
37
|
end
|
39
38
|
|
40
|
-
find('.
|
39
|
+
find('.items-block a').click
|
41
40
|
|
42
41
|
expect(page).to have_selector '.breadcrumb a', text: 'Home'
|
43
42
|
end
|
@@ -62,12 +61,11 @@ feature 'Search contexts' do
|
|
62
61
|
|
63
62
|
# verify that the item + image widget is displaying an image from the document.
|
64
63
|
within(:css, '.items-block') do
|
65
|
-
expect(page).to have_css('.thumbnail')
|
66
|
-
expect(page).to have_css('.thumbnail a img')
|
64
|
+
expect(page).to have_css('.img-thumbnail')
|
67
65
|
expect(page).not_to have_css('.title')
|
68
66
|
end
|
69
67
|
|
70
|
-
find('.
|
68
|
+
find('.items-block a').click
|
71
69
|
|
72
70
|
expect(page).to have_selector '.breadcrumb a', text: 'Home'
|
73
71
|
expect(page).to have_link 'FeaturePage1', href: spotlight.exhibit_feature_page_path(exhibit, feature_page)
|
@@ -45,7 +45,7 @@ describe 'Site users management', js: true do
|
|
45
45
|
expect(page).to have_css(:td, text: 'not-an-admin@example.com')
|
46
46
|
|
47
47
|
expect(page).to have_css(:a, text: 'Remove from admin role', count: 4)
|
48
|
-
within(all('table tbody tr').last) do
|
48
|
+
within(all('table tbody tr:not([data-edit-for])').last) do
|
49
49
|
click_link 'Remove from admin role'
|
50
50
|
end
|
51
51
|
|
@@ -110,7 +110,8 @@ describe Spotlight::ApplicationHelper, type: :helper do
|
|
110
110
|
before do
|
111
111
|
allow(helper).to receive_messages(current_exhibit: current_exhibit)
|
112
112
|
allow(helper).to receive_messages(blacklight_config: Blacklight::Configuration.new do |config|
|
113
|
-
config.
|
113
|
+
config.show.display_type_field = :some_field # Blacklight 7.4+
|
114
|
+
config.index.display_type_field = :some_field # pre Blacklight 7.4
|
114
115
|
end)
|
115
116
|
end
|
116
117
|
|
@@ -128,4 +128,23 @@ describe Spotlight::CrudLinkHelpers, type: :helper do
|
|
128
128
|
expect(helper.send(:action_default_value, :my_thing, :custom_action))
|
129
129
|
end
|
130
130
|
end
|
131
|
+
|
132
|
+
describe '#nav_link' do
|
133
|
+
it 'renders a bootstrap nav link' do
|
134
|
+
rendered = Capybara.string(helper.nav_link('Some link', root_url))
|
135
|
+
expect(rendered).to have_css('li').and(have_link('Some link', href: root_url))
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'renders a bootstrap nav link using the block style' do
|
139
|
+
rendered = Capybara.string(helper.nav_link(root_url) { 'Some link' })
|
140
|
+
expect(rendered).to have_css('li').and(have_link('Some link', href: root_url))
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'adds an active class if it is the current page' do
|
144
|
+
allow(helper).to receive(:current_page?).with(root_url).and_return(true)
|
145
|
+
|
146
|
+
rendered = Capybara.string(helper.nav_link('Some link', root_url))
|
147
|
+
expect(rendered).to have_css('.nav-link.active')
|
148
|
+
end
|
149
|
+
end
|
131
150
|
end
|
@@ -86,7 +86,7 @@ describe Spotlight::Controller do
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
describe '#
|
89
|
+
describe '#exhibit_search_facet_path' do
|
90
90
|
let(:exhibit) { FactoryBot.create(:exhibit) }
|
91
91
|
let(:params) { { action: 'index', q: 'xyz' } }
|
92
92
|
|
@@ -96,7 +96,7 @@ describe Spotlight::Controller do
|
|
96
96
|
|
97
97
|
it 'adds the current exhibit context to the route' do
|
98
98
|
expect(subject.spotlight).to receive(:facet_exhibit_catalog_url).with(exhibit, id: 'some_field', q: 'xyz')
|
99
|
-
subject.
|
99
|
+
subject.exhibit_search_facet_path(id: 'some_field')
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
@@ -17,4 +17,42 @@ describe SirTrevorRails::Blocks::SolrDocumentsBlock do
|
|
17
17
|
expect(subject.text).to be_blank
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
describe '#primary_caption?' do
|
22
|
+
it 'is false if the primary caption field is not configured' do
|
23
|
+
block_data['show-primary-caption'] = 'true'
|
24
|
+
expect(subject.primary_caption?).to eq false
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'is false if the field is configured not to show' do
|
28
|
+
block_data['primary-caption-field'] = 'some_field'
|
29
|
+
block_data['show-primary-caption'] = 'false'
|
30
|
+
expect(subject.primary_caption?).to eq false
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'is true if the field is configured to show' do
|
34
|
+
block_data['primary-caption-field'] = 'some_field'
|
35
|
+
block_data['show-primary-caption'] = 'true'
|
36
|
+
expect(subject.primary_caption?).to eq true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#secondary_caption?' do
|
41
|
+
it 'is false if the secondary caption field is not configured' do
|
42
|
+
block_data['show-secondary-caption'] = 'true'
|
43
|
+
expect(subject.secondary_caption?).to eq false
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'is false if the field is configured not to show' do
|
47
|
+
block_data['secondary-caption-field'] = 'some_field'
|
48
|
+
block_data['show-secondary-caption'] = 'false'
|
49
|
+
expect(subject.secondary_caption?).to eq false
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'is true if the field is configured to show' do
|
53
|
+
block_data['secondary-caption-field'] = 'some_field'
|
54
|
+
block_data['show-secondary-caption'] = 'true'
|
55
|
+
expect(subject.secondary_caption?).to eq true
|
56
|
+
end
|
57
|
+
end
|
20
58
|
end
|
@@ -17,19 +17,20 @@ describe Spotlight::AccessControlsEnforcementSearchBuilder do
|
|
17
17
|
|
18
18
|
subject { MockSearchBuilder.new blacklight_params, scope }
|
19
19
|
let(:exhibit) { FactoryBot.create(:exhibit) }
|
20
|
-
let(:scope) { double(current_exhibit: exhibit) }
|
20
|
+
let(:scope) { double(current_exhibit: exhibit, context: { current_ability: current_ability }) }
|
21
|
+
let(:current_ability) { instance_double(Ability) }
|
21
22
|
let(:solr_request) { Blacklight::Solr::Request.new }
|
22
23
|
let(:blacklight_params) { Hash.new }
|
23
24
|
|
24
25
|
describe '#apply_permissive_visibility_filter' do
|
25
26
|
it 'allows curators to view everything' do
|
26
|
-
allow(
|
27
|
+
allow(current_ability).to receive(:can?).and_return(true)
|
27
28
|
subject.apply_permissive_visibility_filter(solr_request)
|
28
29
|
expect(solr_request.to_hash).to be_empty
|
29
30
|
end
|
30
31
|
|
31
32
|
it 'restricts searches to public items' do
|
32
|
-
allow(
|
33
|
+
allow(current_ability).to receive(:can?).and_return(false)
|
33
34
|
|
34
35
|
subject.apply_permissive_visibility_filter(solr_request)
|
35
36
|
expect(solr_request).to include :fq
|
@@ -37,7 +38,7 @@ describe Spotlight::AccessControlsEnforcementSearchBuilder do
|
|
37
38
|
end
|
38
39
|
|
39
40
|
it 'does not filter resources to just those created by the exhibit' do
|
40
|
-
allow(
|
41
|
+
allow(current_ability).to receive(:can?).and_return(true)
|
41
42
|
subject.apply_permissive_visibility_filter(solr_request)
|
42
43
|
expect(solr_request).to include :fq
|
43
44
|
expect(solr_request[:fq]).not_to include "{!term f=spotlight_exhibit_slug_#{exhibit.slug}_bsi}true"
|
@@ -51,7 +52,7 @@ describe Spotlight::AccessControlsEnforcementSearchBuilder do
|
|
51
52
|
end
|
52
53
|
|
53
54
|
it 'filters resources to just those created by the exhibit' do
|
54
|
-
allow(
|
55
|
+
allow(current_ability).to receive(:can?).and_return(true)
|
55
56
|
|
56
57
|
subject.apply_exhibit_resources_filter(solr_request)
|
57
58
|
|
@@ -68,7 +69,7 @@ describe Spotlight::AccessControlsEnforcementSearchBuilder do
|
|
68
69
|
end
|
69
70
|
|
70
71
|
it 'filters resources to just those identified by the exhibit filter' do
|
71
|
-
allow(
|
72
|
+
allow(current_ability).to receive(:can?).and_return(true)
|
72
73
|
|
73
74
|
subject.apply_exhibit_resources_filter(solr_request)
|
74
75
|
|
@@ -2,6 +2,21 @@
|
|
2
2
|
|
3
3
|
describe Spotlight::Analytics::Ga do
|
4
4
|
it 'does not be enabled without configuration' do
|
5
|
-
expect(
|
5
|
+
expect(subject.enabled?).to be_falsey
|
6
|
+
end
|
7
|
+
|
8
|
+
describe '#site' do
|
9
|
+
it 'selects the correct profile based on the web property id' do
|
10
|
+
allow(Spotlight::Engine.config).to receive_messages(ga_web_property_id: 'bar')
|
11
|
+
allow(subject).to receive_message_chain(
|
12
|
+
:user,
|
13
|
+
:accounts,
|
14
|
+
:first,
|
15
|
+
profiles: [
|
16
|
+
double('profile1', web_property_id: 'foo'), double('profile2', web_property_id: 'bar')
|
17
|
+
]
|
18
|
+
)
|
19
|
+
expect(subject.site.web_property_id).to eq 'bar'
|
20
|
+
end
|
6
21
|
end
|
7
22
|
end
|
@@ -1,10 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
describe Spotlight::ContactForm do
|
4
|
-
subject { described_class.new(name: 'Root', email: 'user@example.com')
|
4
|
+
subject { described_class.new(name: 'Root', email: 'user@example.com') }
|
5
5
|
let(:exhibit) { FactoryBot.build_stubbed(:exhibit) }
|
6
6
|
let(:honeypot_field_name) { Spotlight::Engine.config.spambot_honeypot_email_field }
|
7
7
|
|
8
|
+
describe 'the email subject' do
|
9
|
+
it 'has a subject' do
|
10
|
+
expect(subject.headers[:subject]).to eq 'Blacklight exhibit feedback'
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'with a current exhibit' do
|
14
|
+
before do
|
15
|
+
subject.current_exhibit = exhibit
|
16
|
+
exhibit.title = 'My exhibit'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'uses the site title in the email' do
|
20
|
+
expect(subject.headers[:subject]).to eq 'My exhibit exhibit feedback'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'with a site title' do
|
25
|
+
before do
|
26
|
+
Spotlight::Site.instance.update(title: 'Exhibits')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'uses the site title in the email' do
|
30
|
+
expect(subject.headers[:subject]).to eq 'Exhibits exhibit feedback'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
8
35
|
context 'with a site-wide contact email' do
|
9
36
|
before { allow(Spotlight::Engine.config).to receive_messages default_contact_email: 'root@localhost' }
|
10
37
|
|
@@ -13,7 +40,10 @@ describe Spotlight::ContactForm do
|
|
13
40
|
end
|
14
41
|
|
15
42
|
context 'with exhibit-specific contacts' do
|
16
|
-
before
|
43
|
+
before do
|
44
|
+
subject.current_exhibit = exhibit
|
45
|
+
exhibit.contact_emails.create(email: 'curator@example.com', confirmed_at: Time.zone.now)
|
46
|
+
end
|
17
47
|
|
18
48
|
it 'appends exhibit-specific contacts as cc recipients' do
|
19
49
|
expect(subject.headers[:cc]).to eq 'curator@example.com'
|
@@ -22,9 +52,11 @@ describe Spotlight::ContactForm do
|
|
22
52
|
end
|
23
53
|
|
24
54
|
context 'with exhibit-specific contacts' do
|
25
|
-
before
|
26
|
-
|
27
|
-
|
55
|
+
before do
|
56
|
+
subject.current_exhibit = exhibit
|
57
|
+
exhibit.contact_emails.create(email: 'curator@example.com', confirmed_at: Time.zone.now)
|
58
|
+
exhibit.contact_emails.create(email: 'addl_curator@example.com', confirmed_at: Time.zone.now)
|
59
|
+
end
|
28
60
|
|
29
61
|
it 'sends the email to the first contact' do
|
30
62
|
expect(subject.headers[:to]).to eq 'curator@example.com'
|
@@ -186,10 +186,12 @@ describe Spotlight::Exhibit, type: :model do
|
|
186
186
|
describe '#analytics' do
|
187
187
|
subject { FactoryBot.create(:exhibit) }
|
188
188
|
let(:ga_data) { OpenStruct.new(pageviews: 123) }
|
189
|
+
let(:mock_analytics) { double(Spotlight::Analytics::Ga) }
|
189
190
|
|
190
191
|
before do
|
191
|
-
allow(Spotlight::Analytics::Ga).to receive(:
|
192
|
-
allow(
|
192
|
+
allow(Spotlight::Analytics::Ga).to receive(:new).and_return(mock_analytics)
|
193
|
+
allow(mock_analytics).to receive(:enabled?).and_return(true)
|
194
|
+
allow(mock_analytics).to receive(:exhibit_data).with(subject, hash_including(:start_date)).and_return(ga_data)
|
193
195
|
end
|
194
196
|
|
195
197
|
it 'requests analytics data' do
|
@@ -200,10 +202,12 @@ describe Spotlight::Exhibit, type: :model do
|
|
200
202
|
describe '#page_analytics' do
|
201
203
|
subject { FactoryBot.create(:exhibit) }
|
202
204
|
let(:ga_data) { [OpenStruct.new(pageviews: 123)] }
|
205
|
+
let(:mock_analytics) { double(Spotlight::Analytics::Ga) }
|
203
206
|
|
204
207
|
before do
|
205
|
-
allow(Spotlight::Analytics::Ga).to receive(:
|
206
|
-
allow(
|
208
|
+
allow(Spotlight::Analytics::Ga).to receive(:new).and_return(mock_analytics)
|
209
|
+
allow(mock_analytics).to receive(:enabled?).and_return(true)
|
210
|
+
allow(mock_analytics).to receive(:page_data).with(subject, hash_including(:start_date)).and_return(ga_data)
|
207
211
|
end
|
208
212
|
|
209
213
|
it 'requests analytics data' do
|
@@ -16,6 +16,9 @@ describe Spotlight::IiifManifestPresenter do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
describe 'public methods' do
|
19
|
+
let(:helpers) { double(show_presenter: presenter) }
|
20
|
+
let(:presenter) { instance_double(Blacklight::ShowPresenter, heading: title_field_value) }
|
21
|
+
|
19
22
|
let(:iiif_url) { 'https://iiif.test/images/1-1' }
|
20
23
|
let(:endpoint) { IIIFManifest::IIIFEndpoint.new(iiif_url, profile: profile_url) }
|
21
24
|
let(:manifest_url) { 'https://iiif.test/spotlight/test/catalog/1-1/manifest' }
|
@@ -43,6 +46,7 @@ describe Spotlight::IiifManifestPresenter do
|
|
43
46
|
|
44
47
|
allow(subject).to receive(:endpoint).and_return(endpoint)
|
45
48
|
allow(subject).to receive(:id).and_return(id)
|
49
|
+
allow(controller).to receive(:view_context).and_return(helpers)
|
46
50
|
end
|
47
51
|
|
48
52
|
describe '#display_image' do
|