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.
Files changed (282) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/blacklight/add_circle.svg +1 -0
  3. data/app/assets/images/blacklight/arrow_back_ios.svg +1 -0
  4. data/app/assets/images/blacklight/arrow_forward_ios.svg +1 -0
  5. data/app/assets/images/blacklight/check.svg +1 -0
  6. data/app/assets/images/blacklight/check_circle.svg +1 -0
  7. data/app/assets/images/blacklight/chevron_right.svg +1 -0
  8. data/app/assets/images/blacklight/custom_fullscreen.svg +1 -0
  9. data/app/assets/images/blacklight/edit.svg +1 -0
  10. data/app/assets/images/blacklight/error.svg +1 -0
  11. data/app/assets/images/blacklight/info.svg +1 -0
  12. data/app/assets/images/blacklight/remove_circle.svg +1 -0
  13. data/app/assets/images/blacklight/remove_circle_outline.svg +1 -0
  14. data/app/assets/images/blacklight/resize_small.svg +1 -0
  15. data/app/assets/images/blacklight/warning.svg +1 -0
  16. data/app/assets/javascripts/spotlight/admin/block_mixins/autocompleteable.js +1 -1
  17. data/app/assets/javascripts/spotlight/admin/block_mixins/plustextable.js +2 -2
  18. data/app/assets/javascripts/spotlight/admin/blocks/browse_block.js +1 -1
  19. data/app/assets/javascripts/spotlight/admin/blocks/pages_block.js +1 -1
  20. data/app/assets/javascripts/spotlight/admin/blocks/resources_block.js +7 -7
  21. data/app/assets/javascripts/spotlight/admin/blocks/solr_documents_base_block.js +3 -3
  22. data/app/assets/javascripts/spotlight/admin/blocks/uploaded_items_block.js +7 -7
  23. data/app/assets/javascripts/spotlight/admin/catalog_edit.js +2 -2
  24. data/app/assets/javascripts/spotlight/admin/multi_image_selector.js +2 -2
  25. data/app/assets/javascripts/spotlight/admin/reindex_monitor.js +1 -1
  26. data/app/assets/javascripts/spotlight/admin/search_typeahead.js +2 -2
  27. data/app/assets/javascripts/spotlight/admin/sir-trevor/block_controls.js +1 -1
  28. data/app/assets/javascripts/spotlight/admin/users.js +1 -1
  29. data/app/assets/javascripts/spotlight/user/index.js +1 -0
  30. data/app/assets/javascripts/spotlight/user/zpr_links.js.erb +6 -6
  31. data/app/assets/stylesheets/spotlight/_blacklight_configuration.scss +44 -4
  32. data/app/assets/stylesheets/spotlight/_blacklight_overrides.scss +4 -8
  33. data/app/assets/stylesheets/spotlight/_bootstrap_overrides.scss +31 -14
  34. data/app/assets/stylesheets/spotlight/_browse.scss +16 -13
  35. data/app/assets/stylesheets/spotlight/_catalog.scss +13 -7
  36. data/app/assets/stylesheets/spotlight/_collapse_toggle.scss +10 -14
  37. data/app/assets/stylesheets/spotlight/_curation.scss +34 -32
  38. data/app/assets/stylesheets/spotlight/_exhibit_admin.scss +4 -29
  39. data/app/assets/stylesheets/spotlight/_exhibits_index.scss +16 -14
  40. data/app/assets/stylesheets/spotlight/_featured_browse_categories_block.scss +22 -20
  41. data/app/assets/stylesheets/spotlight/_footer.scss +2 -2
  42. data/app/assets/stylesheets/spotlight/_header.scss +18 -39
  43. data/app/assets/stylesheets/spotlight/_item_text_block.scss +1 -24
  44. data/app/assets/stylesheets/spotlight/_mixins.scss +3 -8
  45. data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +1 -1
  46. data/app/assets/stylesheets/spotlight/_nestable.scss +1 -2
  47. data/app/assets/stylesheets/spotlight/_pages.scss +33 -54
  48. data/app/assets/stylesheets/spotlight/_report_a_problem.scss +7 -1
  49. data/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss +9 -9
  50. data/app/assets/stylesheets/spotlight/_slideshow_block.scss +13 -11
  51. data/app/assets/stylesheets/spotlight/_spotlight.scss +0 -1
  52. data/app/assets/stylesheets/spotlight/_translations.scss +12 -12
  53. data/app/assets/stylesheets/spotlight/_variables.scss +14 -15
  54. data/app/assets/stylesheets/spotlight/_variables_bootstrap.scss +7 -7
  55. data/app/assets/stylesheets/spotlight/typeahead.css +1 -1
  56. data/app/builders/spotlight/bootstrap_breadcrumbs_builder.rb +3 -2
  57. data/app/controllers/concerns/spotlight/catalog.rb +1 -1
  58. data/app/controllers/concerns/spotlight/controller.rb +3 -3
  59. data/app/controllers/concerns/spotlight/search_helper.rb +23 -0
  60. data/app/controllers/spotlight/browse_controller.rb +18 -4
  61. data/app/controllers/spotlight/catalog_controller.rb +13 -17
  62. data/app/controllers/spotlight/dashboards_controller.rb +5 -1
  63. data/app/controllers/spotlight/exhibits_controller.rb +1 -1
  64. data/app/controllers/spotlight/home_pages_controller.rb +32 -3
  65. data/app/controllers/spotlight/pages_controller.rb +19 -1
  66. data/app/controllers/spotlight/search_configurations_controller.rb +3 -3
  67. data/app/controllers/spotlight/searches_controller.rb +4 -1
  68. data/app/controllers/spotlight/solr_controller.rb +1 -2
  69. data/app/helpers/spotlight/application_helper.rb +1 -1
  70. data/app/helpers/spotlight/browse_helper.rb +1 -1
  71. data/app/helpers/spotlight/crud_link_helpers.rb +19 -0
  72. data/app/helpers/spotlight/pages_helper.rb +1 -1
  73. data/app/mailers/spotlight/contact_mailer.rb +1 -1
  74. data/app/models/concerns/spotlight/access_controls_enforcement_search_builder.rb +2 -2
  75. data/app/models/concerns/spotlight/exhibit_analytics.rb +1 -3
  76. data/app/models/concerns/spotlight/exhibit_documents.rb +1 -1
  77. data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +11 -3
  78. data/app/models/spotlight/ability.rb +1 -1
  79. data/app/models/spotlight/analytics/ga.rb +25 -35
  80. data/app/models/spotlight/analytics/ga_model.rb +29 -0
  81. data/app/models/spotlight/blacklight_configuration.rb +5 -3
  82. data/app/models/spotlight/contact_form.rb +11 -4
  83. data/app/models/spotlight/exhibit.rb +0 -4
  84. data/app/models/spotlight/field_metadata.rb +3 -9
  85. data/app/models/spotlight/page.rb +0 -3
  86. data/app/models/spotlight/page_configurations.rb +1 -1
  87. data/app/models/spotlight/role.rb +0 -4
  88. data/app/models/spotlight/search.rb +3 -17
  89. data/app/presenters/spotlight/iiif_manifest_presenter.rb +5 -1
  90. data/app/serializers/spotlight/exhibit_export_serializer.rb +69 -28
  91. data/app/serializers/spotlight/page_representer.rb +1 -1
  92. data/app/views/catalog/_save_search.html.erb +6 -4
  93. data/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
  94. data/app/views/layouts/spotlight/base.html.erb +48 -0
  95. data/app/views/layouts/spotlight/spotlight.html.erb +16 -54
  96. data/app/views/shared/_about_navbar.html.erb +2 -2
  97. data/app/views/shared/_browse_navbar.html.erb +2 -2
  98. data/app/views/shared/_curated_features_navbar.html.erb +4 -4
  99. data/app/views/shared/_exhibit_navbar.html.erb +5 -5
  100. data/app/views/shared/_header_navbar.html.erb +8 -13
  101. data/app/views/shared/_masthead.html.erb +1 -1
  102. data/app/views/shared/_site_sidebar.html.erb +6 -6
  103. data/app/views/shared/_user_util_links.html.erb +47 -0
  104. data/app/views/spotlight/about_pages/_contact.html.erb +3 -4
  105. data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
  106. data/app/views/spotlight/about_pages/_sidebar.html.erb +3 -5
  107. data/app/views/spotlight/about_pages/index.html.erb +7 -6
  108. data/app/views/spotlight/admin_users/index.html.erb +78 -79
  109. data/app/views/spotlight/appearances/edit.html.erb +26 -23
  110. data/app/views/spotlight/browse/_search.html.erb +2 -2
  111. data/app/views/spotlight/browse/_search_box.html.erb +9 -6
  112. data/app/views/spotlight/browse/_search_title.html.erb +1 -1
  113. data/app/views/spotlight/browse/_sort_and_per_page.html.erb +3 -5
  114. data/app/views/spotlight/browse/index.html.erb +4 -6
  115. data/app/views/spotlight/browse/show.html.erb +1 -1
  116. data/app/views/spotlight/catalog/_admin_header.html.erb +2 -2
  117. data/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb +1 -1
  118. data/app/views/spotlight/catalog/_document_admin_table.html.erb +4 -4
  119. data/app/views/spotlight/catalog/_edit_sidecar.html.erb +1 -1
  120. data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -2
  121. data/app/views/spotlight/catalog/_reindex_progress_panel.html.erb +3 -5
  122. data/app/views/spotlight/catalog/admin.html.erb +12 -12
  123. data/app/views/spotlight/contact_forms/new.html.erb +1 -3
  124. data/app/views/spotlight/contacts/edit.html.erb +6 -5
  125. data/app/views/spotlight/contacts/new.html.erb +6 -5
  126. data/app/views/spotlight/custom_fields/edit.html.erb +6 -5
  127. data/app/views/spotlight/custom_fields/new.html.erb +6 -5
  128. data/app/views/spotlight/dashboards/_analytics.html.erb +3 -3
  129. data/app/views/spotlight/dashboards/_page.html.erb +6 -6
  130. data/app/views/spotlight/dashboards/_page_activity.html.erb +5 -5
  131. data/app/views/spotlight/dashboards/_reindexing_activity.html.erb +12 -12
  132. data/app/views/spotlight/dashboards/analytics.html.erb +11 -11
  133. data/app/views/spotlight/dashboards/show.html.erb +13 -13
  134. data/app/views/spotlight/exhibits/_confirmation_status.html.erb +3 -4
  135. data/app/views/spotlight/exhibits/_contact.html.erb +3 -3
  136. data/app/views/spotlight/exhibits/_delete.html.erb +7 -5
  137. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +2 -2
  138. data/app/views/spotlight/exhibits/_exhibit_card_front.html.erb +2 -2
  139. data/app/views/spotlight/exhibits/_form.html.erb +5 -5
  140. data/app/views/spotlight/exhibits/_languages.html.erb +2 -2
  141. data/app/views/spotlight/exhibits/_new_exhibit_form.html.erb +0 -2
  142. data/app/views/spotlight/exhibits/edit.html.erb +43 -42
  143. data/app/views/spotlight/exhibits/index.html.erb +40 -41
  144. data/app/views/spotlight/exhibits/new.html.erb +4 -5
  145. data/app/views/spotlight/feature_pages/_header.html.erb +12 -14
  146. data/app/views/spotlight/feature_pages/_sidebar.html.erb +2 -4
  147. data/app/views/spotlight/featured_images/_form.html.erb +4 -4
  148. data/app/views/spotlight/filters/_form.html.erb +1 -1
  149. data/app/views/spotlight/home_pages/_edit_page_link.html.erb +1 -1
  150. data/app/views/spotlight/home_pages/_sidebar.html.erb +1 -3
  151. data/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +4 -4
  152. data/app/views/spotlight/metadata_configurations/edit.html.erb +5 -4
  153. data/app/views/spotlight/pages/_edit_page_link.html.erb +1 -1
  154. data/app/views/spotlight/pages/_form.html.erb +7 -7
  155. data/app/views/spotlight/pages/_order_pages.html.erb +2 -2
  156. data/app/views/spotlight/pages/_page.html.erb +11 -11
  157. data/app/views/spotlight/pages/_view_type_group.html.erb +1 -1
  158. data/app/views/spotlight/pages/edit.html.erb +2 -4
  159. data/app/views/spotlight/pages/index.html.erb +5 -4
  160. data/app/views/spotlight/pages/show.html.erb +5 -4
  161. data/app/views/spotlight/resources/_external_resources_form.html.erb +2 -2
  162. data/app/views/spotlight/resources/_form.html.erb +1 -1
  163. data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
  164. data/app/views/spotlight/resources/iiif/_form.html.erb +1 -1
  165. data/app/views/spotlight/resources/json_upload/_form.html.erb +1 -1
  166. data/app/views/spotlight/resources/new.html.erb +25 -23
  167. data/app/views/spotlight/resources/upload/_form.html.erb +2 -2
  168. data/app/views/spotlight/roles/index.html.erb +60 -57
  169. data/app/views/spotlight/search_configurations/_facet_metadata.html.erb +3 -1
  170. data/app/views/spotlight/search_configurations/_facets.html.erb +19 -18
  171. data/app/views/spotlight/search_configurations/_search_fields.html.erb +6 -6
  172. data/app/views/spotlight/search_configurations/_sort.html.erb +6 -6
  173. data/app/views/spotlight/search_configurations/edit.html.erb +42 -40
  174. data/app/views/spotlight/searches/_form.html.erb +15 -10
  175. data/app/views/spotlight/searches/_search.html.erb +29 -22
  176. data/app/views/spotlight/searches/edit.html.erb +6 -5
  177. data/app/views/spotlight/searches/index.html.erb +32 -31
  178. data/app/views/spotlight/shared/_configuration_sidebar.html.erb +6 -6
  179. data/app/views/spotlight/shared/_curation_sidebar.html.erb +8 -9
  180. data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +6 -8
  181. data/app/views/spotlight/shared/_locale_picker.html.erb +3 -3
  182. data/app/views/spotlight/shared/_report_a_problem.html.erb +2 -2
  183. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
  184. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  185. data/app/views/spotlight/sir_trevor/blocks/_oembed_block.html.erb +2 -2
  186. data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +2 -2
  187. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +8 -8
  188. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +8 -8
  189. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb +3 -4
  190. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +32 -31
  191. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +5 -5
  192. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +8 -10
  193. data/app/views/spotlight/sites/edit.html.erb +31 -34
  194. data/app/views/spotlight/sites/edit_exhibits.html.erb +28 -29
  195. data/app/views/spotlight/tags/index.html.erb +25 -24
  196. data/app/views/spotlight/translations/_browse_categories.html.erb +20 -15
  197. data/app/views/spotlight/translations/_general.html.erb +69 -91
  198. data/app/views/spotlight/translations/_metadata.html.erb +18 -14
  199. data/app/views/spotlight/translations/_page.html.erb +2 -2
  200. data/app/views/spotlight/translations/_search_fields.html.erb +26 -20
  201. data/app/views/spotlight/translations/edit.html.erb +16 -14
  202. data/config/locales/spotlight.en.yml +3 -0
  203. data/config/routes.rb +1 -1
  204. data/lib/generators/spotlight/install_generator.rb +2 -2
  205. data/lib/generators/spotlight/scaffold_resource_generator.rb +1 -1
  206. data/lib/generators/spotlight/templates/spotlight.scss +0 -1
  207. data/lib/spotlight/engine.rb +12 -0
  208. data/lib/spotlight/version.rb +1 -1
  209. data/spec/controllers/application_controller_spec.rb +2 -2
  210. data/spec/controllers/spotlight/browse_controller_spec.rb +1 -1
  211. data/spec/controllers/spotlight/catalog_controller_spec.rb +13 -13
  212. data/spec/controllers/spotlight/dashboards_controller_spec.rb +2 -1
  213. data/spec/controllers/spotlight/search_configurations_controller_spec.rb +1 -1
  214. data/spec/examples.txt +50 -1489
  215. data/spec/features/add_items_spec.rb +2 -2
  216. data/spec/features/browse_category_admin_spec.rb +3 -3
  217. data/spec/features/browse_category_spec.rb +3 -3
  218. data/spec/features/catalog_spec.rb +1 -1
  219. data/spec/features/exhibits/translation_editing_spec.rb +21 -21
  220. data/spec/features/feature_page_spec.rb +1 -1
  221. data/spec/features/home_page_spec.rb +3 -3
  222. data/spec/features/javascript/blocks/featured_browse_categories_block_spec.rb +1 -1
  223. data/spec/features/javascript/blocks/link_to_search_block_spec.rb +1 -1
  224. data/spec/features/javascript/blocks/search_result_block_spec.rb +9 -4
  225. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +23 -15
  226. data/spec/features/javascript/blocks/solr_documents_carousel_block_spec.rb +29 -0
  227. data/spec/features/javascript/blocks/uploaded_items_block_spec.rb +2 -2
  228. data/spec/features/javascript/edit_in_place_spec.rb +1 -0
  229. data/spec/features/javascript/feature_page_admin_spec.rb +11 -11
  230. data/spec/features/javascript/locale_selector_spec.rb +0 -1
  231. data/spec/features/javascript/multi_image_select_spec.rb +3 -3
  232. data/spec/features/javascript/reindex_monitor_spec.rb +2 -2
  233. data/spec/features/javascript/roles_admin_spec.rb +2 -2
  234. data/spec/features/javascript/search_context_spec.rb +4 -6
  235. data/spec/features/site_users_management_spec.rb +1 -1
  236. data/spec/helpers/spotlight/application_helper_spec.rb +2 -1
  237. data/spec/helpers/spotlight/crud_link_helpers_spec.rb +19 -0
  238. data/spec/helpers/spotlight/languages_helper_spec.rb +1 -0
  239. data/spec/lib/spotlight/controller_spec.rb +2 -2
  240. data/spec/models/sir_trevor_rails/blocks/solr_documents_block_spec.rb +38 -0
  241. data/spec/models/spotlight/access_controls_enforcement_search_builder_spec.rb +7 -6
  242. data/spec/models/spotlight/analytics/ga_spec.rb +16 -1
  243. data/spec/models/spotlight/contact_form_spec.rb +37 -5
  244. data/spec/models/spotlight/exhibit_spec.rb +8 -4
  245. data/spec/presenters/spotlight/iiif_manifest_presenter_spec.rb +4 -0
  246. data/spec/routing/spotlight/exhibit_catalog_spec.rb +15 -11
  247. data/spec/serializers/spotlight/exhibit_export_serializer_spec.rb +60 -0
  248. data/spec/test_app_templates/Gemfile.extra +3 -0
  249. data/spec/test_app_templates/catalog_controller.rb +4 -0
  250. data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -2
  251. data/spec/views/shared/_header_navbar.html.erb_spec.rb +1 -1
  252. data/spec/views/shared/_masthead.html.erb_spec.rb +1 -1
  253. data/spec/views/{_user_util_links.html.erb_spec.rb → shared/_user_util_links.html.erb_spec.rb} +1 -1
  254. data/spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb +2 -2
  255. data/spec/views/spotlight/about_pages/index.html.erb_spec.rb +2 -2
  256. data/spec/views/spotlight/browse/_search.html.erb_spec.rb +1 -1
  257. data/spec/views/spotlight/browse/_sort_and_per_page.html.erb_spec.rb +2 -13
  258. data/spec/views/spotlight/browse/show.html.erb_spec.rb +2 -2
  259. data/spec/views/spotlight/catalog/admin.html.erb_spec.rb +1 -1
  260. data/spec/views/spotlight/dashboards/_reindexing_activity.html.erb_spec.rb +5 -5
  261. data/spec/views/spotlight/dashboards/analytics.html.erb_spec.rb +1 -1
  262. data/spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb +2 -2
  263. data/spec/views/spotlight/exhibits/edit.html.erb_spec.rb +1 -1
  264. data/spec/views/spotlight/exhibits/index.html.erb_spec.rb +1 -1
  265. data/spec/views/spotlight/feature_pages/_sidebar.html.erb_spec.rb +7 -7
  266. data/spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb +3 -2
  267. data/spec/views/spotlight/metadata_configurations/edit.html.erb_spec.rb +2 -1
  268. data/spec/views/spotlight/pages/index.html.erb_spec.rb +2 -2
  269. data/spec/views/spotlight/pages/show.html.erb_spec.rb +3 -3
  270. data/spec/views/spotlight/searches/_search.html.erb_spec.rb +1 -1
  271. data/spec/views/spotlight/searches/edit.html.erb_spec.rb +3 -3
  272. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb_spec.rb +3 -3
  273. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb +1 -1
  274. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb_spec.rb +2 -2
  275. data/spec/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb_spec.rb +1 -1
  276. data/spec/views/spotlight/translations/_page.html.erb_spec.rb +2 -2
  277. data/vendor/assets/javascripts/bootstrap-tagsinput.js +1 -1
  278. data/vendor/assets/stylesheets/sir-trevor/_variables.scss +15 -8
  279. metadata +31 -28
  280. data/app/assets/stylesheets/spotlight/_navbar.scss +0 -48
  281. data/app/views/_user_util_links.html.erb +0 -50
  282. data/app/views/shared/_modal.html.erb +0 -6
