blacklight-spotlight 1.4.1 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -1
  3. data/app/assets/javascripts/spotlight/blocks/resources_block.js +3 -2
  4. data/app/assets/javascripts/spotlight/crop.es6 +2 -0
  5. data/app/assets/javascripts/spotlight/multi_image_selector.js +5 -4
  6. data/app/assets/javascripts/spotlight/reindex_monitor.js +16 -3
  7. data/app/controllers/concerns/spotlight/controller.rb +6 -1
  8. data/app/controllers/spotlight/browse_controller.rb +27 -0
  9. data/app/controllers/spotlight/catalog_controller.rb +2 -2
  10. data/app/helpers/spotlight/browse_helper.rb +0 -29
  11. data/app/helpers/spotlight/title_helper.rb +2 -2
  12. data/app/models/concerns/spotlight/custom_translation_extension.rb +23 -0
  13. data/app/models/concerns/spotlight/solr_document/atomic_updates.rb +4 -2
  14. data/app/models/spotlight/blacklight_configuration.rb +2 -2
  15. data/app/models/spotlight/exhibit.rb +1 -1
  16. data/app/views/layouts/spotlight/spotlight.html.erb +1 -0
  17. data/app/views/spotlight/dashboards/_analytics.html.erb +4 -4
  18. data/app/views/spotlight/search_configurations/_search_fields.html.erb +1 -1
  19. data/db/migrate/20180306142612_create_translations.rb +18 -0
  20. data/lib/generators/spotlight/install_generator.rb +4 -0
  21. data/lib/generators/spotlight/templates/config/initializers/translation.rb +17 -0
  22. data/lib/spotlight/engine.rb +1 -0
  23. data/lib/spotlight/version.rb +1 -1
  24. data/spec/controllers/spotlight/browse_controller_spec.rb +32 -0
  25. data/spec/controllers/spotlight/confirmations_controller_spec.rb +1 -1
  26. data/spec/controllers/spotlight/filters_controller_spec.rb +0 -1
  27. data/spec/controllers/spotlight/roles_controller_spec.rb +17 -0
  28. data/spec/controllers/spotlight/tags_controller_spec.rb +6 -1
  29. data/spec/examples.txt +1280 -1167
  30. data/spec/factories/translation.rb +6 -0
  31. data/spec/features/add_iiif_manifest_spec.rb +2 -0
  32. data/spec/features/browse_category_spec.rb +28 -0
  33. data/spec/features/edit_search_fields_spec.rb +1 -2
  34. data/spec/features/exhibit_masthead_spec.rb +2 -2
  35. data/spec/features/exhibit_themes_spec.rb +1 -1
  36. data/spec/features/exhibits/add_tags_spec.rb +1 -1
  37. data/spec/features/item_admin_spec.rb +1 -1
  38. data/spec/features/javascript/blocks/solr_documents_block_spec.rb +41 -28
  39. data/spec/features/javascript/multi_image_select_spec.rb +1 -1
  40. data/spec/features/javascript/reindex_monitor_spec.rb +1 -1
  41. data/spec/features/javascript/search_config_admin_spec.rb +16 -29
  42. data/spec/features/site_masthead_spec.rb +1 -1
  43. data/spec/features/slideshow_spec.rb +1 -2
  44. data/spec/features/translation_scope_spec.rb +24 -0
  45. data/spec/models/spotlight/ability_spec.rb +7 -10
  46. data/spec/models/spotlight/contact_email_spec.rb +1 -1
  47. data/spec/models/spotlight/contact_form_spec.rb +1 -1
  48. data/spec/models/spotlight/resources/iiif_harvester_spec.rb +3 -0
  49. data/spec/models/spotlight/solr_document/atomic_updates_spec.rb +2 -2
  50. data/spec/spec_helper.rb +12 -4
  51. data/spec/support/disable_friendly_id_deprecation_warnings.rb +8 -0
  52. data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +16 -0
  53. data/spec/support/features/test_features_helpers.rb +12 -2
  54. data/spec/views/spotlight/browse/show.html.erb_spec.rb +0 -7
  55. data/spec/views/spotlight/roles/index.html.erb_spec.rb +2 -0
  56. data/spec/views/spotlight/tags/index.html.erb_spec.rb +1 -0
  57. data/vendor/assets/javascripts/Leaflet.Editable.js +22 -11
  58. data/vendor/assets/javascripts/leaflet-iiif.js +91 -23
  59. metadata +246 -227
  60. data/spec/features/curator_items.rb +0 -10
  61. data/spec/features/tags_admin_spec.rb +0 -27
  62. data/spec/features/user_admin_spec.rb +0 -29
@@ -1,10 +0,0 @@
1
- describe 'A curator can see the items page', type: :feature do
2
- let(:exhibit_curator) { FactoryBot.create(:exhibit_curator) }
3
- let(:exhibit) { FactoryBot.create(:exhibit) }
4
-
5
- it 'works' do
6
- login_as exhibit_curator
7
- visit spotlight.exhibit_dashboard_path(exhibit)
8
- expect(page).to have_content 'Items'
9
- end
10
- end
@@ -1,27 +0,0 @@
1
- describe 'Tags Administration', type: :feature do
2
- let(:exhibit) { FactoryBot.create(:exhibit) }
3
- let!(:tagging) { FactoryBot.create(:tagging, tagger: exhibit, taggable: exhibit) }
4
- let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
5
- before { login_as exhibit_curator }
6
-
7
- describe 'index' do
8
- it 'has tags' do
9
- visit spotlight.exhibit_tags_path(exhibit)
10
- expect(page).to have_css('td', text: tagging.tag.name)
11
- end
12
-
13
- it 'links tags to a search' do
14
- visit spotlight.exhibit_tags_path(exhibit)
15
- click_on tagging.tag.name
16
- expect(page).to have_content "Remove constraint Exhibit Tags: #{tagging.tag.name}"
17
- end
18
- end
19
-
20
- describe 'destroy' do
21
- it 'destroys a tag' do
22
- visit spotlight.exhibit_tags_path(exhibit)
23
- click_link 'Delete'
24
- expect(page).not_to have_css('td', text: tagging.tag.name)
25
- end
26
- end
27
- end
@@ -1,29 +0,0 @@
1
- describe 'User Administration', type: :feature do
2
- let!(:exhibit) { FactoryBot.create(:exhibit) }
3
- let!(:user) { FactoryBot.create(:exhibit_admin, exhibit: exhibit) }
4
- before { login_as user }
5
- describe 'index' do
6
- it 'shows the users for the exhibit' do
7
- visit spotlight.exhibit_roles_path(exhibit)
8
- exhibit.roles.each do |role|
9
- expect(page).to have_css('td', text: role.user.email)
10
- expect(page).to have_css('td', text: role.role.humanize)
11
- end
12
- end
13
-
14
- it 'invites new users to the exhibit', js: true do
15
- visit spotlight.exhibit_roles_path(exhibit)
16
-
17
- click_link 'Add a new user'
18
-
19
- fill_in 'User key', with: 'a-user-being-invited@example.com'
20
-
21
- expect do
22
- click_button 'Save changes'
23
- end.to change { Devise::Mailer.deliveries.count }.by(1)
24
- expect(User.where(email: 'a-user-being-invited@example.com').first.invitation_sent_at).to be_present
25
-
26
- expect(page).to have_css('.alert-info', text: 'User has been updated.', visible: true)
27
- end
28
- end
29
- end