Skip to content

Commit

Permalink
Fix: clean concepts controller code to improve tree view performance (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal authored Oct 30, 2024
1 parent 1e4b809 commit d67ba52
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/controllers/concepts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ def index
@ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology]).first
@ob_instructions = helpers.ontolobridge_instructions_template(@ontology)

@submission = @ontology.explore.latest_submission(include: 'all')
@submission = @ontology.explore.latest_submission(include:'uriRegexPattern,preferredNamespaceUri')

@concept = @ontology.explore.single_class({dispay: 'prefLabel'}, params[:id])

@concept = @ontology.explore.single_class({full: true}, params[:id])
concept_not_found(params[:id]) if @concept.nil?
@schemes = params[:concept_schemes].split(',')

@concept.children = @concept.explore.children(pagesize: 750, concept_schemes: Array(@schemes).join(','), language: request_lang, display: 'prefLabel,obsolete,hasChildren').collection || []
@concept.children.sort! { |x, y| (x.prefLabel || "").downcase <=> (y.prefLabel || "").downcase } unless @concept.children.empty?

render turbo_stream: [
replace(helpers.child_id(@concept) + '_open_link') { TreeLinkComponent.tree_close_icon },
replace(helpers.child_id(@concept) + '_childs') do
Expand Down

0 comments on commit d67ba52

Please sign in to comment.