@@ -4,17 +4,6 @@ RSpec.describe 'Catalog controller', type: :routing do
4
4
  describe 'routing' do
5
5
  routes { Spotlight::Engine.routes }
6
6
 
7
- context 'when the routing constraint is set to allow periods' do
8
- before do
9
- allow(Blacklight::Engine.config.routes).to receive(:identifier_constraint).and_return(%r{[^/]+})
10
- Rails.application.reload_routes!
11
- end
12
-
13
- it 'routes to #show' do
14
- expect(get('/1/catalog/gallica.bnf.fr')).to route_to('spotlight/catalog#show', exhibit_id: '1', id: 'gallica.bnf.fr')
15
- end
16
- end
17
-
18
7
  it 'routes to #show with a format' do
19
8
  expect(get('/1/catalog/dq287tq6352.xml')).to route_to('spotlight/catalog#show', exhibit_id: '1', id: 'dq287tq6352', format: 'xml')
20
9
  end
@@ -26,5 +15,20 @@ RSpec.describe 'Catalog controller', type: :routing do
26
15
  it 'routes to #manifest' do
27
16
  expect(get('/1/catalog/1-1/manifest.json')).to route_to('spotlight/catalog#manifest', exhibit_id: '1', id: '1-1', format: 'json')
28
17
  end
