From 18acf08509a400de6c24142f81154b16177b335a Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Tue, 12 Sep 2023 10:24:51 +0200 Subject: [PATCH 01/13] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 7 +++++-- app/services/issue_creator_service.rb | 25 +++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 86823ac28..101ed56f9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -145,7 +145,7 @@ GEM erubis (2.7.0) eventmachine (1.2.7) excon (0.102.0) - execjs (2.8.1) + execjs (2.9.0) faraday (2.0.1) faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) @@ -238,6 +238,8 @@ GEM netrc (0.11.0) newrelic_rpm (9.4.2) nio4r (2.5.9) + nokogiri (1.15.4-x86_64-darwin) + racc (~> 1.4) nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) oj (3.16.1) @@ -328,7 +330,7 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - rubocop (1.56.2) + rubocop (1.56.3) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -426,6 +428,7 @@ GEM zeitwerk (2.6.11) PLATFORMS + x86_64-darwin-21 x86_64-linux DEPENDENCIES diff --git a/app/services/issue_creator_service.rb b/app/services/issue_creator_service.rb index ee1b0b593..6af9a2eae 100644 --- a/app/services/issue_creator_service.rb +++ b/app/services/issue_creator_service.rb @@ -3,7 +3,16 @@ class IssueCreatorService < ApplicationService class QueryError < StandardError; end - FindRepoQuery = GitHub::Client.parse <<-'GRAPHQL' + + def initialize(params) + @title = params[:content][:title] + @body = params[:content][:body] + @repo = Rails.configuration.change_request.dig(:ontologies, params[:ont_acronym].to_sym, :repository) + end + + def call + + findRepoQuery = GitHub::Client.parse <<-'GRAPHQL' query ($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { id @@ -11,7 +20,7 @@ class QueryError < StandardError; end } GRAPHQL - CreateIssueMutation = GitHub::Client.parse <<-'GRAPHQL' + createIssueMutation = GitHub::Client.parse <<-'GRAPHQL' mutation ($repositoryId: ID!, $title: String!, $body: String) { createIssue(input: {repositoryId: $repositoryId, title: $title, body: $body}) { issue { @@ -28,16 +37,8 @@ class QueryError < StandardError; end } } GRAPHQL - - def initialize(params) - @title = params[:content][:title] - @body = params[:content][:body] - @repo = Rails.configuration.change_request.dig(:ontologies, params[:ont_acronym].to_sym, :repository) - end - - def call - data = query(FindRepoQuery, variables: { owner: repo_owner, name: repo_name }) - data = query(CreateIssueMutation, variables: { repositoryId: data.repository.id, title: @title, body: @body }) + data = query(findRepoQuery, variables: { owner: repo_owner, name: repo_name }) + data = query(createIssueMutation, variables: { repositoryId: data.repository.id, title: @title, body: @body }) data.to_h.dig('createIssue', 'issue') end From 2a56df77767033cfba0900f9f96f096a74f7b9f3 Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Tue, 12 Sep 2023 10:47:06 +0200 Subject: [PATCH 02/13] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 3 --- 1 file changed, 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 101ed56f9..2c7a8ade0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -238,8 +238,6 @@ GEM netrc (0.11.0) newrelic_rpm (9.4.2) nio4r (2.5.9) - nokogiri (1.15.4-x86_64-darwin) - racc (~> 1.4) nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) oj (3.16.1) @@ -428,7 +426,6 @@ GEM zeitwerk (2.6.11) PLATFORMS - x86_64-darwin-21 x86_64-linux DEPENDENCIES From b7cdcbe480dba9f292015c229592d4fcad15e618 Mon Sep 17 00:00:00 2001 From: SirineMhedhbi <31127782+SirineMhedhbi@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:53:21 +0200 Subject: [PATCH 03/13] Fix: missing roots display (#348) * remove dead code * return the first concept if there is no roots * return AlertMessageComponent if skos and empty roots * Fix message text --- app/controllers/application_controller.rb | 4 ++-- .../ontologies/concepts_browsers/_concepts_tree.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9559dc190..44c5e3911 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml b/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml index ba96119b0..f81816d5a 100644 --- a/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml +++ b/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml @@ -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", From 215ef307797ed70f77ba8a7c723202e28a445dbc Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Thu, 12 Oct 2023 22:10:16 +0200 Subject: [PATCH 04/13] fix detaching views from parent ontology on update (#354) --- app/controllers/ontologies_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/ontologies_controller.rb b/app/controllers/ontologies_controller.rb index cc473e0b3..c95ee776e 100644 --- a/app/controllers/ontologies_controller.rb +++ b/app/controllers/ontologies_controller.rb @@ -420,7 +420,7 @@ def update # Note: find_by_acronym includes ontology views @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology][:acronym] || params[:id]).first @ontology.update_from_params(ontology_params) - @ontology.viewOf = nil if @ontology.isView.eql? "0" + @ontology.viewOf = '' if @ontology.isView.eql? "0" error_response = @ontology.update if response_error?(error_response) @categories = LinkedData::Client::Models::Category.all From a91132fa809aa2affa2cd9fa02839c08c3f66268 Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Thu, 12 Oct 2023 22:14:11 +0200 Subject: [PATCH 05/13] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2c7a8ade0..4b69b1442 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,7 +84,7 @@ GEM tzinfo (~> 2.0) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) - airbrussh (1.4.2) + airbrussh (1.5.0) sshkit (>= 1.6.1, != 1.7.0) ast (2.4.2) autoprefixer-rails (10.4.15.0) @@ -132,7 +132,7 @@ GEM crass (1.0.6) cube-ruby (0.0.3) daemons (1.4.1) - dalli (3.2.5) + dalli (3.2.6) date (3.3.3) debug (1.8.0) irb (>= 1.5.0) @@ -144,8 +144,8 @@ GEM erubi (1.12.0) erubis (2.7.0) eventmachine (1.2.7) - excon (0.102.0) - execjs (2.9.0) + excon (0.104.0) + execjs (2.9.1) faraday (2.0.1) faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) @@ -155,11 +155,11 @@ GEM faraday-multipart (1.0.4) multipart-post (~> 2) faraday-net_http (2.1.0) - ffi (1.15.5) + ffi (1.16.3) flamegraph (0.9.5) globalid (1.2.1) activesupport (>= 6.1) - graphql (2.1.0) + graphql (2.1.2) graphql-client (0.18.0) activesupport (>= 3.0) graphql @@ -190,14 +190,14 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) - jsbundling-rails (1.1.2) + jsbundling-rails (1.2.1) railties (>= 6.0.0) json (2.6.3) language_server-protocol (3.17.0.3) listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.21.3) + loofah (2.21.4) crass (~> 1.0.2) nokogiri (>= 1.12.0) lz4-ruby (0.3.3) @@ -211,7 +211,7 @@ GEM method_source (1.0.0) mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2023.0808) + mime-types-data (3.2023.1003) mini_mime (1.1.5) minitest (5.20.0) msgpack (1.7.2) @@ -223,7 +223,7 @@ GEM time net-http (0.3.2) uri - net-imap (0.3.7) + net-imap (0.4.1) date net-protocol net-pop (0.1.2) @@ -232,18 +232,18 @@ GEM timeout net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol net-ssh (7.2.0) netrc (0.11.0) - newrelic_rpm (9.4.2) + newrelic_rpm (9.5.0) nio4r (2.5.9) nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) oj (3.16.1) open_uri_redirections (0.2.1) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc popper_js (1.16.1) @@ -302,8 +302,8 @@ GEM rdoc (6.3.3) recaptcha (5.9.0) json - regexp_parser (2.8.1) - reline (0.3.8) + regexp_parser (2.8.2) + reline (0.3.9) io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -328,12 +328,12 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - rubocop (1.56.3) + rubocop (1.57.0) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) @@ -373,9 +373,9 @@ GEM net-scp (>= 1.1.2) net-ssh (>= 2.8.0) stackprof (0.2.25) - stimulus-rails (1.2.2) + stimulus-rails (1.3.0) railties (>= 6.0.0) - temple (0.10.2) + temple (0.10.3) terser (1.1.18) execjs (>= 0.3.0, < 3) thin (1.8.2) @@ -383,11 +383,11 @@ GEM eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) thor (1.2.2) - tilt (2.2.0) + tilt (2.3.0) time (0.2.2) date timeout (0.4.0) - turbo-rails (1.4.0) + turbo-rails (1.5.0) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) @@ -401,7 +401,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) uri (0.12.2) view_component (2.82.0) activesupport (>= 5.2.0, < 8.0) @@ -416,14 +416,14 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0, < 4.11) - websocket (1.2.9) + websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (3.3.1) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.11) + zeitwerk (2.6.12) PLATFORMS x86_64-linux From e7867d46c6a4f3385dc37cad9a64cd889b6b362e Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Thu, 12 Oct 2023 22:53:09 +0200 Subject: [PATCH 06/13] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4b69b1442..1201547d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -159,7 +159,8 @@ GEM flamegraph (0.9.5) globalid (1.2.1) activesupport (>= 6.1) - graphql (2.1.2) + graphql (2.1.3) + racc (~> 1.4) graphql-client (0.18.0) activesupport (>= 3.0) graphql From b0111dba2b41cecb14a4abf22d464050090a7b11 Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Mon, 16 Oct 2023 14:39:02 +0200 Subject: [PATCH 07/13] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1201547d1..9d1826512 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -182,7 +182,7 @@ GEM actionpack (>= 6.0.0) railties (>= 6.0.0) io-console (0.6.0) - irb (1.8.1) + irb (1.8.3) rdoc reline (>= 0.3.8) jquery-rails (4.6.0) @@ -329,7 +329,7 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - rubocop (1.57.0) + rubocop (1.57.1) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) From 09353804520d1927077e41f36486e18dc892034b Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Mon, 16 Oct 2023 14:45:35 +0200 Subject: [PATCH 08/13] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9d1826512..532f737af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git - revision: f49cd49aee437c98221521f7763ecb8386855e17 + revision: 775c59477cfc99d8cbf02ce199089f984476fca1 branch: development specs: ontologies_api_client (2.2.0) From afd2472c860bb80b2f3c74d53d416883fd2e7b10 Mon Sep 17 00:00:00 2001 From: SirineMhedhbi <31127782+SirineMhedhbi@users.noreply.github.com> Date: Tue, 17 Oct 2023 04:19:25 +0200 Subject: [PATCH 09/13] Fix: AGROVOC concept seed not displaying and a better handling of concept not in a scheme information (#355) * Fix bug of roots * fix JQuery simple tree script removing css class of elements on click * add concept tree links muted title text if skos and not in a scheme * make the concept_scheme request parameter nil if ressource is not skos * optimimze the build tree function by passing to the childs the acronym instead of requesting ontology.aconym for each child --------- Co-authored-by: Syphax Bouazzouni --- app/controllers/application_controller.rb | 2 +- app/controllers/concepts_controller.rb | 4 +-- app/helpers/application_helper.rb | 34 ++++++++++--------- app/views/concepts/_child_nodes.html.haml | 4 +-- app/views/ontologies/_treeview.html.haml | 2 +- .../_concepts_tree.html.haml | 5 +-- .../javascripts/jquery.simple.tree.js.erb | 14 +++----- 7 files changed, 31 insertions(+), 34 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 44c5e3911..21374d7e4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -480,7 +480,7 @@ def get_class(params) end # Create the tree - rootNode = @concept.explore.tree(include: "prefLabel,hasChildren,obsolete", concept_schemes: params[:concept_schemes]) + rootNode = @concept.explore.tree(concept_schemes: params[:concept_schemes]) if rootNode.nil? || rootNode.empty? @roots = @ontology.explore.roots(concept_schemes: params[:concept_schemes]) if @roots.nil? || @roots.empty? diff --git a/app/controllers/concepts_controller.rb b/app/controllers/concepts_controller.rb index 2a6fcda63..35950c375 100644 --- a/app/controllers/concepts_controller.rb +++ b/app/controllers/concepts_controller.rb @@ -44,7 +44,7 @@ def show display = params[:callback].eql?('load') ? {full: true} : {display: "prefLabel"} @concept = @ontology.explore.single_class(display, params[:id]) concept_not_found(params[:id]) if @concept.nil? - @schemes = params[:concept_schemes].split(',') + @schemes = params[:concept_schemes]&.split(',') show_ajax_request # process an ajax call else # Get the latest 'ready' submission, or fallback to any latest submission @@ -189,7 +189,7 @@ def show_ajax_request gather_details render :partial => 'load' when 'children' # Children is called only for drawing the tree - @children = @concept.explore.children(pagesize: 750, concept_schemes: @schemes.join(',')).collection || [] + @children = @concept.explore.children(pagesize: 750, concept_schemes: params[:concept_schemes]).collection || [] @children.sort! { |x, y| (x.prefLabel || "").downcase <=> (y.prefLabel || "").downcase } unless @children.empty? render :partial => 'child_nodes' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 98bc05f94..557f2ef0c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -143,14 +143,14 @@ def draw_note_tree_leaves(notes,level,output,key) end end - def draw_tree(root, id = nil, concept_schemes = []) + def draw_tree(root, acronym, id = nil, concept_schemes = nil) id = root.children.first.id if id.nil? # TODO: handle tree view for obsolete classes, e.g. 'http://purl.obolibrary.org/obo/GO_0030400' - raw build_tree(root, '', id, concept_schemes: concept_schemes) + raw build_tree(root, '', id, acronym, concept_schemes: concept_schemes) end - def build_tree(node, string, id, concept_schemes: []) + def build_tree(node, string, id, acronym, concept_schemes: nil) return string if node.children.nil? || node.children.empty? @@ -161,16 +161,16 @@ def build_tree(node, string, id, concept_schemes: []) # This fake root will be present at the root of "flat" ontologies, we need to keep the id intact if child.id.eql?('bp_fake_root') - string << tree_link_to_concept(child: child, ontology_acronym: '', - active_style: active_style, node: node) + string << tree_link_to_concept(child: child, ontology_acronym: acronym, + active_style: active_style, node: node, skos: !concept_schemes.nil?) else - string << tree_link_to_concept(child: child, ontology_acronym: child.explore.ontology.acronym, - active_style: active_style, node: node) + string << tree_link_to_concept(child: child, ontology_acronym: acronym, + active_style: active_style, node: node, skos: !concept_schemes.nil?) if child.hasChildren && !child.expanded? - string << tree_link_to_children(child: child, concept_schemes: concept_schemes) + string << tree_link_to_children(child: child, acronym: acronym, concept_schemes: concept_schemes) elsif child.expanded? string << '
    ' - build_tree(child, string, id, concept_schemes: concept_schemes) + build_tree(child, string, id, acronym, concept_schemes: concept_schemes) string << '
' end string << '' @@ -179,11 +179,12 @@ def build_tree(node, string, id, concept_schemes: []) string end - def tree_link_to_concept(child:, ontology_acronym:, active_style:, node: nil) + def tree_link_to_concept(child:, ontology_acronym:, active_style:, node: nil, skos: false) li_id = child.id.eql?('bp_fake_root') ? 'bp_fake_root' : short_uuid open = child.expanded? ? "class='open'" : '' icons = child.relation_icon(node) - muted_style = child.isInActiveScheme&.empty? ? 'text-muted' : '' + muted_style = skos && Array(child.isInActiveScheme).empty? ? 'text-muted' : nil + muted_title = muted_style && !child.obsolete? ? "title='is not in a scheme'" : nil href = ontology_acronym.blank? ? '#' : "/ontologies/#{child.explore.ontology.acronym}/concepts/?id=#{CGI.escape(child.id)}" link = <<-EOS + class='#{muted_style} #{active_style}' #{muted_title}> #{child.prefLabel ? child.prefLabel({ use_html: true }) : child.id} EOS @@ -199,10 +200,11 @@ def tree_link_to_concept(child:, ontology_acronym:, active_style:, node: nil) "
  • #{link} #{icons}" end - def tree_link_to_children(child:, concept_schemes: []) + def tree_link_to_children(child:, acronym: ,concept_schemes: nil) li_id = child.id.eql?('bp_fake_root') ? 'bp_fake_root' : short_uuid - concept_schemes = concept_schemes.map{|x| CGI.escape(x)}.join(',') - link = "ajax_class" + concept_schemes = "&concept_schemes=#{concept_schemes.map{|x| CGI.escape(x)}.join(',')}" if concept_schemes + + link = "ajax_class" "
    • #{link}
    " end @@ -397,7 +399,7 @@ def add_proposal_button(parent_id, parent_type) def subscribe_button(ontology_id) if session[:user].nil? - return link_to 'Subscribe to notes emails', "/login?redirect=#{request.url}", {style:'font-size: .9em;', class:'link_button'} + return link_to 'Subscribe to notes emails', "/login?redirect=#{request.url}", {style:'font-size: .9em;', class: 'link_button'} end user = LinkedData::Client::Models::User.find(session[:user].id) diff --git a/app/views/concepts/_child_nodes.html.haml b/app/views/concepts/_child_nodes.html.haml index 87932ed03..0137fa40a 100644 --- a/app/views/concepts/_child_nodes.html.haml +++ b/app/views/concepts/_child_nodes.html.haml @@ -1,7 +1,7 @@ - output ="" - for child in @children - - output << tree_link_to_concept(child: child, ontology_acronym: child.explore.ontology.acronym, active_style: '', node: @concept) + - output << tree_link_to_concept(child: child, ontology_acronym: @ontology.acronym, active_style: '', node: @concept, skos: !@schemes.nil?) - if child.hasChildren - - output << tree_link_to_children(child: child, concept_schemes: @schemes) + - output << tree_link_to_children(child: child, acronym: @ontology.acronym, concept_schemes: @schemes) - output << "
  • " = raw output diff --git a/app/views/ontologies/_treeview.html.haml b/app/views/ontologies/_treeview.html.haml index 1f5573c75..26c044aa9 100644 --- a/app/views/ontologies/_treeview.html.haml +++ b/app/views/ontologies/_treeview.html.haml @@ -5,6 +5,6 @@ action: 'clicked->history#updateURL'}} %li.root %ul - = draw_tree(@root, @concept.id, (params[:concept_schemes] || '').split(',')) + = draw_tree(@root, params[:ontology], @concept.id, params[:concept_schemes]&.split(',')) diff --git a/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml b/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml index f81816d5a..0cdecc97c 100644 --- a/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml +++ b/app/views/ontologies/concepts_browsers/_concepts_tree.html.haml @@ -16,11 +16,12 @@ 'chosen-enable-colors-value': 'true'}} -# Class tree %div#sd_content.card.p-1.py-3{style: 'overflow-y: scroll; height: 60vh;'} - - if skos? && @roots.empty? + - if skos? && @roots&.empty? %div.text-wrap = render AlertMessageComponent.new do Missing roots for #{@ontology.acronym} (skos:topConceptOf) - else + - concept_schemes = skos? ? "&concept_schemes=#{params[:concept_schemes]}" : '' = 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", + src: "/ajax/classes/treeview?ontology=#{@ontology.acronym}&conceptid=#{escape(@concept.id)}#{concept_schemes}&auto_click=false", data: {'turbo-frame-target': 'frame'}) \ No newline at end of file diff --git a/vendor/assets/javascripts/jquery.simple.tree.js.erb b/vendor/assets/javascripts/jquery.simple.tree.js.erb index 3b134b334..53779a92b 100755 --- a/vendor/assets/javascripts/jquery.simple.tree.js.erb +++ b/vendor/assets/javascripts/jquery.simple.tree.js.erb @@ -156,11 +156,8 @@ $.fn.simpleTree = function(opt){ .bind('selectstart', function() { return false; }).click(function(){ - $('.active',TREE).attr('class','text'); - if(this.className=='text') - { - this.className='active'; - } + $('.active',TREE).removeClass('active'); + this.classList.add('active'); if(typeof TREE.option.afterClick == 'function') { TREE.option.afterClick($(this).parent()); @@ -177,11 +174,8 @@ $.fn.simpleTree = function(opt){ // added by Erik Dohmen (2BinBusiness.nl) to make context menu actions // available }).bind("contextmenu",function(){ - $('.active',TREE).attr('class','text'); - if(this.className=='text') - { - this.className='active'; - } + $('.active',TREE).removeClass('active'); + this.classList.add('active'); if(typeof TREE.option.afterContextMenu == 'function') { TREE.option.afterContextMenu($(this).parent()); From a9932ba8d06a7242e35af1c5f8a09450b1dce556 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Tue, 17 Oct 2023 14:07:19 +0200 Subject: [PATCH 10/13] fix update_submission concern to not use check the changed_values (#356) --- app/controllers/concerns/submission_updater.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/concerns/submission_updater.rb b/app/controllers/concerns/submission_updater.rb index 2ab43c70a..e5121fbde 100644 --- a/app/controllers/concerns/submission_updater.rb +++ b/app/controllers/concerns/submission_updater.rb @@ -18,10 +18,16 @@ def update_submission(new_submission_hash) @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(new_submission_hash[:ontology]).first @submission = @ontology.explore.submissions({ display: 'all' }, new_submission_hash[:id]) - @submission.update_from_params(submission_params(new_submission_hash)) + new_values = submission_params(new_submission_hash) + new_values.each do |key, values| + @submission.send("#{key}=", values) + rescue StandardError + next + end + update_ontology_summary_only - @submission.update(cache_refresh_all: false) + @submission.update(values: new_values, cache_refresh_all: false) end def add_ontologies_to_object(ontologies,object) @@ -86,7 +92,6 @@ def convert_values_to_types(new_submission_hash) def submission_params(params) attributes = [ - :ontology, :description, :hasOntologyLanguage, :prefLabelProperty, From 23e149d44b8f3791167177a0db32c9b9cfe8ceae Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Thu, 19 Oct 2023 07:48:15 +0200 Subject: [PATCH 11/13] fix feedback action when ontology_submissions_request is checked (#358) --- app/controllers/home_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 39c6432a4..85dc8b202 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -103,7 +103,7 @@ def feedback unless params[:question].nil? || params[:question].empty? @tags << "Question" end - unless params[:ontology_submissions_request].nil? || params[:bug].empty? + unless params[:ontology_submissions_request].nil? || params[:ontology_submissions_request].empty? @tags << "Ontology submissions request" end From d727d558f7e9e1832c73b0f4438aa09d646fb0a1 Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Thu, 19 Oct 2023 07:51:43 +0200 Subject: [PATCH 12/13] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 532f737af..a4053c318 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git - revision: 775c59477cfc99d8cbf02ce199089f984476fca1 + revision: 169afb7c1002f9db2b3276af36d552575cc80ba2 branch: development specs: ontologies_api_client (2.2.0) @@ -100,7 +100,7 @@ GEM sassc-rails (>= 2.0.0) brakeman (5.4.1) builder (3.2.4) - capistrano (3.17.3) + capistrano (3.18.0) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -383,7 +383,7 @@ GEM daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (1.2.2) + thor (1.3.0) tilt (2.3.0) time (0.2.2) date From 3930a4a9fbcbc537a116ed050c25435fc19f2e91 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Thu, 19 Oct 2023 14:20:21 +0200 Subject: [PATCH 13/13] Revert "fix update_submission concern to not use check the changed_values (#356)" This reverts commit a9932ba8d06a7242e35af1c5f8a09450b1dce556. --- app/controllers/concerns/submission_updater.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/controllers/concerns/submission_updater.rb b/app/controllers/concerns/submission_updater.rb index e5121fbde..2ab43c70a 100644 --- a/app/controllers/concerns/submission_updater.rb +++ b/app/controllers/concerns/submission_updater.rb @@ -18,16 +18,10 @@ def update_submission(new_submission_hash) @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(new_submission_hash[:ontology]).first @submission = @ontology.explore.submissions({ display: 'all' }, new_submission_hash[:id]) - new_values = submission_params(new_submission_hash) - new_values.each do |key, values| - @submission.send("#{key}=", values) - rescue StandardError - next - end - + @submission.update_from_params(submission_params(new_submission_hash)) update_ontology_summary_only - @submission.update(values: new_values, cache_refresh_all: false) + @submission.update(cache_refresh_all: false) end def add_ontologies_to_object(ontologies,object) @@ -92,6 +86,7 @@ def convert_values_to_types(new_submission_hash) def submission_params(params) attributes = [ + :ontology, :description, :hasOntologyLanguage, :prefLabelProperty,