diff --git a/Gemfile b/Gemfile index 8cc430e0b..9e05e041d 100644 --- a/Gemfile +++ b/Gemfile @@ -184,3 +184,5 @@ group :test do # Testing framework for Rails gem 'rspec-rails' end + +gem 'concurrent-ruby', '1.3.4' diff --git a/Gemfile.lock b/Gemfile.lock index 73328d841..a7cc34ebb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,11 @@ GIT remote: https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git - revision: 7423b46ff6fa7e5ef0f1d36548f7c04466939f71 + revision: f5b82f304abaf6f0a4ee671729120973084189e5 branch: development specs: ontologies_api_client (2.2.0) activesupport (~> 7.0.4) - excon + excon (= 0.112.0) faraday faraday-excon (~> 2.0.0) faraday-multipart @@ -94,7 +94,7 @@ GEM execjs (~> 2) base64 (0.2.0) bcrypt_pbkdf (1.1.1) - bigdecimal (3.1.8) + bigdecimal (3.1.9) bindata (2.5.0) bindex (0.8.1) bootsnap (1.18.4) @@ -107,7 +107,7 @@ GEM bugsnag (6.27.1) concurrent-ruby (~> 1.0) builder (3.3.0) - capistrano (3.19.1) + capistrano (3.19.2) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -118,7 +118,7 @@ GEM capistrano (~> 3.0) capistrano-passenger (0.2.1) capistrano (~> 3.0) - capistrano-rails (1.6.3) + capistrano-rails (1.7.0) capistrano (~> 3.1) capistrano-bundler (>= 1.1, < 3) capistrano-yarn (2.0.2) @@ -147,18 +147,18 @@ GEM crass (1.0.6) css_parser (1.17.1) addressable - csv (3.3.0) + csv (3.3.2) dalli (3.2.8) - date (3.3.4) - debug (1.9.2) + date (3.4.1) + debug (1.10.0) irb (~> 1.10) reline (>= 0.3.8) - deepl-rb (3.0.2) + deepl-rb (3.2.0) diff-lcs (1.5.1) docile (1.4.1) domain_name (0.6.20240107) ed25519 (1.3.0) - erubi (1.13.0) + erubi (1.13.1) erubis (2.7.0) excon (0.112.0) execjs (2.10.0) @@ -170,8 +170,8 @@ GEM faraday (~> 2.0.0.alpha.pre.2) faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) - faraday-multipart (1.0.4) - multipart-post (~> 2) + faraday-multipart (1.1.0) + multipart-post (~> 2.0) faraday-net_http (2.1.0) ffi (1.16.3) fiber-storage (1.0.0) @@ -179,10 +179,11 @@ GEM sass-rails globalid (1.2.1) activesupport (>= 6.1) - graphql (2.3.19) + graphql (2.4.9) base64 fiber-storage - graphql-client (0.23.0) + logger + graphql-client (0.25.0) activesupport (>= 3.0) graphql (>= 1.13.0) haml (5.2.2) @@ -193,7 +194,7 @@ GEM activesupport (>= 5.1) haml (>= 4.0.6) railties (>= 5.1) - hashdiff (1.1.1) + hashdiff (1.1.2) hashie (5.0.0) highline (2.1.0) html2haml (2.3.0) @@ -204,9 +205,9 @@ GEM htmlbeautifier (1.4.3) htmlentities (4.3.4) http-accept (1.7.0) - http-cookie (1.0.7) + http-cookie (1.0.8) domain_name (~> 0.5) - i18n (1.14.6) + i18n (1.14.7) concurrent-ruby (~> 1.0) i18n-tasks (0.9.37) activesupport (>= 4.0.2) @@ -227,8 +228,9 @@ GEM inline_svg (1.10.0) activesupport (>= 3.0) nokogiri (>= 1.6) - io-console (0.7.2) - irb (1.14.1) + io-console (0.8.0) + irb (1.15.1) + pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) iso-639 (0.3.8) @@ -241,7 +243,7 @@ GEM railties (>= 3.2.16) jsbundling-rails (1.3.1) railties (>= 6.0.0) - json (2.7.4) + json (2.9.1) json-jwt (1.16.7) activesupport (>= 4.2) aes_key_wrap @@ -249,12 +251,13 @@ GEM bindata faraday (~> 2.0) faraday-follow_redirects - jwt (2.9.3) + jwt (2.10.1) base64 - language_server-protocol (3.17.0.3) - launchy (3.0.1) + language_server-protocol (3.17.0.4) + launchy (3.1.0) addressable (~> 2.8) childprocess (~> 5.0) + logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) letter_opener_web (2.0.0) @@ -265,8 +268,8 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.1) - loofah (2.23.1) + logger (1.6.5) + loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) lookbook (1.5.5) @@ -294,10 +297,10 @@ GEM mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.1001) + mime-types-data (3.2025.0107) mini_mime (1.1.5) - minitest (5.25.1) - msgpack (1.7.3) + minitest (5.25.4) + msgpack (1.7.5) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.4.1) @@ -307,14 +310,14 @@ GEM time net-http (0.3.2) uri - net-imap (0.4.17) + net-imap (0.4.18) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-scp (4.0.0) + net-scp (4.1.0) net-ssh (>= 2.6.5, < 8.0.0) net-sftp (4.0.0) net-ssh (>= 5.0.0, < 8.0.0) @@ -322,9 +325,9 @@ GEM net-protocol net-ssh (7.3.0) netrc (0.11.0) - newrelic_rpm (9.14.0) - nio4r (2.7.3) - nokogiri (1.15.6-x86_64-linux) + newrelic_rpm (9.17.0) + nio4r (2.7.4) + nokogiri (1.15.7-x86_64-linux) racc (~> 1.4) oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) @@ -333,7 +336,7 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - oj (3.16.6) + oj (3.16.9) bigdecimal (>= 3.0) ostruct (>= 0.2) omniauth (2.1.2) @@ -343,8 +346,8 @@ GEM omniauth-github (2.0.1) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) - omniauth-google-oauth2 (1.2.0) - jwt (>= 2.9) + omniauth-google-oauth2 (1.2.1) + jwt (>= 2.9.2) oauth2 (~> 2.0) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) @@ -362,16 +365,20 @@ GEM omniauth-rails_csrf_protection (1.0.2) actionpack (>= 4.2) omniauth (~> 2.0) - ostruct (0.6.0) + ostruct (0.6.1) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.7.0) ast (~> 2.4.1) racc popper_js (1.16.1) - pry (0.14.2) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - psych (5.1.2) + psych (5.2.3) + date stringio public_suffix (5.1.1) puma (5.6.9) @@ -381,7 +388,7 @@ GEM rack-protection (3.2.0) base64 (>= 0.1.0) rack (~> 2.2, >= 2.2.4) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rails (7.0.4) actioncable (= 7.0.4) @@ -401,10 +408,10 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (7.0.9) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) railties (7.0.4) @@ -419,13 +426,13 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.7.0) + rdoc (6.11.0) psych (>= 4.0.0) recaptcha (5.9.0) json redcarpet (3.6.0) - regexp_parser (2.9.2) - reline (0.5.10) + regexp_parser (2.10.0) + reline (0.6.0) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) @@ -434,8 +441,8 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.3.9) - rouge (4.4.0) + rexml (3.4.0) + rouge (4.5.1) rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) @@ -444,7 +451,7 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (7.0.1) + rspec-rails (7.1.0) actionpack (>= 7.0) activesupport (>= 7.0) railties (>= 7.0) @@ -452,18 +459,18 @@ GEM rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) rspec-support (~> 3.13) - rspec-support (3.13.1) - rubocop (1.67.0) + rspec-support (3.13.2) + rubocop (1.71.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) @@ -471,7 +478,7 @@ GEM ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) - rubyzip (2.3.2) + rubyzip (2.4.1) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) @@ -486,7 +493,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sexp_processor (4.17.2) + sexp_processor (4.17.3) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -516,25 +523,27 @@ GEM stimulus-rails (1.3.4) railties (>= 6.0.0) string-similarity (2.1.0) - stringio (3.1.1) + stringio (3.1.2) temple (0.10.3) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - terser (1.2.4) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + terser (1.2.5) execjs (>= 0.3.0, < 3) thor (1.3.2) - tilt (2.4.0) - time (0.4.0) + tilt (2.6.0) + time (0.4.1) date - timeout (0.4.1) + timeout (0.4.3) turbo-rails (2.0.11) actionpack (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unaccent (0.4.0) - unicode-display_width (2.6.0) - uri (0.13.1) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.2) version_gem (1.1.4) view_component (2.83.0) activesupport (>= 5.2.0, < 8.0) @@ -550,7 +559,8 @@ GEM crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) websocket (1.2.11) - websocket-driver (0.7.6) + websocket-driver (0.7.7) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (3.3.1) @@ -578,6 +588,7 @@ DEPENDENCIES capybara chart-js-rails color (~> 1.8) + concurrent-ruby (= 1.3.4) countries (~> 5.7) dalli debug diff --git a/app/controllers/concepts_controller.rb b/app/controllers/concepts_controller.rb index 3d4923296..09b928724 100644 --- a/app/controllers/concepts_controller.rb +++ b/app/controllers/concepts_controller.rb @@ -23,7 +23,7 @@ def show redirect_to(ontology_path(id: params[:ontology], p: 'classes', conceptid: params[:id], lang: request_lang)) and return unless turbo_frame_request? @submission = get_ontology_submission_ready(@ontology) - @concept = @ontology.explore.single_class({full: true, language: request_lang}, params[:id]) + @concept = @ontology.explore.single_class({ full: true, language: request_lang }, params[:id]) @instances_concept_id = @concept.id concept_not_found(params[:id]) if @concept.nil? @@ -40,22 +40,21 @@ def index return end - # Note that find_by_acronym includes views by default - @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology]).first - - @submission = @ontology.explore.latest_submission(include:'uriRegexPattern,preferredNamespaceUri') - - @concept = @ontology.explore.single_class({dispay: 'prefLabel'}, params[:id]) - - concept_not_found(params[:id]) if @concept.nil? + @submission = LinkedData::Client::Models::Ontology.explore(params[:ontology]) + .latest_submission + .get(include: 'uriRegexPattern,preferredNamespaceUri') @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 = LinkedData::Client::Models::Class.new(values: { id: params[:id] }) + @concept.children = LinkedData::Client::Models::Ontology.explore(params[:ontology]) + .classes(params[:id]) + .children + .get(pagesize: 750, concept_schemes: Array(@schemes).join(','), language: request_lang, display: 'prefLabel,obsolete,hasChildren').collection || [] render turbo_stream: [ replace(helpers.child_id(@concept) + '_open_link') { TreeLinkComponent.tree_close_icon }, replace(helpers.child_id(@concept) + '_childs') do - helpers.concepts_tree_component(@concept, @concept, @ontology.acronym, Array(@schemes), request_lang, sub_tree: true, submission: @submission) + helpers.concepts_tree_component(@concept, @concept, params[:ontology], Array(@schemes), request_lang, sub_tree: true, submission: @submission) end ] end @@ -84,11 +83,11 @@ def show_definition def show_tree @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology]).first - @submission = @ontology.explore.latest_submission(include:'uriRegexPattern,preferredNamespaceUri') + @submission = @ontology.explore.latest_submission(include: 'uriRegexPattern,preferredNamespaceUri') if @ontology.nil? || @ontology.errors ontology_not_found(params[:ontology]) else - get_class(params) #application_controller + get_class(params) # application_controller not_found(t('concepts.missing_roots')) if @root.nil? @@ -109,8 +108,8 @@ def show_date_sorted_list auto_click = page.to_s.eql?('1') params = { page: page, - sortby:'modified,created', - order:'desc,desc', + sortby: 'modified,created', + order: 'desc,desc', display: 'prefLabel,modified,created', language: request_lang } @@ -142,32 +141,27 @@ def details @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology]).first ontology_not_found(params[:ontology]) if @ontology.nil? - @concept = @ontology.explore.single_class({full: true}, CGI.unescape(params[:conceptid])) + @concept = @ontology.explore.single_class({ full: true }, CGI.unescape(params[:conceptid])) concept_not_found(CGI.unescape(params[:conceptid])) if @concept.nil? || @concept.errors @container_id = params[:modal] ? 'application_modal_content' : 'concept_details' render :partial => "details" end - def biomixer @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology]).first ontology_not_found(params[:ontology]) if @ontology.nil? - @concept = @ontology.explore.single_class({full: true}, params[:conceptid]) + @concept = @ontology.explore.single_class({ full: true }, params[:conceptid]) concept_not_found(params[:conceptid]) if @concept.nil? render partial: "biomixer", layout: false end - private - - - def filter_concept_with_no_date(concepts) - concepts.filter { |c| !concept_date(c).nil?} + concepts.filter { |c| !concept_date(c).nil? } end def concepts_to_years_months(concepts) diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..83aa57a8d --- /dev/null +++ b/mise.toml @@ -0,0 +1,2 @@ +[tools] +ruby = "2.7.8"