18
+
19
+ context 'when the routing constraint is set to allow periods' do
20
+ before do
21
+ allow(Spotlight::Engine.config.routes).to receive(:solr_documents).and_return(constraints: { id: %r{[^/]+} })
22
+ Rails.application.reload_routes!
23
+ end
24
+
25
+ after do
26
+ Rails.application.reload_routes!
27
+ end
28
+
29
+ it 'routes to #show as expected' do
30
+ expect(get('/1/catalog/gallica.bnf.fr')).to route_to('spotlight/catalog#show', exhibit_id: '1', id: 'gallica.bnf.fr')
31
+ end
32
+ end
29
33
  end
30
34
  end
@@ -64,6 +64,14 @@ describe Spotlight::ExhibitExportSerializer do
64
64
  expect(subject['attachments']).to have(source_exhibit.attachments.count).items
65
65
  end
66
66
 
67
+ it 'has languages' do
68
+ expect(subject['languages']).to have(source_exhibit.languages.count).items
69
+ end
70
+
71
+ it 'has translations' do
72
+ expect(subject['translations']).to have(source_exhibit.translations.count).items
73
+ end
74
+
67
75
  it 'has resources' do
68
76
  expect(subject['resources']).to have(source_exhibit.resources.count).items
69
77
  end
@@ -149,6 +157,30 @@ describe Spotlight::ExhibitExportSerializer do
149
157
  end
