blacklight-gallery 4.0.1 → 4.1.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 +4 -4
- data/.github/workflows/ruby.yml +20 -10
- data/app/components/blacklight/gallery/document_component.html.erb +5 -1
- data/app/components/blacklight/gallery/slideshow_preview_component.html.erb +5 -1
- data/app/views/catalog/_document_gallery.html.erb +2 -1
- data/app/views/catalog/_document_masonry.html.erb +2 -1
- data/app/views/catalog/_document_slideshow.html.erb +5 -4
- data/blacklight-gallery.gemspec +3 -4
- data/lib/blacklight/gallery/version.rb +1 -1
- data/lib/generators/blacklight_gallery/install_generator.rb +9 -9
- data/solr/conf/solrconfig.xml +1 -0
- data/spec/components/blacklight/gallery/document_component_spec.rb +12 -2
- data/spec/components/blacklight/gallery/slideshow_component_spec.rb +31 -7
- data/spec/components/blacklight/gallery/slideshow_preview_component_spec.rb +12 -3
- data/spec/features/gallery_spec.rb +2 -2
- data/spec/test_app_templates/Gemfile.extra +5 -0
- data/spec/views/catalog/_document_slideshow.html.erb_spec.rb +9 -3
- metadata +15 -23
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 0fe613439f90948ab6f8348ebd898a8dbcd50a39b09f537f26208b998ac7ca28
         | 
| 4 | 
            +
              data.tar.gz: b87f85234155f5757efd197c22ba7ee8ab1663d9e9f6b19a1a38a03e59a76206
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 213771e22b7aad6533c89ec7e360d1e20134d90560d89826c2db0b326f88d8c3e8dcf1b71c94fb17ea5c6fe1212d922337f001fa97a1fa8cd60a7f7457ca1214
         | 
| 7 | 
            +
              data.tar.gz: c0991767ff1d83f0c08b61f36b6473796666e39748270b3bb42be6632ec97bc788f91e5b0bcc993560630b3e876c621387f81a7f9966f3c88065f6ff4658751c
         | 
    
        data/.github/workflows/ruby.yml
    CHANGED
    
    | @@ -2,26 +2,36 @@ name: CI | |
| 2 2 |  | 
| 3 3 | 
             
            on:
         | 
| 4 4 | 
             
              push:
         | 
