diff --git a/Gemfile.lock b/Gemfile.lock index 2964125742..cf4f1ff835 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git - revision: 0db56d748a1574450ebeb5f67429cd0b766cf932 + revision: 1fcf35adcb8955d6b2d48ed08055d31cb00cd3c2 branch: feature/federate-multiple-apis specs: ontologies_api_client (2.2.0) @@ -174,7 +174,7 @@ GEM flamegraph (0.9.5) globalid (1.2.1) activesupport (>= 6.1) - graphql (2.3.2) + graphql (2.3.3) base64 graphql-client (0.22.0) activesupport (>= 3.0) @@ -349,7 +349,7 @@ GEM omniauth-orcid (2.1.1) omniauth-oauth2 (~> 1.3) ruby_dig (~> 0.0.2) - omniauth-rails_csrf_protection (1.0.1) + omniauth-rails_csrf_protection (1.0.2) actionpack (>= 4.2) omniauth (~> 2.0) open_uri_redirections (0.2.1) diff --git a/app/controllers/concerns/submission_filter.rb b/app/controllers/concerns/submission_filter.rb index e61aa2be41..a581f3b7f6 100644 --- a/app/controllers/concerns/submission_filter.rb +++ b/app/controllers/concerns/submission_filter.rb @@ -30,6 +30,8 @@ def submissions_paginate_filter(params) @ontologies = LinkedData::Client::Models::Ontology.all(include: 'all', also_include_views: true, display_links: false, display_context: false) + @ontologies, @errors = @ontologies.partition { |x| !x.errors } + # get fair scores of all ontologies @fair_scores = fairness_service_enabled? ? get_fair_score('all') : nil submissions = submissions.reject { |sub| sub.ontology.nil? }.map { |sub| ontology_hash(sub) } @@ -67,7 +69,7 @@ def ontologies_filter_url(filters, page: 1, count: false) def filter_using_data(ontologies, query:, status:, show_views:, private_only:, languages:, page_size:, formality_level:, is_of_type:, groups:, categories:, formats:) submissions = LinkedData::Client::Models::OntologySubmission.all(include: BROWSE_ATTRIBUTES.join(','), also_include_views: true, display_links: false, display_context: false) - submissions = submissions.map { |x| [x[:ontology][:id], x] }.to_h + submissions = submissions.map { |x| x[:ontology] ? [x[:ontology][:id], x] : nil}.compact.to_h submissions = ontologies.map { |ont| ontology_hash(ont, submissions) } diff --git a/app/views/ontologies/browser/_ontologies.html.haml b/app/views/ontologies/browser/_ontologies.html.haml index fec4643834..06d44d362f 100644 --- a/app/views/ontologies/browser/_ontologies.html.haml +++ b/app/views/ontologies/browser/_ontologies.html.haml @@ -6,7 +6,12 @@ - if @page.page.eql?(1) = content_tag(:p, class: "browse-desc-text", style: "margin-bottom: 12px !important;") do #{t("ontologies.showing_ontologies_size", ontologies_size: @count, analytics_size: @total_ontologies, portals: request_portals_names.join(', ').html_safe).html_safe} (#{sprintf("%.2f", @time)}s) - + - unless @errors.blank? + %div.my-1 + = render Display::AlertComponent.new(type: 'danger') do + - @errors.each do |e| + %div + = e.errors || e - ontologies = c.collection - ontologies.each do |ontology| - config = ontology_portal_config(ontology[:id])&.last || {}