150
158
  end
151
159
 
160
+ context 'for exhibits with languages and translations' do
161
+ let!(:language) do
162
+ source_exhibit.languages.create!(locale: 'zz', public: true, text: 'abc')
163
+ end
164
+
165
+ let!(:translation) do
166
+ source_exhibit.translations.create!(locale: 'zz', key: 'abc', value: '123')
167
+ end
168
+
169
+ it 'has the language' do
170
+ expect(subject.languages.count).to eq 1
171
+
172
+ language = subject.languages.first
173
+ expect(language).to have_attributes(locale: 'zz', public: true, text: 'abc')
174
+ end
175
+
176
+ it 'has translations' do
177
+ expect(subject.translations.count).to eq 1
178
+
179
+ translation = subject.translations.unscope(where: :locale).first
180
+ expect(translation).to have_attributes(locale: 'zz', key: 'abc', value: '123')
181
+ end
182
+ end
183
+
152
184
  it 'has tags' do
153
185
  expect(subject.owned_taggings.length).to eq source_exhibit.owned_taggings.length
154
186
  expect(subject.owned_taggings.first).to be_persisted
@@ -360,4 +392,32 @@ describe Spotlight::ExhibitExportSerializer do
360
392
  end
361
393
  end
362
394
  end
395
+
396
+ context 'with engine configuration disabling all export types' do
397
+ let(:exports) do
398
+ {}
399
+ end
400
+
401
+ before do
402
+ allow(Spotlight::Engine.config).to receive(:exports).and_return(exports)
403
+ end
404
+
405
+ it 'includes nothing' do
406
+ expect(subject).to be_blank
407
+ end
408
+ end
409
+
410
+ context 'with engine configuration enabling only pages' do
411
+ let(:exports) do
412
+ { pages: true }
413
+ end
414
+
415
+ before do
416
+ allow(Spotlight::Engine.config).to receive(:exports).and_return(exports)
417
+ end
418
+
419
+ it 'includes only the page-related data' do
420
+ expect(subject.keys).to match_array %w[searches about_pages feature_pages home_page contacts]
421
+ end
422
+ end
363
423
  end
