Sha256: 0970e4f0fc1b7af6b9db475b44a5065a42cc603ad06b2620562c80b6b42b118e

Contents?: true

Size: 923 Bytes

Versions: 28

Compression:

Stored size: 923 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module My
    class HighlightsController < MyController
      configure_blacklight do |config|
        config.search_builder_class = Hyrax::My::HighlightsSearchBuilder
      end

      def index
        super
      end

      private

      def search_action_url(*args)
        hyrax.dashboard_highlights_url(*args)
      end

      def query_solr
        return empty_search_result if Hyrax::TrophyPresenter.find_by_user(@user).count.zero?
        super
      end

      def empty_search_result
        solr_response = Blacklight::Solr::Response.new(empty_request, {})
        docs = []
        [solr_response, docs]
      end

      def empty_request
        {
          responseHeader: {
            status: 0,
            params: { wt: 'ruby', rows: '11', q: '*:*' }
          },
          response: { numFound: 0, start: 0, docs: [] }
        }
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.4 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.3 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.2 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.0 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.0.rc3 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.0.rc2 app/controllers/hyrax/my/highlights_controller.rb
hyrax-5.0.0.rc1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-3.6.0 app/controllers/hyrax/my/highlights_controller.rb
hyrax-4.0.0 app/controllers/hyrax/my/highlights_controller.rb
hyrax-4.0.0.rc3 app/controllers/hyrax/my/highlights_controller.rb
hyrax-4.0.0.rc2 app/controllers/hyrax/my/highlights_controller.rb
hyrax-4.0.0.rc1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-3.5.0 app/controllers/hyrax/my/highlights_controller.rb
hyrax-4.0.0.beta2 app/controllers/hyrax/my/highlights_controller.rb
hyrax-3.4.2 app/controllers/hyrax/my/highlights_controller.rb
hyrax-4.0.0.beta1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-3.4.1 app/controllers/hyrax/my/highlights_controller.rb
hyrax-3.4.0 app/controllers/hyrax/my/highlights_controller.rb