Skip to content

Commit

Permalink
Fix: missing roots display (#348)
Browse files Browse the repository at this point in the history
* remove dead code

* return the first concept if there is no roots

* return AlertMessageComponent if skos and empty roots

* Fix message text
  • Loading branch information
SirineMhedhbi authored Oct 3, 2023
1 parent 2a56df7 commit b7cdcbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ def get_class(params)
root_child = @root.children.first

@concept = root_child.explore.self(full: true)
# Some ontologies have "too many children" at their root. These will not process and are handled here.
if @concept.nil?
# Some ontologies have "too many children" at their root. These will not process and are handled here.
if @concept.nil?
LOG.add :debug, "Missing class #{root_child.links.self}"
not_found("Missing class #{root_child.links.self}")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- if skos? && @roots.empty?
%div.text-wrap
= render AlertMessageComponent.new do
Missing roots for #{@ontology.acronym}
Missing roots for #{@ontology.acronym} (skos:topConceptOf)
- else
= render TurboFrameComponent.new(id: 'concepts_tree_view',
src: "/ajax/classes/treeview?ontology=#{@ontology.acronym}&conceptid=#{escape(@concept.id)}&concept_schemes=#{params[:concept_schemes]}&auto_click=false",
Expand Down

0 comments on commit b7cdcbe

Please sign in to comment.