@@ -1 +1,4 @@
1
1
  gem 'thor', '~> 0.20'
2
+ gem 'blacklight', '~> 7.0'
3
+ gem 'blacklight-oembed', '>= 0.1', github: 'sul-dlss/blacklight-oembed'
4
+ gem 'sprockets', '< 4'
@@ -35,6 +35,10 @@ class CatalogController < ApplicationController
35
35
  config.show.tile_source_field = :content_metadata_image_iiif_info_ssm
36
36
  config.show.partials.insert(1, :openseadragon)
37
37
 
38
+ config.add_results_collection_tool(:sort_widget)
39
+ config.add_results_collection_tool(:per_page_widget)
40
+ config.add_results_collection_tool(:view_type_group)
41
+
38
42
  # solr fields that will be treated as facets by the blacklight application
39
43
  # The ordering of the field names is the order of the display
40
44
  #
@@ -10,8 +10,8 @@ class TestAppGenerator < Rails::Generators::Base
10
10
  end
11
11
 
12
12
  def add_gems
13
- gem 'blacklight', '~> 6.0'
14
- gem 'blacklight-gallery', '>= 0.3.0'
13
+ gem 'blacklight', '~> 7.0'
14
+ gem 'blacklight-gallery', '~> 1.1'
15
15
  Bundler.with_clean_env do
16
16
  run 'bundle install'
17
17
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  describe 'shared/_header_navbar', type: :view do
4
4
  before do
5
- stub_template '_user_util_links.html.erb' => 'links'
5
+ stub_template 'shared/_user_util_links.html.erb' => 'links'
6
6
  end
7
7
 
8
8
  it 'has nav links' do
@@ -13,7 +13,7 @@ describe 'shared/_masthead', type: :view do
13
13
 
14
14
  it 'has the site title and subtitle' do
15
15
  render
16
- expect(rendered).to have_selector '.h1', text: exhibit.title
16
+ expect(rendered).to have_selector '.h2', text: exhibit.title
17
17
  expect(rendered).to have_selector 'small', text: exhibit.subtitle
