Sha256: 62e02aa12c92b0292b4c1d562ecd45473a135f4f86e96fc2f20da770e54a6cde

Contents?: true

Size: 721 Bytes

Versions: 48

Compression:

Stored size: 721 Bytes

Contents

module Qa::Authorities
  class FindWorks < Qa::Authorities::Base
    class_attribute :search_builder_class
    self.search_builder_class = Hyrax::My::FindWorksSearchBuilder

    def search(_q, controller)
      # The My::FindWorksSearchBuilder expects a current_user
      return [] unless controller.current_user
      repo = CatalogController.new.repository
      builder = search_builder(controller)
      response = repo.search(builder)
      docs = response.documents
      docs.map do |doc|
        id = doc.id
        title = doc.title
        { id: id, label: title, value: id }
      end
    end

    private

      def search_builder(controller)
        search_builder_class.new(controller)
      end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/authorities/qa/authorities/find_works.rb
hyrax-2.9.5 app/authorities/qa/authorities/find_works.rb
hyrax-2.9.4 app/authorities/qa/authorities/find_works.rb
hyrax-2.9.3 app/authorities/qa/authorities/find_works.rb
hyrax-2.9.2 app/authorities/qa/authorities/find_works.rb
hyrax-2.9.1 app/authorities/qa/authorities/find_works.rb
hyrax-2.9.0 app/authorities/qa/authorities/find_works.rb
hyrax-2.8.0 app/authorities/qa/authorities/find_works.rb
hyrax-2.7.2 app/authorities/qa/authorities/find_works.rb
hyrax-2.7.1 app/authorities/qa/authorities/find_works.rb
hyrax-2.7.0 app/authorities/qa/authorities/find_works.rb
hyrax-2.6.0 app/authorities/qa/authorities/find_works.rb
hyrax-3.0.0.pre.rc1 app/authorities/qa/authorities/find_works.rb
hyrax-3.0.0.pre.beta3 app/authorities/qa/authorities/find_works.rb
hyrax-2.5.1 app/authorities/qa/authorities/find_works.rb
hyrax-2.5.0 app/authorities/qa/authorities/find_works.rb
hyrax-3.0.0.pre.beta2 app/authorities/qa/authorities/find_works.rb
hyrax-2.4.1 app/authorities/qa/authorities/find_works.rb
hyrax-3.0.0.pre.beta1 app/authorities/qa/authorities/find_works.rb
hyrax-2.4.0 app/authorities/qa/authorities/find_works.rb