Skip to content

Commit

Permalink
Fix: Include views in ontologies selector of search page (#784)
Browse files Browse the repository at this point in the history
* include views in ontologies selector

* refactored onts_for_select to have the option to include views and by default no

---------

Co-authored-by: Syphax <[email protected]>
  • Loading branch information
Bilelkihal and syphax-bouazzouni authored Oct 26, 2024
1 parent d83e304 commit fea0612
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def error_message_alert
end
end

def onts_for_select
ontologies ||= LinkedData::Client::Models::Ontology.all(include: "acronym,name")
def onts_for_select(include_views: false)
ontologies ||= LinkedData::Client::Models::Ontology.all({include: "acronym,name", include_views: include_views})
onts_for_select = [['', '']]
ontologies.each do |ont|
next if ( ont.acronym.nil? or ont.acronym.empty? )
Expand Down
4 changes: 2 additions & 2 deletions app/views/search/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
.title
= t("search.advanced_options.ontologies")
.field
= ontologies_selector(id:'search_page_ontologies' ,name: 'ontologies[]', selected: params[:ontologies]&.split(','))
- if federation_enabled?
= ontologies_selector(id:'search_page_ontologies' ,name: 'ontologies[]', selected: params[:ontologies]&.split(','), ontologies: onts_for_select(include_views: true))
- if federation_enabled?
.filter-container
.title
= t('federation.results_from_external_portals')
Expand Down

0 comments on commit fea0612

Please sign in to comment.