18
18
  end
19
19
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- describe '_user_util_links', type: :view do
3
+ describe 'shared/_user_util_links', type: :view do
4
4
  let(:current_exhibit) { FactoryBot.create(:exhibit) }
5
5
  before do
6
6
  allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
@@ -15,8 +15,8 @@ describe 'spotlight/about_pages/_sidebar.html.erb', type: :view do
15
15
  it 'renders a list of pages' do
16
16
  render
17
17
  # Checking that they are sorted accoding to weight
18
- expect(rendered).to have_selector '#sidebar ul.sidenav li:nth-child(1) a', text: 'Three'
19
- expect(rendered).to have_selector '#sidebar ul.sidenav li:nth-child(2) a', text: 'One'
18
+ expect(rendered).to have_selector 'ul.sidenav li:nth-child(1) a', text: 'Three'
19
+ expect(rendered).to have_selector 'ul.sidenav li:nth-child(2) a', text: 'One'
20
20
  expect(rendered).to have_link 'Three', href: "/spotlight/#{exhibit.slug}/about/three"
21
21
  expect(rendered).to have_link 'One', href: "/spotlight/#{exhibit.slug}/about/one"
22
22
  expect(rendered).not_to have_link 'Two'
@@ -40,8 +40,8 @@ describe 'spotlight/about_pages/index.html.erb', type: :view do
40
40
  assign(:pages, pages)
41
41
  allow(exhibit).to receive(:about_pages).and_return pages
42
42
  render
43
- expect(rendered).to have_selector '.panel-title', text: 'Title1'
44
- expect(rendered).to have_selector '.panel-title', text: 'Title2'
43
+ expect(rendered).to have_selector '.card-title', text: 'Title1'
44
+ expect(rendered).to have_selector '.card-title', text: 'Title2'
45
45
 
46
46
  expect(rendered).to have_selector '.contacts_admin ol.dd-list li[data-id]', count: 2
47
47
  expect(rendered).to have_selector '.contacts_admin ol.dd-list li input[data-property=weight]', visible: false, count: 2
@@ -24,6 +24,6 @@ describe 'spotlight/browse/search', type: :view do
24
24
 
25
25
  it 'displays the item count' do
26
26
  render partial: 'spotlight/browse/search', locals: { search: search }
27
- expect(response).to have_selector 'small', text: /#{search.documents.size} items/i
27
+ expect(response).to have_selector 'small', text: /#{search.count} items/i
28
28
  end
29
29
  end
@@ -1,23 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe 'spotlight/browse/_sort_and_per_page', type: :view do
4
- let :blacklight_config do
5
- Blacklight::Configuration.new
6
- end
7
-
8
4
  before do
9
- allow(view).to receive_messages(blacklight_config: blacklight_config)
5
+ allow(view).to receive_messages(render_results_collection_tools: 'collection tools')
10
6
  end
11
7
 
12
8
  it 'renders the pagination, sort, per page and view type controls' do
13
- stub_template '_paginate_compact.html.erb' => "paginate_compact\n"
14
- stub_template '_sort_widget.html.erb' => "sort_widget\n"
15
- stub_template '_per_page_widget.html.erb' => "per_page_widget\n"
16
- stub_template '_view_type_group.html.erb' => "view_type_group\n"
17
9
  render
18
- expect(rendered).to_not have_content 'paginate_compact'
19
- expect(rendered).to have_content 'sort_widget'
20
- expect(rendered).to have_content 'per_page_widget'
21
- expect(rendered).to have_content 'view_type_group'
10
+ expect(rendered).to have_content 'collection tools'
22
11
  end
23
12
  end
@@ -23,14 +23,14 @@ describe 'spotlight/browse/show', type: :view do
23
23
  it 'has a heading and item count when there is no current search masthead' do
24
24
  render
25
25
  expect(response).to have_selector 'h1', text: search.title
26
- expect(response).to have_selector '.item-count', text: "#{search.documents.size} items"
26
+ expect(response).to have_selector '.item-count', text: "#{search.count} items"
27
27
  end
28
28
 
29
29
  it 'does not have the heading and item count when there is a current search masthead' do
30
30
  allow(view).to receive_messages(resource_masthead?: true)
31
31
  render
32
32
  expect(response).to_not have_selector 'h1', text: search.title
33
- expect(response).to_not have_selector '.item-count', text: "#{search.documents.size} items"
33
+ expect(response).to_not have_selector '.item-count', text: "#{search.count} items"
34
34
  end
35
35
 
36
36
  it 'has an edit button' do
@@ -21,7 +21,7 @@ describe 'spotlight/catalog/admin.html.erb', type: :view do
21
21
 
22
22
  it 'renders the sidebar' do
23
23
  render
24
- expect(rendered).to have_link 'Browse'
24
+ expect(view.content_for(:sidebar)).to have_link 'Browse'
25
25
  end
26
26
 
27
27
  it "renders the 'add items' link if any repository sources are configured" do
@@ -35,11 +35,11 @@ describe 'spotlight/dashboards/_reindexing_activity.html.erb', type: :view do
35
35
  end
36
36
 
37
37
  it 'displays the correct localized column headings when there are reindexing attempts in the log' do
