# frozen_string_literal: true class AnnotationReflex < ApplicationReflex include DocumentSearch include AnnotationSearch def render_document_search_results(search_params) search = document_search(search_params.merge(sort_by: %w[reference_number_texts title_texts short_title_texts])) @documents = search.results opts = { current_page: search_params[:page], q: search_params[:q] } morph "#annotatedDocumentsSearchResults", render(partial: "/shared/annotated_documents_search_results", locals: { documents: @documents, opts: opts }) end def render_annotations_views(search_params) search = annotation_search(search_params) @annotations = search.results morph "#annotationsIndexView", render(partial: "/shared/annotations_index_view", locals: { annotations: @annotations, opts: { doctrine_id: search_params[:doctrine_id], current_page: search_params[:page] } }) end def render_default_case_lists_search(doctrine_id) morph "#caseListsCollapse", render(partial: "/shared/case_lists_no_results", locals: { doctrine_id: doctrine_id }) end end