From c1d9423037babd489fbb380593fdc05afde63001 Mon Sep 17 00:00:00 2001 From: Bilel KIHAL Date: Wed, 30 Oct 2024 09:56:06 +0100 Subject: [PATCH] clean concepts controller code to improve tree view performance --- app/controllers/concepts_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/concepts_controller.rb b/app/controllers/concepts_controller.rb index 196a61f97d..1063c953b4 100644 --- a/app/controllers/concepts_controller.rb +++ b/app/controllers/concepts_controller.rb @@ -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