38
- expect(rendered).to have_css('table.table-striped th.col-md-3', text: 'Date', count: 1)
39
- expect(rendered).to have_css('table.table-striped th.col-md-2', text: 'Requested By', count: 1)
40
- expect(rendered).to have_css('table.table-striped th.col-md-1', text: 'Items Indexed', count: 1)
41
- expect(rendered).to have_css('table.table-striped th.col-md-2', text: 'Elapsed Time', count: 1)
42
- expect(rendered).to have_css('table.table-striped th.col-md-2', text: 'Status', count: 1)
38
+ expect(rendered).to have_css('table.table-striped th.col-3', text: 'Date', count: 1)
39
+ expect(rendered).to have_css('table.table-striped th.col-3', text: 'Requested By', count: 1)
40
+ expect(rendered).to have_css('table.table-striped th.col-1', text: 'Items Indexed', count: 1)
41
+ expect(rendered).to have_css('table.table-striped th.col-3', text: 'Elapsed Time', count: 1)
42
+ expect(rendered).to have_css('table.table-striped th.col-2', text: 'Status', count: 1)
43
43
  end
44
44
 
45
45
  it 'formats the start time correctly' do
@@ -20,7 +20,7 @@ describe 'spotlight/dashboards/analytics.html.erb', type: :view do
20
20
 
21
21
  context 'with a configured analytics integration' do
22
22
  before do
23
- allow(Spotlight::Analytics::Ga).to receive(:enabled?).and_return(true)
23
+ allow(current_exhibit).to receive(:analytics_provider).and_return(double(Spotlight::Analytics::Ga, enabled?: true))
24
24
  stub_template 'spotlight/dashboards/_analytics.html.erb' => 'Analytics data'
25
25
  end
26
26
 
@@ -25,7 +25,7 @@ describe 'spotlight/exhibits/_exhibit_card_front.html.erb', type: :view do
25
25
  it 'has a title' do
26
26
  render p, exhibit: exhibit
27
27
 
28
- expect(rendered).to have_selector '.card-title', text: exhibit.title
28
+ expect(rendered).to have_selector '.exhibit-card-title', text: exhibit.title
29
29
  end
30
30
 
31
31
  context 'for an unpublished exhibit' do
@@ -36,7 +36,7 @@ describe 'spotlight/exhibits/_exhibit_card_front.html.erb', type: :view do
36
36
  it 'has an unpublished banner' do
37
37
  render p, exhibit: exhibit
38
38
 
39
- expect(rendered).to have_selector '.label.unpublished', text: 'Unpublished'
39
+ expect(rendered).to have_selector '.badge.unpublished', text: 'Unpublished'
40
40
  end
41
41
  end
42
42
  end
@@ -20,7 +20,7 @@ describe 'spotlight/exhibits/edit', type: :view do
20
20
  render
21
21
 
22
22
  expect(rendered).to have_selector "form[action=\"#{spotlight.exhibit_path(exhibit)}\"]"
23
- expect(rendered).to have_selector '.callout.callout-danger.row'
23
+ expect(rendered).to have_selector '.alert.alert-danger'
24
24
  expect(rendered).to have_content 'This action is irreversible'
25
25
  expect(rendered).to have_link 'Export data', href: spotlight.import_exhibit_path(exhibit)
26
26
  expect(rendered).to have_button 'Import data'
@@ -134,7 +134,7 @@ describe 'spotlight/exhibits/index', type: :view do
134
134
  it 'has a sidebar with a button to create a new exhibit' do
135
135
  render
136
136
 
137
- expect(rendered).to have_selector 'aside .btn', text: 'Create a new exhibit'
137
+ expect(view.content_for(:sidebar)).to have_selector '.btn', text: 'Create a new exhibit'
138
138
  end
139
139
  end
140
140
  end
@@ -21,10 +21,10 @@ describe 'spotlight/feature_pages/_sidebar.html.erb', type: :view do
21
21
  allow(view).to receive(:current_page?).and_return(true, false)
22
22
  render
23
23
  # Checking that they are sorted accoding to weight
24
- expect(rendered).to have_selector 'li.active h4', text: 'Parent Page'
25
- expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(1) a', text: 'Five'
26
- expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(2) a', text: 'Three'
27
- expect(rendered).to have_selector 'li h4 a', text: 'Two' # a different parent page
24
+ expect(rendered).to have_selector 'li.active', text: 'Parent Page'
25
+ expect(rendered).to have_selector 'ol.sidenav li:nth-child(1) a', text: 'Five'
26
+ expect(rendered).to have_selector 'ol.sidenav li:nth-child(2) a', text: 'Three'
27
+ expect(rendered).to have_selector 'li a', text: 'Two' # a different parent page
28
28
  expect(rendered).to have_link 'Four' # different parent
29
29
  expect(rendered).not_to have_link 'Six' # not published
30
30
  expect(rendered).not_to have_link 'Seven' # different exhibit
@@ -34,9 +34,9 @@ describe 'spotlight/feature_pages/_sidebar.html.erb', type: :view do
34
34
  assign(:page, child1)
35
35
  render
36
36
  # Checking that they are sorted accoding to weight
37
- expect(rendered).to have_selector 'h4', text: 'Parent Page'
38
- expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(1) a', text: 'Five'
39
- expect(rendered).to have_selector '#sidebar ol.sidenav li:nth-child(2) a', text: 'Three'
37
+ expect(rendered).to have_selector 'li', text: 'Parent Page'
38
+ expect(rendered).to have_selector 'ol.sidenav li:nth-child(1) a', text: 'Five'
39
+ expect(rendered).to have_selector 'ol.sidenav li:nth-child(2) a', text: 'Three'
40
40
  expect(rendered).to have_content 'Two' # not selected page
41
41
  expect(rendered).to have_link 'Four' # different parent
42
42
  expect(rendered).not_to have_link 'Six' # not published
@@ -8,7 +8,7 @@ describe 'spotlight/metadata_configurations/_metadata_field', type: :view do
8
8
  assign(:blacklight_configuration, exhibit.blacklight_configuration)
