blacklight-spotlight 3.4.2.1 → 3.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/spotlight/sir_trevor/blocks/_video_block.html.erb +5 -5
- data/lib/generators/spotlight/install_generator.rb +0 -8
- data/lib/spotlight/version.rb +1 -1
- data/spec/support/controllers/engine_helpers.rb +9 -0
- data/spec/support/disable_friendly_id_deprecation_warnings.rb +11 -0
- data/spec/support/features/capybara_default_max_wait_metadata_helper.rb +20 -0
- data/spec/support/features/test_features_helpers.rb +92 -0
- data/spec/support/helpers/controller_level_helpers.rb +25 -0
- data/spec/support/stub_iiif_response.rb +26 -0
- data/spec/support/views/test_view_helpers.rb +21 -0
- metadata +9 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d42a59c98f526b1eeac14da844d45f58e320d5433c8299672eb67d371a2b9a1e
|
4
|
+
data.tar.gz: b9304499e4c378fa45d2e6223caac993ad1454c9605a3b4869e83727170e680c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebb7c1b24d838ebe9669177d18666f387fa5e8ee7d62ab4ce412cdf1261238af1a1d431317697d4a7339864c271f1c38295cd428a97dc803747329ff5a909f97
|
7
|
+
data.tar.gz: 8098d1725f8076537c6b224b5302500f2b5ac9ba5c80b1676eb1d26939c4b932537e07d0cafddb5ddf82c40a23f94fb4a8920046c7393a136ba6c1b3402a6c7d
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% if
|
2
|
-
<%= render partial: '/spotlight/sir_trevor/blocks/videos/vimeo', vimeo:
|
3
|
-
<% elsif
|
4
|
-
<%= render partial: '/spotlight/sir_trevor/blocks/videos/youtube', youtube:
|
5
|
-
<% end %>
|
1
|
+
<% if video_block.source == 'vimeo' %>
|
2
|
+
<%= render partial: '/spotlight/sir_trevor/blocks/videos/vimeo', vimeo: video_block %>
|
3
|
+
<% elsif video_block.source == 'youtube' %>
|
4
|
+
<%= render partial: '/spotlight/sir_trevor/blocks/videos/youtube', youtube: video_block %>
|
5
|
+
<% end %>
|
@@ -177,14 +177,6 @@ module Spotlight
|
|
177
177
|
copy_file 'config/initializers/translation.rb'
|
178
178
|
end
|
179
179
|
|
180
|
-
def configure_queue
|
181
|
-
insert_into_file 'config/application.rb', after: "< Rails::Application\n" do
|
182
|
-
<<-EOF
|
183
|
-
config.active_job.queue_adapter = ENV["RAILS_QUEUE"]&.to_sym || :sidekiq
|
184
|
-
EOF
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
180
|
def configure_logging
|
189
181
|
insert_into_file 'config/application.rb', after: "< Rails::Application\n" do
|
190
182
|
<<-EOF
|
data/lib/spotlight/version.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR <= 1
|
4
|
+
default_deprecation_behaviours = ActiveSupport::Deprecation.behavior
|
5
|
+
ActiveSupport::Deprecation.behavior = lambda do |message, callstack|
|
6
|
+
unless callstack.find { |l| l.path =~ %r{gems/friendly_id} } &&
|
7
|
+
message =~ /The behavior of .* inside of after callbacks will be changing/
|
8
|
+
default_deprecation_behaviours.each { |b| b.call(message, callstack) }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CapybaraDefaultMaxWaitMetadataHelper
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
before do |example|
|
8
|
+
next unless example.metadata[:default_max_wait_time]
|
9
|
+
|
10
|
+
@previous_wait_time = Capybara.default_max_wait_time
|
11
|
+
Capybara.default_max_wait_time = example.metadata[:default_max_wait_time]
|
12
|
+
end
|
13
|
+
|
14
|
+
after do |example|
|
15
|
+
next unless example.metadata[:default_max_wait_time]
|
16
|
+
|
17
|
+
Capybara.default_max_wait_time = @previous_wait_time
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spotlight
|
4
|
+
module TestFeaturesHelpers
|
5
|
+
def fill_in_typeahead_field(opts = {})
|
6
|
+
type = opts[:type] || 'twitter'
|
7
|
+
# Poltergeist / Capybara doesn't fire the events typeahead.js
|
8
|
+
# is listening for, so we help it out a little:
|
9
|
+
page.execute_script <<-EOF
|
10
|
+
$("[data-#{type}-typeahead]:visible").val("#{opts[:with]}").trigger("input");
|
11
|
+
$("[data-#{type}-typeahead]:visible").typeahead("open");
|
12
|
+
$(".tt-suggestion").click();
|
13
|
+
EOF
|
14
|
+
|
15
|
+
find('.tt-suggestion', text: opts[:with], match: :first).click
|
16
|
+
end
|
17
|
+
|
18
|
+
##
|
19
|
+
# For typeahead "prefetched" fields, we need to wait for a resolved selector
|
20
|
+
# before proceeding.
|
21
|
+
def fill_in_prefetched_typeahead_field(opts)
|
22
|
+
type = opts[:type] || 'twitter'
|
23
|
+
# Poltergeist / Capybara doesn't fire the events typeahead.js
|
24
|
+
# is listening for, so we help it out a little:
|
25
|
+
find(opts[:wait_for]) if opts[:wait_for]
|
26
|
+
page.execute_script <<-EOF
|
27
|
+
$("[data-#{type}-typeahead]:visible").val("#{opts[:with]}").trigger("input");
|
28
|
+
$("[data-#{type}-typeahead]:visible").typeahead("open");
|
29
|
+
$(".tt-suggestion").click();
|
30
|
+
EOF
|
31
|
+
end
|
32
|
+
|
33
|
+
# just like #fill_in_typeahead_field, but wait for the
|
34
|
+
# form fields to show up on the page too
|
35
|
+
def fill_in_solr_document_block_typeahead_field(opts)
|
36
|
+
fill_in_typeahead_field(opts)
|
37
|
+
expect(page).to have_css('li[data-resource-id="' + opts[:with] + '"]')
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_widget(type)
|
41
|
+
click_add_widget
|
42
|
+
|
43
|
+
# click the item + image widget
|
44
|
+
expect(page).to have_css("button[data-type='#{type}']")
|
45
|
+
find("button[data-type='#{type}']").click
|
46
|
+
end
|
47
|
+
|
48
|
+
def click_add_widget
|
49
|
+
unless all('.st-block-replacer').present?
|
50
|
+
expect(page).to have_css('.st-block-addition')
|
51
|
+
first('.st-block-addition').click
|
52
|
+
end
|
53
|
+
expect(page).to have_css('.st-block-replacer')
|
54
|
+
first('.st-block-replacer').click
|
55
|
+
end
|
56
|
+
|
57
|
+
def save_page
|
58
|
+
page.execute_script <<-EOF
|
59
|
+
SirTrevor.getInstance().onFormSubmit();
|
60
|
+
EOF
|
61
|
+
click_button('Save changes')
|
62
|
+
# verify that the page was created
|
63
|
+
expect(page).not_to have_selector('.alert-danger')
|
64
|
+
expect(page).to have_selector('.alert-info', text: 'page was successfully updated')
|
65
|
+
end
|
66
|
+
|
67
|
+
RSpec::Matchers.define :have_breadcrumbs do |*expected|
|
68
|
+
match do |actual|
|
69
|
+
errors = []
|
70
|
+
errors << 'Unable to find breadcrumbs' unless actual.has_css? '.breadcrumb'
|
71
|
+
|
72
|
+
breadcrumbs = expected.dup
|
73
|
+
|
74
|
+
actual.within('.breadcrumb') do
|
75
|
+
last = breadcrumbs.pop
|
76
|
+
breadcrumbs.each do |e|
|
77
|
+
errors << "Unable to find breadcrumb #{e}" unless actual.has_link? e
|
78
|
+
end
|
79
|
+
|
80
|
+
errors << "Unable to find breadcrumb #{last}" unless actual.has_content? last
|
81
|
+
errors << "Expected #{last} not to be a link" if actual.has_link? last
|
82
|
+
end
|
83
|
+
|
84
|
+
errors.empty?
|
85
|
+
end
|
86
|
+
|
87
|
+
failure_message do |actual|
|
88
|
+
"expected that #{actual.all('.breadcrumb li').map(&:text).join(' / ')} would include #{expected.join(' / ')}"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ControllerLevelHelpers
|
4
|
+
def search_state
|
5
|
+
@search_state ||= Blacklight::SearchState.new(params, blacklight_config)
|
6
|
+
end
|
7
|
+
|
8
|
+
def current_site
|
9
|
+
Spotlight::Site.instance
|
10
|
+
end
|
11
|
+
|
12
|
+
def blacklight_configuration_context
|
13
|
+
@blacklight_configuration_context ||= Blacklight::Configuration::Context.new(controller)
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize_controller_helpers(helper)
|
17
|
+
helper.extend ControllerLevelHelpers
|
18
|
+
initialize_routing_helpers(helper)
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize_routing_helpers(helper)
|
22
|
+
helper.class.include ::Rails.application.routes.url_helpers
|
23
|
+
helper.class.include ::Rails.application.routes.mounted_helpers if ::Rails.application.routes.respond_to?(:mounted_helpers)
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fixtures/iiif_responses'
|
4
|
+
module StubIiifResponse
|
5
|
+
def stub_iiif_response_for_url(url, response)
|
6
|
+
allow(Spotlight::Resources::IiifService).to receive(:iiif_response).with(url).and_return(response)
|
7
|
+
end
|
8
|
+
|
9
|
+
def stub_default_collection
|
10
|
+
allow_any_instance_of(Spotlight::Resources::IiifHarvester).to receive_messages(url_is_iiif?: true)
|
11
|
+
stub_iiif_response_for_url('uri://for-top-level-collection', complex_collection)
|
12
|
+
stub_iiif_response_for_url('uri://for-child-collection1', child_collection1)
|
13
|
+
stub_iiif_response_for_url('uri://for-child-collection2', child_collection2)
|
14
|
+
stub_iiif_response_for_url('uri://for-child-collection3', child_collection3)
|
15
|
+
|
16
|
+
stub_iiif_response_for_url('uri://for-manifest1', test_manifest1)
|
17
|
+
stub_iiif_response_for_url('uri://for-manifest2', test_manifest2)
|
18
|
+
stub_iiif_response_for_url('uri://for-manifest3', test_manifest3)
|
19
|
+
stub_iiif_response_for_url('uri://for-manifest4', test_manifest4)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
RSpec.configure do |config|
|
24
|
+
config.include IiifResponses
|
25
|
+
config.include StubIiifResponse
|
26
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spotlight
|
4
|
+
module TestViewHelpers
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
before do
|
9
|
+
view.send(:extend, Spotlight::RenderingHelper)
|
10
|
+
view.send(:extend, Spotlight::MainAppHelpers)
|
11
|
+
view.send(:extend, Spotlight::CrudLinkHelpers)
|
12
|
+
view.send(:extend, Spotlight::TitleHelper)
|
13
|
+
view.send(:extend, Spotlight::NavbarHelper)
|
14
|
+
view.send(:extend, Spotlight::CropHelper)
|
15
|
+
view.send(:extend, Spotlight::PagesHelper)
|
16
|
+
view.send(:extend, Blacklight::ComponentHelperBehavior)
|
17
|
+
view.send(:extend, BreadcrumbsOnRails::ActionController::HelperMethods)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
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: 3.4.
|
4
|
+
version: 3.4.4
|
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: 2022-
|
14
|
+
date: 2022-07-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activejob-status
|
@@ -365,20 +365,6 @@ dependencies:
|
|
365
365
|
- - ">="
|
366
366
|
- !ruby/object:Gem::Version
|
367
367
|
version: '0'
|
368
|
-
- !ruby/object:Gem::Dependency
|
369
|
-
name: mimemagic
|
370
|
-
requirement: !ruby/object:Gem::Requirement
|
371
|
-
requirements:
|
372
|
-
- - '='
|
373
|
-
- !ruby/object:Gem::Version
|
374
|
-
version: 0.3.8
|
375
|
-
type: :runtime
|
376
|
-
prerelease: false
|
377
|
-
version_requirements: !ruby/object:Gem::Requirement
|
378
|
-
requirements:
|
379
|
-
- - '='
|
380
|
-
- !ruby/object:Gem::Version
|
381
|
-
version: 0.3.8
|
382
368
|
- !ruby/object:Gem::Dependency
|
383
369
|
name: mini_magick
|
384
370
|
requirement: !ruby/object:Gem::Requirement
|
@@ -481,20 +467,6 @@ dependencies:
|
|
481
467
|
- - "<"
|
482
468
|
- !ruby/object:Gem::Version
|
483
469
|
version: '13'
|
484
|
-
- !ruby/object:Gem::Dependency
|
485
|
-
name: pg
|
486
|
-
requirement: !ruby/object:Gem::Requirement
|
487
|
-
requirements:
|
488
|
-
- - ">="
|
489
|
-
- !ruby/object:Gem::Version
|
490
|
-
version: '0'
|
491
|
-
type: :runtime
|
492
|
-
prerelease: false
|
493
|
-
version_requirements: !ruby/object:Gem::Requirement
|
494
|
-
requirements:
|
495
|
-
- - ">="
|
496
|
-
- !ruby/object:Gem::Version
|
497
|
-
version: '0'
|
498
470
|
- !ruby/object:Gem::Dependency
|
499
471
|
name: rails
|
500
472
|
requirement: !ruby/object:Gem::Requirement
|
@@ -577,20 +549,6 @@ dependencies:
|
|
577
549
|
- - ">="
|
578
550
|
- !ruby/object:Gem::Version
|
579
551
|
version: '0'
|
580
|
-
- !ruby/object:Gem::Dependency
|
581
|
-
name: sidekiq
|
582
|
-
requirement: !ruby/object:Gem::Requirement
|
583
|
-
requirements:
|
584
|
-
- - ">="
|
585
|
-
- !ruby/object:Gem::Version
|
586
|
-
version: '0'
|
587
|
-
type: :runtime
|
588
|
-
prerelease: false
|
589
|
-
version_requirements: !ruby/object:Gem::Requirement
|
590
|
-
requirements:
|
591
|
-
- - ">="
|
592
|
-
- !ruby/object:Gem::Version
|
593
|
-
version: '0'
|
594
552
|
- !ruby/object:Gem::Dependency
|
595
553
|
name: signet
|
596
554
|
requirement: !ruby/object:Gem::Requirement
|
@@ -675,20 +633,6 @@ dependencies:
|
|
675
633
|
- - "~>"
|
676
634
|
- !ruby/object:Gem::Version
|
677
635
|
version: '1.6'
|
678
|
-
- !ruby/object:Gem::Dependency
|
679
|
-
name: webpacker
|
680
|
-
requirement: !ruby/object:Gem::Requirement
|
681
|
-
requirements:
|
682
|
-
- - ">="
|
683
|
-
- !ruby/object:Gem::Version
|
684
|
-
version: '0'
|
685
|
-
type: :runtime
|
686
|
-
prerelease: false
|
687
|
-
version_requirements: !ruby/object:Gem::Requirement
|
688
|
-
requirements:
|
689
|
-
- - ">="
|
690
|
-
- !ruby/object:Gem::Version
|
691
|
-
version: '0'
|
692
636
|
- !ruby/object:Gem::Dependency
|
693
637
|
name: capybara
|
694
638
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1604,6 +1548,13 @@ files:
|
|
1604
1548
|
- spec/fixtures/updated-bulk-update-template-no-cols.csv
|
1605
1549
|
- spec/fixtures/updated-bulk-update-template-w-tags.csv
|
1606
1550
|
- spec/fixtures/updated-bulk-update-template.csv
|
1551
|
+
- spec/support/controllers/engine_helpers.rb
|
1552
|
+
- spec/support/disable_friendly_id_deprecation_warnings.rb
|
1553
|
+
- spec/support/features/capybara_default_max_wait_metadata_helper.rb
|
1554
|
+
- spec/support/features/test_features_helpers.rb
|
1555
|
+
- spec/support/helpers/controller_level_helpers.rb
|
1556
|
+
- spec/support/stub_iiif_response.rb
|
1557
|
+
- spec/support/views/test_view_helpers.rb
|
1607
1558
|
- vendor/assets/images/sir-trevor-icons.svg
|
1608
1559
|
- vendor/assets/javascripts/Leaflet.Editable.js
|
1609
1560
|
- vendor/assets/javascripts/MutationObserver.js
|