Skip to content

Commit

Permalink
move the conde in search helper to a concern
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Apr 10, 2024
1 parent f52dc23 commit e22273b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module SearchHelper

module SearchContent
extend ActiveSupport::Concern
def search_ontologies(query: '*', groups: [], categories: [], languages: [], private_only: false, formats: [],
is_of_type: [], formality_level: [],
show_views: false, status: 'alpha,beta,production',
Expand Down Expand Up @@ -87,10 +87,6 @@ def search_ontologies_content(query:, page: 1, page_size: 10, filter_by_ontologi
[result, ontologies, selected_onto, query]
end

def search_agents
# TODO
end

private

def search_result_to_json(query, changed_query, results, ontologies, selected_onto = [])
Expand Down Expand Up @@ -174,5 +170,5 @@ def link_by_type(id, ontology, type)
ontology_path(id: ontology, p: 'summary')
end
end

end

3 changes: 2 additions & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require 'uri'

class SearchController < ApplicationController
include SearchAggregator, SearchHelper
include SearchAggregator, SearchContent

skip_before_action :verify_authenticity_token

layout :determine_layout
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/auto_complete_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def ontologies_autocomplete

def ontologies_content_autocomplete(id: '', name: '')
render SearchInputComponent.new(id: id, name: name, ajax_url: ajax_search_ontologies_content_path(search: ''),
item_base_url: "", id_key: 'id', placeholder: "Search everywhere anything",
item_base_url: "", id_key: 'id', placeholder: t("ontologies.ontology_search_prompt"),
use_cache: false,
actions_links: { search_ontology_content: "/search?query=o", browse_all_ontologies: "/ontologies?search=o" }) do |s|
s.template do
Expand Down

0 comments on commit e22273b

Please sign in to comment.