9
9
  allow(view).to receive_messages(
10
10
  current_exhibit: exhibit,
11
- blacklight_config: exhibit.blacklight_configuration,
11
+ blacklight_config: exhibit.blacklight_configuration.blacklight_config,
12
12
  available_view_fields: { some_view_type: 1, another_view_type: 2 },
13
13
  select_deselect_button: nil
14
14
  )
@@ -18,12 +18,13 @@ describe 'spotlight/metadata_configurations/_metadata_field', type: :view do
18
18
  let(:builder) { ActionView::Helpers::FormBuilder.new 'z', nil, view, {} }
19
19
 
20
20
  it 'uses the index_field_label helper to render the label' do
21
- allow(view).to receive(:index_field_label).with(nil, 'some_key').and_return 'Some label'
21
+ allow(view).to receive(:index_field_label).with(anything, 'some_key').and_return 'Some label'
22
22
  render partial: p, locals: { key: 'some_key', config: field, f: builder }
23
23
  expect(rendered).to have_selector '.field-label', text: 'Some label'
24
24
  end
25
25
 
26
26
  it 'marks views as disabled if they are immutable' do
27
+ allow(controller).to receive(:enabled_in_spotlight_view_type_configuration?).and_return(true)
27
28
  render partial: p, locals: { key: 'some_key', config: field, f: builder }
28
29
  expect(rendered).to have_selector 'input[disabled][name="z[some_key][another_view_type]"]'
29
30
  end
@@ -7,10 +7,11 @@ describe 'spotlight/metadata_configurations/edit', type: :view do
7
7
  assign(:blacklight_configuration, exhibit.blacklight_configuration)
8
8
  allow(view).to receive_messages(
9
9
  current_exhibit: exhibit,
10
- blacklight_config: exhibit.blacklight_configuration,
10
+ blacklight_config: exhibit.blacklight_configuration.blacklight_config,
11
11
  available_view_fields: { some_view_type: 1, another_view_type: 2 },
12
12
  select_deselect_button: nil
13
13
  )
14
+ allow(controller).to receive(:enabled_in_spotlight_view_type_configuration?).and_return(true)
14
15
  end
15
16
 
16
17
  it 'has columns for the available view types' do
@@ -26,8 +26,8 @@ describe 'spotlight/pages/index.html.erb', type: :view do
26
26
  assign(:pages, pages)
27
27
  allow(exhibit).to receive(:feature_pages).and_return pages
28
28
  render
29
- expect(rendered).to have_selector '.panel-title', text: 'Title1'
30
- expect(rendered).to have_selector '.panel-title', text: 'Title2'
29
+ expect(rendered).to have_selector '.card-title', text: 'Title1'
30
+ expect(rendered).to have_selector '.card-title', text: 'Title2'
31
31
  end
32
32
 
33
33
  describe 'Without pages' do
@@ -33,7 +33,7 @@ describe 'spotlight/pages/show', type: :view do
33
33
 
34
34
  it 'does not double-escape HTML entities in the HTML title' do
35
35
  allow(page).to receive_messages(title: 'Abbott & Costello')
36
- stub_template '_user_util_links.html.erb' => ''
36
+ stub_template 'shared/_user_util_links.html.erb' => ''
37
37
  stub_template 'shared/_masthead.html.erb' => ''
38
38
  render template: 'spotlight/pages/show', layout: 'layouts/spotlight/spotlight'
39
39
  expect(rendered).to have_content('Abbott & Costello | Blacklight')
@@ -53,13 +53,13 @@ describe 'spotlight/pages/show', type: :view do
53
53
  it 'renders the sidebar' do
54
54
  page.display_sidebar = true
55
55
  render
56
- expect(rendered).to match('Sidebar')
56
+ expect(view.content_for(:sidebar)).to match('Sidebar')
57
57
  end
58
58
 
59
59
  it 'does not render the sidebar if the page has it disabled' do
60
60
  allow(page).to receive_messages(display_sidebar?: false)
61
61
  render
62
- expect(rendered).to_not match('Sidebar')
62
+ expect(view.content_for(:sidebar)).to_not match('Sidebar')
63
63
  end
64
64
 
65
65
  it 'renders an empty partial if the page has no content' do
@@ -30,7 +30,7 @@ describe 'spotlight/searches/_search.html.erb', type: :view do
30
30
  render partial: 'spotlight/searches/search', locals: { f: @f }
31
31
  # rubocop:enable RSpec/InstanceVariable
32
32
  expect(rendered).to have_selector "li[data-id='99']"
33
- expect(rendered).to have_selector '.panel-heading .main .title', text: 'Title1'
33
+ expect(rendered).to have_selector '.card-title', text: 'Title1'
34
34
  expect(rendered).to have_selector 'img[src="/images/7777/full/400,300/0/default.jpg"]'
35
35
  expect(rendered).to have_selector 'input[type=hidden][data-property=weight]', visible: false
36
36
  end
@@ -33,8 +33,8 @@ describe 'spotlight/searches/edit.html.erb', type: :view do
33
33
 
34
34
  it 'renders active search constraints' do
35
35
  render
36
- expect(rendered).to have_selector '.appliedFilter .constraint-value'
37
- expect(rendered).to have_selector '.appliedFilter .constraint-value .filterName', text: 'Some Field'
38
- expect(rendered).to have_selector '.appliedFilter .constraint-value .filterValue', text: 'xyz'
36
+ expect(rendered).to have_selector '.appliedParams .constraint-value'
37
+ expect(rendered).to have_selector '.appliedParams .constraint-value .filter-name', text: 'Some Field'
38
+ expect(rendered).to have_selector '.appliedParams .constraint-value .filter-value', text: 'xyz'
39
39
  end
40
40
  end