blacklight-spotlight 4.6.1 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1c1e34d4e9beb99a5032c7361b9fb355f461b4cd7a532f6aea0c25730858753
4
- data.tar.gz: 5f6879362e353cd851f04653aec67ad93b35d5b799f7a3d48e81f07eb4c53e62
3
+ metadata.gz: 051b1798794393c2afeb19a83437d9d0bde7c2bd5861a1684b08bb89fe948a51
4
+ data.tar.gz: '058d356020bd76fccf4124dee494114640ecb514ecabe06220a3ad2628ce9510'
5
5
  SHA512:
6
- metadata.gz: 909f10a67ab1e3144bb2a43fc2590bbaf9ad7a5e9f0134f178b88bbc8674796acb1f868511f167f1e916985633aee927b274e3f0b5d479cd87ba41fbe15709b7
7
- data.tar.gz: f5bc2b2ba5addad2ccbc01881e3e5b2bd5240fe96a82fc7fc742f94b5bda6132044f7b400cc132276173c0cc86e798741ba97156d0e5179bcb8e8338e9356ba0
6
+ metadata.gz: 2489cb7dd18bcd3369a41e0991349617ed3a49adedb9859d79eb9b0938f70f712cf6325c2e9eb48754d2b691f1a1ae6c32e7f3c8393a2083f3984248d166dd6c
7
+ data.tar.gz: a636d0dabffd8633a2a293c8433dada5c3df367512df0232ea366b193300e2828d6e973cc38bc31f7279cf486e1505c77cea8c6c7f5c181adec80dbd6f97f40d
data/Rakefile CHANGED
@@ -19,6 +19,7 @@ end
19
19
  Bundler::GemHelper.install_tasks
20
20
 
21
21
  require 'solr_wrapper'
22
+ require 'open3'
22
23
 
23
24
  require 'rspec/core/rake_task'
24
25
  RSpec::Core::RakeTask.new(:spec)
@@ -30,16 +31,45 @@ require 'engine_cart/rake_task'
30
31
 
31
32
  require 'spotlight/version'
32
33
 
33
- task ci: ['engine_cart:generate'] do
34
- ENV['environment'] = 'test'
34
+ def system_with_error_handling(*args)
35
+ Open3.popen3(*args) do |_stdin, stdout, stderr, thread|
36
+ puts stdout.read
37
+ raise "Unable to run #{args.inspect}: #{stderr.read}" unless thread.value.success?
38
+ end
39
+ end
35
40
 
36
- SolrWrapper.wrap(port: '8983') do |solr|
37
- solr.with_collection(name: 'blacklight-core', dir: 'lib/generators/spotlight/templates/solr/conf') do
38
- Rake::Task['spotlight:fixtures'].invoke
41
+ def with_solr(&block) # rubocop:disable Metrics/MethodLength
42
+ # We're being invoked by the app entrypoint script and solr is already up via docker compose
43
+ if ENV['SOLR_ENV'] == 'docker-compose'
44
+ yield
45
+ elsif system('docker compose version')
46
+ # We're not running `docker compose up' but still want to use a docker instance of solr.
47
+ begin
48
+ puts 'Starting Solr'
49
+ system_with_error_handling 'docker compose up -d solr'
50
+ yield
51
+ ensure
52
+ puts 'Stopping Solr'
53
+ system_with_error_handling 'docker compose stop solr'
54
+ end
55
+ else
56
+ SolrWrapper.wrap do |solr|
57
+ solr.with_collection(&block)
58
+ end
59
+ end
60
+ end
61
+
62
+ task :ci do
63
+ ENV['environment'] = 'test'
39
64
 
40
- # run the tests
41
- Rake::Task['spec'].invoke
65
+ with_solr do
66
+ Rake::Task['spotlight:fixtures'].invoke
67
+ within_test_app do
68
+ system 'bin/rake spec:prepare'
42
69
  end
70
+
71
+ # run the tests
72
+ Rake::Task['spec'].invoke
43
73
  end
44
74
  end
45
75
 
@@ -5137,7 +5137,7 @@ jQuery.fn.scrollStop = function(callback) {
5137
5137
  class Pages {
5138
5138
  connect(){
5139
5139
  SirTrevor.setDefaults({
5140
- iconUrl: Spotlight.sirTrevorIcon,
5140
+ iconUrl: Spotlight.sirTrevorIcon || window.sirTrevorIcon,
5141
5141
  uploadUrl: $('[data-attachment-endpoint]').data('attachment-endpoint'),
5142
5142
  ajaxOptions: {
5143
5143
  headers: {