| 5 | 
            -
                branches: [  | 
| 5 | 
            +
                branches: [ main ]
         | 
| 6 6 | 
             
              pull_request:
         | 
| 7 | 
            -
                branches: [  | 
| 7 | 
            +
                branches: [ main ]
         | 
| 8 8 |  | 
| 9 9 | 
             
            jobs:
         | 
| 10 10 | 
             
              test:
         | 
| 11 11 | 
             
                runs-on: ubuntu-latest
         | 
| 12 | 
            +
                continue-on-error: ${{ matrix.experimental }}
         | 
| 12 13 | 
             
                strategy:
         | 
| 13 14 | 
             
                  matrix:
         | 
| 14 | 
            -
                     | 
| 15 | 
            -
                     | 
| 15 | 
            +
                    ruby: [2.7, '3.0']
         | 
| 16 | 
            +
                    rails_version: ['6.1.7', '7.0.4']
         | 
| 17 | 
            +
                    blacklight_version: ['~> 7.0']
         | 
| 18 | 
            +
                    experimental: [false]
         | 
| 16 19 | 
             
                    include:
         | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
                       | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 20 | 
            +
                    - ruby: '3.1'
         | 
| 21 | 
            +
                      rails_version: '7.0.4'
         | 
| 22 | 
            +
                      blacklight_version: '~> 7.0'
         | 
| 23 | 
            +
                      experimental: false
         | 
| 24 | 
            +
                    - ruby: '3.1'
         | 
| 25 | 
            +
                      rails_version: '7.0.4'
         | 
| 26 | 
            +
                      blacklight_version: '8.0.0.beta6'
         | 
| 27 | 
            +
                      experimental: false
         | 
| 28 | 
            +
                    - ruby: '3.1'
         | 
| 29 | 
            +
                      rails_version: '7.0.4'
         | 
| 30 | 
            +
                      blacklight_version: 'github'
         | 
| 31 | 
            +
                      experimental: true
         | 
| 23 32 | 
             
                env:
         | 
| 24 33 | 
             
                  RAILS_VERSION: ${{ matrix.rails_version }}
         | 
| 34 | 
            +
                  BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
         | 
| 25 35 | 
             
                steps:
         | 
| 26 36 | 
             
                - uses: actions/checkout@v2
         | 
| 27 37 | 
             
                - name: Set up Ruby ${{ matrix.ruby }}
         | 
| @@ -1,4 +1,8 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            <% component = Blacklight::VERSION > '8' ?
         | 
| 2 | 
            +
              Blacklight::DocumentComponent.new(classes: 'col', component: :div, document: @presenter, counter: @counter) :
         | 
| 3 | 
            +
              Blacklight::DocumentComponent.new(classes: 'col', component: :div, document: @document, presenter: @presenter, counter: @counter)
         | 
| 4 | 
            +
            %> 
         | 
| 5 | 
            +
            <%= render(component) do |component| %>
         | 
| 2 6 | 
             
              <% component.body do %>
         | 
| 3 7 | 
             
                <div class="thumbnail-container">
         | 
| 4 8 | 
             
                  <%= thumbnail %>
         | 
| @@ -1,4 +1,8 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            <% component = Blacklight::VERSION > '8' ?
         | 
| 2 | 
            +
              Blacklight::DocumentComponent.new(classes: 'slideshow-preview-thumbnail', component: :div, document: @presenter, counter: @counter) :
         | 
| 3 | 
            +
              Blacklight::DocumentComponent.new(classes: 'slideshow-preview-thumbnail', component: :div, document: @document, presenter: @presenter, counter: @counter)
         | 
| 4 | 
            +
            %> 
         | 
| 5 | 
            +
            <%= render(component) do |component| %>
         | 
| 2 6 | 
             
              <% component.body do %>
         | 
| 3 7 | 
             
                <%= @view_context.link_to_document(@document, thumbnail, class: 'thumbnail', data: { 'context-href': nil, 'slide-to': @document_counter - 1, toggle: "modal", target: "#slideshow-modal" }) %>
         | 
| 4 8 | 
             
              <% end %>
         | 
| @@ -1,6 +1,7 @@ | |
| 1 1 | 
             
            <% view_config = local_assigns[:view_config] || blacklight_config&.view_config(document_index_view_type) %>
         | 
| 2 2 | 
             
            <div class="container">
         | 
| 3 3 | 
             
              <div id="documents" class="<%= (Array(view_config.classes || 'row-cols-2 row-cols-md-3') + ["row documents-#{view_config.key}"]).join(' ') %>">
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                <% document_presenters = Blacklight::VERSION > '8' ? documents.map { |doc| document_presenter(doc) } : documents %>
         | 
| 5 | 
            +
                <%= render view_config.document_component.with_collection(document_presenters, counter_offset: @response&.start || 0) %>
         | 
| 5 6 | 
             
              </div>
         | 
| 6 7 | 
             
            </div>
         | 
| @@ -1,4 +1,5 @@ | |
| 1 1 | 
             
            <% view_config = local_assigns[:view_config] || blacklight_config&.view_config(document_index_view_type) %>
         | 
| 2 2 | 
             
            <div id="documents" class="<%= (Array(view_config.classes) + ["documents-#{view_config.key}"]).join(' ') %>">
         | 
| 3 | 
            -
               | 
| 3 | 
            +
              <% document_presenters = Blacklight::VERSION > '8' ? documents.map { |doc| document_presenter(doc) } : documents%>
         | 
| 4 | 
            +
              <%= render view_config.document_component.with_collection(document_presenters, counter_offset: @response&.start || 0) %>
         | 
| 4 5 | 
             
            </div>
         | 
| @@ -1,23 +1,24 @@ | |
| 1 1 | 
             
            <% view_config = local_assigns[:view_config] || blacklight_config&.view_config(document_index_view_type) %>
         | 
| 2 2 |  | 
| 3 3 | 
             
            <div id="documents" class="<%= (Array(view_config.classes) + ["documents-#{view_config.key}"]).join(' ') %>">
         | 
| 4 | 
            +
              <% document_presenters = Blacklight::VERSION > '8' ? documents.map { |document| document_presenter(document) }: documents %>
         | 
| 4 5 | 
             
              <div class="grid">
         | 
| 5 | 
            -
                <%= render((view_config.preview_component || Blacklight::Gallery::SlideshowPreviewComponent).with_collection( | 
| 6 | 
            +
                <%= render((view_config.preview_component || Blacklight::Gallery::SlideshowPreviewComponent).with_collection(document_presenters)) %>
         | 
| 6 7 | 
             
              </div>
         | 
| 7 8 |  | 
| 8 9 | 
             
              <%= render layout: 'slideshow_modal' do %>
         | 
| 9 10 | 
             
                <div id="slideshow" class="slideshow-presenter">
         | 
| 10 11 | 
             
                  <!-- Wrapper for slides -->
         | 
| 11 12 | 
             
                  <div class="slideshow-inner">
         | 
| 12 | 
            -
                    <%= render  | 
| 13 | 
            +
                    <%= render view_config.document_component.with_collection(document_presenters, counter_offset: @response&.start || 0) %>
         | 
| 13 14 | 
             
                  </div>
         | 
| 14 15 |  | 
| 15 16 | 
             
                  <!-- Controls -->
         | 
| 16 17 | 
             
                  <a class="left carousel-control prev" href="#slideshow" data-slide="prev">
         | 
| 17 | 
            -
                    <%= blacklight_icon 'chevron_left',  | 
| 18 | 
            +
                    <%= blacklight_icon 'chevron_left', additional_options: { label_context: 'previous_image' } %>
         | 
| 18 19 | 
             
                  </a>
         | 
| 19 20 | 
             
                  <a class="right carousel-control next" href="#slideshow" data-slide="next">
         | 
| 20 | 
            -
                    <%= blacklight_icon 'chevron_right',  | 
| 21 | 
            +
                    <%= blacklight_icon 'chevron_right', additional_options: { label_context: 'next_image' } %>
         | 
| 21 22 | 
             
                  </a>
         | 
| 22 23 |  | 
| 23 24 | 
             
                  <div class="controls text-center">
         | 
    
        data/blacklight-gallery.gemspec
    CHANGED
    
    | @@ -17,12 +17,12 @@ Gem::Specification.new do |spec| | |
| 17 17 | 
             
              spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
         | 
| 18 18 | 
             
              spec.require_paths = ["lib"]
         | 
| 19 19 |  | 
| 20 | 
            -
              spec.add_dependency "rails", '>=  | 
| 21 | 
            -
              spec.add_dependency 'blacklight', ' | 
| 20 | 
            +
              spec.add_dependency "rails", '>= 6.1', '< 8'
         | 
| 21 | 
            +
              spec.add_dependency 'blacklight', '>= 7.17', '< 9'
         | 
| 22 22 |  | 
| 23 23 | 
             
              spec.add_development_dependency "rake"
         | 
| 24 24 | 
             
              spec.add_development_dependency 'sqlite3'
         | 
| 25 | 
            -
              spec.add_development_dependency "rspec-rails", "~>  | 
| 25 | 
            +
              spec.add_development_dependency "rspec-rails", "~> 6"
         | 
| 26 26 | 
             
              spec.add_development_dependency "rspec-its"
         | 
| 27 27 | 
             
              spec.add_development_dependency "rspec-activemodel-mocks"
         | 
| 28 28 | 
             
              spec.add_development_dependency "rspec-collection_matchers"
         | 
| @@ -30,6 +30,5 @@ Gem::Specification.new do |spec| | |
| 30 30 | 
             
              spec.add_development_dependency "engine_cart", "~> 2.0"
         | 
| 31 31 | 
             
              spec.add_development_dependency "capybara"
         | 
| 32 32 | 
             
              spec.add_development_dependency 'webdrivers'
         | 
| 33 | 
            -
              spec.add_development_dependency 'rexml' # pending https://github.com/SeleniumHQ/selenium/issues/9001
         | 
| 34 33 | 
             
              spec.add_development_dependency "selenium-webdriver", '>= 3.13.1'
         | 
| 35 34 | 
             
            end
         | 
| @@ -5,15 +5,6 @@ module BlacklightGallery | |
| 5 5 |  | 
| 6 6 | 
             
                source_root File.expand_path('../templates', __FILE__)
         | 
| 7 7 |  | 
| 8 | 
            -
                def assets
         | 
| 9 | 
            -
                  copy_file "blacklight_gallery.css.scss", "app/assets/stylesheets/blacklight_gallery.css.scss"
         | 
| 10 | 
            -
                  copy_file "blacklight_gallery.js", "app/assets/javascripts/blacklight_gallery.js"
         | 
| 11 | 
            -
             | 
| 12 | 
            -
                  insert_into_file "app/assets/javascripts/application.js", after: '//= require blacklight/blacklight' do
         | 
| 13 | 
            -
                    "\n//= require blacklight_gallery"
         | 
| 14 | 
            -
                  end
         | 
| 15 | 
            -
                end
         | 
| 16 | 
            -
             | 
| 17 8 | 
             
                def configuration
         | 
| 18 9 | 
             
                  inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
         | 
| 19 10 | 
             
                    "\n    config.view.gallery(document_component: Blacklight::Gallery::DocumentComponent)" \
         | 
| @@ -35,5 +26,14 @@ module BlacklightGallery | |
| 35 26 | 
             
                  Bundler.with_clean_env { run 'bundle install' }
         | 
| 36 27 | 
             
                  generate 'openseadragon:install'
         | 
| 37 28 | 
             
                end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                def assets
         | 
| 31 | 
            +
                  copy_file "blacklight_gallery.css.scss", "app/assets/stylesheets/blacklight_gallery.css.scss"
         | 
| 32 | 
            +
                  copy_file "blacklight_gallery.js", "app/assets/javascripts/blacklight_gallery.js"
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                  insert_into_file "app/assets/javascripts/application.js", after: '//= require blacklight/blacklight' do
         | 
| 35 | 
            +
                    "\n//= require blacklight_gallery"
         | 
| 36 | 
            +
                  end
         | 
| 37 | 
            +
                end
         | 
| 38 38 | 
             
              end
         | 
| 39 39 | 
             
            end
         | 
    
        data/solr/conf/solrconfig.xml
    CHANGED
    
    | @@ -18,6 +18,7 @@ | |
| 18 18 |  | 
| 19 19 | 
             
              <!-- solr lib dirs -->
         | 
| 20 20 | 
             
              <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
         | 
| 21 | 
            +
              <lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
         | 
| 21 22 | 
             
              <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
         | 
| 22 23 |  | 
| 23 24 | 
             
              <dataDir>${solr.data.dir:}</dataDir>
         | 
| @@ -3,7 +3,13 @@ | |
| 3 3 | 
             
            require 'spec_helper'
         | 
| 4 4 |  | 
| 5 5 | 
             
            RSpec.describe Blacklight::Gallery::DocumentComponent, type: :component do
         | 
| 6 | 
            -
              subject(:component)  | 
| 6 | 
            +
              subject(:component) do
         | 
| 7 | 
            +
                if Blacklight::VERSION > '8'
         | 
| 8 | 
            +
                  described_class.new(document: presenter, **attr)
         | 
| 9 | 
            +
                else
         | 
| 10 | 
            +
                  described_class.new(document: document, presenter: presenter, **attr)
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
              end
         | 
| 7 13 |  | 
| 8 14 | 
             
              let(:attr) { {} }
         | 
| 9 15 | 
             
              let(:view_context) { controller.view_context }
         | 
| @@ -27,7 +33,11 @@ RSpec.describe Blacklight::Gallery::DocumentComponent, type: :component do | |
| 27 33 |  | 
| 28 34 | 
             
              let(:blacklight_config) do
         | 
| 29 35 | 
             
                CatalogController.blacklight_config.deep_copy.tap do |config|
         | 
| 30 | 
            -
                   | 
| 36 | 
            +
                  if Blacklight::VERSION > '8'
         | 
| 37 | 
            +
                    config.track_search_session.storage = false
         | 
| 38 | 
            +
                  else
         | 
| 39 | 
            +
                    config.track_search_session = false
         | 
| 40 | 
            +
                  end
         | 
| 31 41 | 
             
                  config.index.thumbnail_field = 'thumbnail_path_ss'
         | 
| 32 42 | 
             
                end
         | 
| 33 43 | 
             
              end
         | 
| @@ -3,7 +3,13 @@ | |
| 3 3 | 
             
            require 'spec_helper'
         | 
| 4 4 |  | 
| 5 5 | 
             
            RSpec.describe Blacklight::Gallery::SlideshowComponent, type: :component do
         | 
| 6 | 
            -
              subject(:component)  | 
| 6 | 
            +
              subject(:component) do
         | 
| 7 | 
            +
                if Blacklight::VERSION > '8'
         | 
| 8 | 
            +
                  described_class.new(document: presenter, **attr)
         | 
| 9 | 
            +
                else
         | 
| 10 | 
            +
                  described_class.new(document: document, presenter: presenter, **attr)
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
              end
         | 
| 7 13 |  | 
| 8 14 | 
             
              let(:attr) { {} }
         | 
| 9 15 | 
             
              let(:view_context) { controller.view_context }
         | 
| @@ -36,7 +42,11 @@ RSpec.describe Blacklight::Gallery::SlideshowComponent, type: :component do | |
| 36 42 | 
             
                  let(:blacklight_config) do
         | 
| 37 43 | 
             
                    Blacklight::Configuration.new.tap do |config|
         | 
| 38 44 | 
             
                      config.index.slideshow_method = :xyz
         | 
| 39 | 
            -
                       | 
| 45 | 
            +
                      if Blacklight::VERSION > '8'
         | 
| 46 | 
            +
                        config.track_search_session.storage = false
         | 
| 47 | 
            +
                      else
         | 
| 48 | 
            +
                        config.track_search_session = false
         | 
| 49 | 
            +
                      end
         | 
| 40 50 | 
             
                    end
         | 
| 41 51 | 
             
                  end
         | 
| 42 52 |  | 
| @@ -55,7 +65,11 @@ RSpec.describe Blacklight::Gallery::SlideshowComponent, type: :component do | |
| 55 65 | 
             
                  let(:blacklight_config) do
         | 
| 56 66 | 
             
                    Blacklight::Configuration.new.tap do |config|
         | 
| 57 67 | 
             
                      config.index.slideshow_field = :xyz 
         | 
| 58 | 
            -
                       | 
| 68 | 
            +
                      if Blacklight::VERSION > '8'
         | 
| 69 | 
            +
                        config.track_search_session.storage = false
         | 
| 70 | 
            +
                      else
         | 
| 71 | 
            +
                        config.track_search_session = false
         | 
| 72 | 
            +
                      end
         | 
| 59 73 | 
             
                    end
         | 
| 60 74 | 
             
                  end
         | 
| 61 75 | 
             
                  let(:document) { SolrDocument.new({ xyz: 'http://example.com/some.jpg', id: 'x' }) }
         | 
| @@ -70,9 +84,15 @@ RSpec.describe Blacklight::Gallery::SlideshowComponent, type: :component do | |
| 70 84 | 
             
                end
         | 
| 71 85 |  | 
| 72 86 | 
             
                context 'with no view_config' do
         | 
| 73 | 
            -
                  let(:blacklight_config)  | 
| 74 | 
            -
                     | 
| 75 | 
            -
             | 
| 87 | 
            +
                  let(:blacklight_config) do
         | 
| 88 | 
            +
                    Blacklight::Configuration.new.tap do |config| 
         | 
| 89 | 
            +
                      if Blacklight::VERSION > '8'
         | 
| 90 | 
            +
                        config.track_search_session.storage = false
         | 
| 91 | 
            +
                      else
         | 
| 92 | 
            +
                        config.track_search_session = false
         | 
| 93 | 
            +
                      end
         | 
| 94 | 
            +
                    end
         | 
| 95 | 
            +
                  end
         | 
| 76 96 | 
             
                  it { is_expected.not_to have_selector 'img' }
         | 
| 77 97 | 
             
                end
         | 
| 78 98 |  | 
| @@ -80,7 +100,11 @@ RSpec.describe Blacklight::Gallery::SlideshowComponent, type: :component do | |
| 80 100 | 
             
                  let(:blacklight_config) do
         | 
| 81 101 | 
             
                    Blacklight::Configuration.new.tap do |config|
         | 
| 82 102 | 
             
                      config.index.thumbnail_field = :xyz 
         | 
| 83 | 
            -
                       | 
| 103 | 
            +
                      if Blacklight::VERSION > '8'
         | 
| 104 | 
            +
                        config.track_search_session.storage = false
         | 
| 105 | 
            +
                      else
         | 
| 106 | 
            +
                        config.track_search_session = false
         | 
| 107 | 
            +
                      end
         | 
| 84 108 | 
             
                    end
         | 
| 85 109 | 
             
                  end
         | 
| 86 110 | 
             
                  let(:document) { SolrDocument.new({ xyz: 'http://example.com/thumb.jpg', id: 'x' }) }
         | 
| @@ -3,7 +3,13 @@ | |
| 3 3 | 
             
            require 'spec_helper'
         | 
| 4 4 |  | 
| 5 5 | 
             
            RSpec.describe Blacklight::Gallery::SlideshowPreviewComponent, type: :component do
         | 
| 6 | 
            -
              subject(:component)  | 
| 6 | 
            +
              subject(:component) do
         | 
| 7 | 
            +
                if Blacklight::VERSION > '8'
         | 
| 8 | 
            +
                  described_class.new(document: presenter, document_counter: 5, **attr)
         | 
| 9 | 
            +
                else
         | 
| 10 | 
            +
                  described_class.new(document: document, document_counter: 5, presenter: presenter, **attr)
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
              end
         | 
| 7 13 |  | 
| 8 14 | 
             
              let(:attr) { {} }
         | 
| 9 15 | 
             
              let(:view_context) { controller.view_context }
         | 
| @@ -30,7 +36,11 @@ RSpec.describe Blacklight::Gallery::SlideshowPreviewComponent, type: :component | |
| 30 36 | 
             
              let(:blacklight_config) do
         | 
| 31 37 | 
             
                Blacklight::Configuration.new.tap do |config|
         | 
| 32 38 | 
             
                  config.index.thumbnail_field = 'thumbnail_path_ss'
         | 
| 33 | 
            -
                   | 
| 39 | 
            +
                  if Blacklight::VERSION > '8'
         | 
| 40 | 
            +
                    config.track_search_session.storage = false
         | 
| 41 | 
            +
                  else
         | 
| 42 | 
            +
                    config.track_search_session = false
         | 
| 43 | 
            +
                  end
         | 
| 34 44 | 
             
                end
         | 
| 35 45 | 
             
              end
         | 
| 36 46 |  | 
| @@ -38,7 +48,6 @@ RSpec.describe Blacklight::Gallery::SlideshowPreviewComponent, type: :component | |
| 38 48 | 
             
                let(:document) { SolrDocument.new(id: 'abc', thumbnail_path_ss: 'http://example.com/image.jpg') }
         | 
| 39 49 |  | 
| 40 50 | 
             
                it 'renders the thumbnail' do
         | 
| 41 | 
            -
                  puts render
         | 
| 42 51 | 
             
                  expect(rendered).to have_selector '.thumbnail img[@src="http://example.com/image.jpg"]'
         | 
| 43 52 | 
             
                end
         | 
| 44 53 |  | 
| @@ -1,9 +1,9 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 | 
            -
            describe "Gallery view", :type => :feature do
         | 
| 3 | 
            +
            RSpec.describe "Gallery view", :type => :feature do
         | 
| 4 4 | 
             
              before { visit search_catalog_path :q => 'medicine', :view => 'gallery' }
         | 
| 5 5 |  | 
| 6 | 
            -
              it " | 
| 6 | 
            +
              it "displays results in a galley view" do
         | 
| 7 7 | 
             
                expect(page).to have_selector("#documents.documents-gallery")
         | 
| 8 8 | 
             
                expect(page).to have_selector(".caption", text: "Strong Medicine speaks")
         | 
| 9 9 | 
             
              end
         | 
| @@ -1,13 +1,18 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 | 
            -
            describe "catalog/_document_slideshow", :type => :view do
         | 
| 3 | 
            +
            RSpec.describe "catalog/_document_slideshow", :type => :view do
         | 
| 4 4 | 
             
              let(:blacklight_config) do
         | 
| 5 5 | 
             
                Blacklight::Configuration.new do |config|
         | 
| 6 | 
            -
                   | 
| 6 | 
            +
                  if Blacklight::VERSION > '8'
         | 
| 7 | 
            +
                    config.track_search_session.storage = false
         | 
| 8 | 
            +
                  else
         | 
| 9 | 
            +
                    config.track_search_session = false
         | 
| 10 | 
            +
                  end
         | 
| 7 11 | 
             
                end
         | 
| 8 12 | 
             
              end
         | 
| 9 13 |  | 
| 10 14 | 
             
              let(:document) { stub_model(::SolrDocument) }
         | 
| 15 | 
            +
              let(:view_config) { Blacklight::Configuration::ViewConfig.new(document_component: Blacklight::Gallery::SlideshowComponent) }
         | 
| 11 16 |  | 
| 12 17 | 
             
              before do
         | 
| 13 18 | 
             
                allow(view).to receive_messages(
         | 
| @@ -19,10 +24,11 @@ describe "catalog/_document_slideshow", :type => :view do | |
| 19 24 | 
             
                allow(view).to receive(:current_search_session).and_return(nil)
         | 
| 20 25 | 
             
                allow(view).to receive(:search_session).and_return({})
         | 
| 21 26 | 
             
                allow(view).to receive(:search_state).and_return(Blacklight::SearchState.new({}, blacklight_config))
         | 
| 27 | 
            +
                @response = instance_double(Blacklight::Solr::Response, start: 0)
         | 
| 22 28 | 
             
              end
         | 
| 23 29 |  | 
| 24 30 | 
             
              it 'has a modal' do
         | 
| 25 | 
            -
                render
         | 
| 31 | 
            +
                render 'catalog/document_slideshow', view_config: view_config
         | 
| 26 32 | 
             
                expect(rendered).to have_selector '#slideshow-modal'
         | 
| 27 33 | 
             
                expect(rendered).to have_selector '[data-slide="prev"]'
         | 
| 28 34 | 
             
                expect(rendered).to have_selector '[data-slide="next"]'
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: blacklight-gallery
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 4.0 | 
| 4 | 
            +
              version: 4.1.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Chris Beer
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2023-02-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -16,7 +16,7 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - ">="
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: ' | 
| 19 | 
            +
                    version: '6.1'
         | 
| 20 20 | 
             
                - - "<"
         | 
| 21 21 | 
             
                  - !ruby/object:Gem::Version
         | 
| 22 22 | 
             
                    version: '8'
         | 
| @@ -26,7 +26,7 @@ dependencies: | |
| 26 26 | 
             
                requirements:
         | 
| 27 27 | 
             
                - - ">="
         | 
| 28 28 | 
             
                  - !ruby/object:Gem::Version
         | 
| 29 | 
            -
                    version: ' | 
| 29 | 
            +
                    version: '6.1'
         | 
| 30 30 | 
             
                - - "<"
         | 
| 31 31 | 
             
                  - !ruby/object:Gem::Version
         | 
| 32 32 | 
             
                    version: '8'
         | 
| @@ -34,16 +34,22 @@ dependencies: | |
| 34 34 | 
             
              name: blacklight
         | 
| 35 35 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 36 36 | 
             
                requirements:
         | 
| 37 | 
            -
                - - " | 
| 37 | 
            +
                - - ">="
         | 
| 38 38 | 
             
                  - !ruby/object:Gem::Version
         | 
| 39 39 | 
             
                    version: '7.17'
         | 
| 40 | 
            +
                - - "<"
         | 
| 41 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 42 | 
            +
                    version: '9'
         | 
| 40 43 | 
             
              type: :runtime
         | 
| 41 44 | 
             
              prerelease: false
         | 
| 42 45 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 43 46 | 
             
                requirements:
         | 
| 44 | 
            -
                - - " | 
| 47 | 
            +
                - - ">="
         | 
| 45 48 | 
             
                  - !ruby/object:Gem::Version
         | 
| 46 49 | 
             
                    version: '7.17'
         | 
| 50 | 
            +
                - - "<"
         | 
| 51 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 52 | 
            +
                    version: '9'
         | 
| 47 53 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 48 54 | 
             
              name: rake
         | 
| 49 55 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -78,14 +84,14 @@ dependencies: | |
| 78 84 | 
             
                requirements:
         | 
| 79 85 | 
             
                - - "~>"
         | 
| 80 86 | 
             
                  - !ruby/object:Gem::Version
         | 
| 81 | 
            -
                    version: ' | 
| 87 | 
            +
                    version: '6'
         | 
| 82 88 | 
             
              type: :development
         | 
| 83 89 | 
             
              prerelease: false
         | 
| 84 90 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 85 91 | 
             
                requirements:
         | 
| 86 92 | 
             
                - - "~>"
         | 
| 87 93 | 
             
                  - !ruby/object:Gem::Version
         | 
| 88 | 
            -
                    version: ' | 
| 94 | 
            +
                    version: '6'
         | 
| 89 95 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 90 96 | 
             
              name: rspec-its
         | 
| 91 97 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -184,20 +190,6 @@ dependencies: | |
| 184 190 | 
             
                - - ">="
         | 
| 185 191 | 
             
                  - !ruby/object:Gem::Version
         | 
| 186 192 | 
             
                    version: '0'
         | 
| 187 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 188 | 
            -
              name: rexml
         | 
| 189 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 190 | 
            -
                requirements:
         | 
| 191 | 
            -
                - - ">="
         | 
| 192 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 193 | 
            -
                    version: '0'
         | 
| 194 | 
            -
              type: :development
         | 
| 195 | 
            -
              prerelease: false
         | 
| 196 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 197 | 
            -
                requirements:
         | 
| 198 | 
            -
                - - ">="
         | 
| 199 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 200 | 
            -
                    version: '0'
         | 
| 201 193 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 202 194 | 
             
              name: selenium-webdriver
         | 
| 203 195 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -326,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 326 318 | 
             
                - !ruby/object:Gem::Version
         | 
| 327 319 | 
             
                  version: '0'
         | 
| 328 320 | 
             
            requirements: []
         | 
| 329 | 
            -
            rubygems_version: 3. | 
| 321 | 
            +
            rubygems_version: 3.3.26
         | 
| 330 322 | 
             
            signing_key:
         | 
| 331 323 | 
             
            specification_version: 4
         | 
| 332 324 | 
             
            summary: Gallery display for Blacklight
         |