diff --git a/Gemfile.lock b/Gemfile.lock index 59e6f7fa8..8a38af90b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -135,7 +135,7 @@ GEM railties (> 3.1) childprocess (5.0.0) coderay (1.1.3) - concurrent-ruby (1.3.2) + concurrent-ruby (1.3.3) crack (1.0.0) bigdecimal rexml @@ -152,7 +152,7 @@ GEM docile (1.4.0) domain_name (0.6.20240107) ed25519 (1.3.0) - erubi (1.12.0) + erubi (1.13.0) erubis (2.7.0) excon (0.110.0) execjs (2.9.1) @@ -172,7 +172,7 @@ GEM sass-rails globalid (1.2.1) activesupport (>= 6.1) - graphql (2.3.4) + graphql (2.3.5) base64 graphql-client (0.22.0) activesupport (>= 3.0) @@ -312,7 +312,7 @@ GEM net-protocol net-ssh (7.2.3) netrc (0.11.0) - newrelic_rpm (9.9.0) + newrelic_rpm (9.10.2) nio4r (2.7.3) nokogiri (1.15.6-x86_64-darwin) racc (~> 1.4) @@ -353,8 +353,8 @@ GEM omniauth-rails_csrf_protection (1.0.2) actionpack (>= 4.2) omniauth (~> 2.0) - parallel (1.24.0) - parser (3.3.2.0) + parallel (1.25.1) + parser (3.3.3.0) ast (~> 2.4.1) racc popper_js (1.16.1) @@ -397,9 +397,9 @@ GEM rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.7) - actionpack (= 7.0.7) - activesupport (= 7.0.7) + railties (7.0.3) + actionpack (= 7.0.3) + activesupport (= 7.0.3) method_source rake (>= 12.2) thor (~> 1.0) @@ -415,19 +415,19 @@ GEM json redcarpet (3.6.0) regexp_parser (2.9.2) - reline (0.5.8) + reline (0.5.9) io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.8) - strscan (>= 3.0.9) - rouge (4.2.1) + rexml (3.3.0) + strscan + rouge (4.3.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) @@ -505,12 +505,12 @@ GEM net-ssh (>= 2.8.0) stimulus-rails (1.3.3) railties (>= 6.0.0) - stringio (3.1.0) + stringio (3.1.1) strscan (3.1.0) temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - terser (1.2.2) + terser (1.2.3) execjs (>= 0.3.0, < 3) thor (1.3.1) tilt (2.3.0) @@ -594,7 +594,7 @@ DEPENDENCIES mysql2 net-ftp (~> 0.2.0) net-http (~> 0.3.2) - newrelic_rpm (< 9.10.0) + newrelic_rpm oj omniauth omniauth-github @@ -605,7 +605,7 @@ DEPENDENCIES ontologies_api_client! pry puma (~> 5.0) - rails (= 7.0.7) + rails (= 7.0.3) rails-i18n (~> 7.0.0) recaptcha (~> 5.9.0) rest-client diff --git a/app/assets/images/icons/slices.svg b/app/assets/images/icons/slices.svg new file mode 100644 index 000000000..e92cb02f9 --- /dev/null +++ b/app/assets/images/icons/slices.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss index 327e0ed07..9965d2bfd 100644 --- a/app/assets/stylesheets/home.scss +++ b/app/assets/stylesheets/home.scss @@ -150,7 +150,59 @@ i.fa.fa-caret-square-o-down { margin-bottom: 5px; font-weight: 700; } - +.home-section-title{ + display: flex; + flex-direction: column; + align-items: start; +} +.home-section-title .text{ + font-size: 20px; + font-weight: 600; + margin-bottom: 0; +} +.home-slice > a{ + display: flex; + align-items: center; +} +.home-slice-icon{ + display: flex; + flex-direction: column; + align-items: center; +} +.home-slice-icon svg{ + width: 40px; + height: 40px; +} +.home-slices-container{ + display: flex; + flex-wrap: wrap; + margin-top: 20px; +} +.home-section-description{ + color: #888888; +} +.home-slice{ + border: 1px solid var(--primary-color); + border-radius: 8px; + padding: 4px 15px; + margin-right: 20px; + margin-bottom: 20px; +} +.home-ontoportal-instances{ + margin-top: 50px; + background: #FBFBFB; + width: 100%; + display: flex; + justify-content: center; +} +.ontoportal-instances-container{ + padding: 0 50px; + width: 1248px; + padding-bottom: 20px; +} +.home-section-title.ontoportal{ + margin-top: 20px; +} .home-section-line{ width: 60px; margin-top: 3px; @@ -169,17 +221,26 @@ i.fa.fa-caret-square-o-down { } .home-statistics-container > div { display: flex; - align-items: center; + align-items: start; + justify-content: center; flex-wrap: wrap; } .home-agroportal-figures{ margin-bottom: 20px; } - +.home-slice-name{ + font-size: 16px; + font-weight: 400; + margin-left: 10px; +} +.home-slice-ontologies{ + font-size: 18px; + font-weight: 500; + margin-bottom: -18px; +} .home-statistics-container > div > p { font-size: 20px; font-weight: 600; - margin-left: 18px; margin-bottom: 0; } .home-statistics-item{ @@ -414,7 +475,6 @@ i.fa.fa-caret-square-o-down { } .home-support-items{ display: flex; - justify-content: center; flex-wrap: wrap; img{ object-fit: scale-down; @@ -429,8 +489,8 @@ i.fa.fa-caret-square-o-down { border-radius: 50%; display: block; } -.home-support-items > *:not(:first-child){ - margin-left: 40px; +.home-support-items > div, .home-support-items > a { + margin-right: 40px; } .home-support-items a{ margin-bottom: 40px; diff --git a/app/assets/stylesheets/notice.scss b/app/assets/stylesheets/notice.scss index c69189653..93dd13e0e 100644 --- a/app/assets/stylesheets/notice.scss +++ b/app/assets/stylesheets/notice.scss @@ -14,3 +14,26 @@ div#notice_message { } } +.slice-notice-bar-container{ + background-color: var(--warning-color); + display: flex; + justify-content: center; +} +.slice-notice-bar{ + width: var(--container-max-width); + padding: 10px 40px; + display: flex; + justify-content: space-between; + align-items: center; + color: white; +} +.slice-notice-bar>div{ + display: flex; +} +.slice-notice-bar .slice-name{ + margin-left: 5px; + font-weight: 600; +} +.slice-notice-bar .warning-button.primary-button{ + background-color: #efb300 !important; +} diff --git a/app/assets/stylesheets/theme-variables.scss.erb b/app/assets/stylesheets/theme-variables.scss.erb index a76576e39..0f87e4443 100644 --- a/app/assets/stylesheets/theme-variables.scss.erb +++ b/app/assets/stylesheets/theme-variables.scss.erb @@ -39,7 +39,7 @@ // common variables :root{ --error-color: #EB4335; - --warning-color: #e48c11; + --warning-color: #F2BE22; --gray-color: #888888; --success-color: #2DC54E; --admin-color: #145FF4; diff --git a/app/controllers/annotator_controller.rb b/app/controllers/annotator_controller.rb index aabf5ecf2..a1a4011d3 100644 --- a/app/controllers/annotator_controller.rb +++ b/app/controllers/annotator_controller.rb @@ -72,8 +72,23 @@ def annotator_results(uri) else @results_table_header.push(t('annotator.score')) end - annotations = LinkedData::Client::HTTP.get(uri.dup.to_s, api_params) + + # if we are in a slice, pass the ontologies of this slice in the params + + if at_slice? + slice_ontologies_acronyms = @subdomain_filter[:ontologies].map{ |id| link_last_part(id)} + if api_params[:ontologies] + selected_ontolgies = api_params[:ontologies].split(',') + filtred_ontologies = selected_ontolgies.select{ |ontology| slice_ontologies_acronyms.include?(ontology) } + else + filtred_ontologies = slice_ontologies_acronyms + end + api_params[:ontologies] = filtred_ontologies.join(',') + end + + annotations = LinkedData::Client::HTTP.get(uri, api_params) @ontologies = LinkedData::Client::Models::Ontology.all({:include_views => true}).map{ |o| [o.id.to_s, o]}.to_h + @semantic_types = get_semantic_types @results = [] annotations.each do |annotation| diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4d5f32984..6d2305ce6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -123,6 +123,7 @@ def domain_ontology_set @subdomain_filter[:active] = true @subdomain_filter[:name] = slice.name @subdomain_filter[:acronym] = slice.acronym + @subdomain_filter[:ontologies] = slice.ontologies end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 7c7492dbe..4519adb19 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -14,6 +14,7 @@ def index metrics = metrics.each_with_object(Hash.new(0)) do |h, sum| h.to_hash.slice(:classes, :properties, :individuals).each { |k, v| sum[k] += v } end + @slices = LinkedData::Client::Models::Slice.all @cls_count = metrics[:classes] @individuals_count = metrics[:individuals] diff --git a/app/controllers/mappings_controller.rb b/app/controllers/mappings_controller.rb index e6c9fabd4..b1bcfc8c3 100644 --- a/app/controllers/mappings_controller.rb +++ b/app/controllers/mappings_controller.rb @@ -40,6 +40,7 @@ def index end @options[select_text] = ontology_acronym end + @options = @options.sort @options.unshift([]) diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index 1be775861..0f984002b 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -30,4 +30,10 @@ def discover_ontologies_button end end + def home_ontoportal_tooltip + ontoportal_link = link_to("(#{$ONTOPORTAL_WEBSITE_LINK})", $ONTOPORTAL_WEBSITE_LINK, target: '_blank') + github_link = link_to("(#{$ONTOPORTAL_GITHUB_REPO})", $ONTOPORTAL_GITHUB_REPO, target: '_blank') + content_tag(:div, t('home.ontoportal_description', ontoportal_link: ontoportal_link, github_link: github_link).html_safe, style: "max-width: 600px;") + end + end \ No newline at end of file diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 7a010b73d..223141b4b 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -176,20 +176,38 @@ .home-statistics-link.justify-content-end = link_to t("home.see_details"),'/statistics', target: "_blank" - .home-section - .home-statistics-container - .home-support-title - %p= t('home.support_and_collaborations') + - if @slices + .home-section + .home-section-title + .text + = "#{portal_name} slices" %hr.home-section-line/ - .home-support-items - - $HOME_PAGE_LOGOS&.each do |logo| - %a{href:logo[:url], target: "_blanc"} - %img{src: asset_path(logo[:img_src])} - - .home-section - .home-statistics-container - .home-support-title - %p= t('home.ontoportal_instances') + .home-section-description + .div + = t('home.slices_description') + .home-slices-container + - @slices.each do |slice, index| + - slice_link = "https://#{slice.acronym}.#{$UI_URL.sub("https://", "")}" + .home-slice{'data-controller': 'tooltip', title: content_tag(:div, slice.description, style: 'max-width: 200px')} + = link_to slice_link, target: '_blank' do + .home-slice-icon + .home-slice-ontologies + = slice.ontologies.length + = inline_svg 'icons/slices.svg', width: "70", height: "70" + + .home-slice-name + = "#{slice.name} (#{slice.acronym})" + = render Buttons::RegularButtonComponent.new(id:'regular-button', value: t('home.suggest_slice'), variant: "secondary", state: "regular", href: '/feedback') do |btn| + - btn.icon_right do + = inline_svg_tag "icons/plus.svg" + + .home-ontoportal-instances + .ontoportal-instances-container + .home-section-title.ontoportal + .d-flex.align-items-center + .text.mr-2 + = t('home.ontoportal_instances') + = render Display::InfoTooltipComponent.new(text: home_ontoportal_tooltip) %hr.home-section-line/ .home-support-items - $PORTALS_INSTANCES&.each do |portal| @@ -198,7 +216,16 @@ = inline_svg 'logo-white.svg', width: "35", height: "26" %p{style: "color: #{portal[:color]}"} = portal[:portal] - + + .home-section + .home-section-title + .text + = t('home.support_and_collaborations') + %hr.home-section-line/ + .home-support-items + - $HOME_PAGE_LOGOS&.each do |logo| + %a{href:logo[:url], target: "_blanc"} + %img{src: asset_path(logo[:img_src])} :javascript function submitAnnotator(){ diff --git a/app/views/layouts/_notices.html.haml b/app/views/layouts/_notices.html.haml index 7d99b276e..8969a67d0 100644 --- a/app/views/layouts/_notices.html.haml +++ b/app/views/layouts/_notices.html.haml @@ -6,21 +6,18 @@ - do_not_display_subdomain_info_here = Set.new(["homeall_resources"]) - if at_slice? && !do_not_display_subdomain_info_here.include?("#{controller.controller_name}#{controller.action_name}") - .subdomain_info{:style => "margin: 13px; padding: 5px; border: 1px solid gray; font-size:14px; background-color: #ffffcc;"} - %p{:style => "text-align: left; margin-bottom: 0;"} - - query_string = request.query_string.empty? ? "" : "?#{request.query_string}" - You are viewing the - %b= @subdomain_filter[:name] - %a.pop_window{:href => "help?pop=true#slice_definition", :target => "_blank"} - = $SITE - = t('layout.notices.slice') - = t('layout.notices.at') - = succeed "." do - %b= request.host - = $SITE - = succeed "." do - %a{:href => "#{$UI_URL}#{request.path}#{query_string}"} - = t('layout.notices.visit_the_site') + .slice-notice-bar-container + .slice-notice-bar + %div + .title + = t('home.viewing_slice') + .slice-name + = @subdomain_filter[:name] + .view-full-site-button + - query_string = request.query_string.empty? ? "" : "?#{request.query_string}" + = render Buttons::RegularButtonComponent.new(id:'slices-view-full-site', value: t('home.view_full_site'), variant: "primary", href: "#{$UI_URL}#{request.path}#{query_string}", color: 'warning', size: "slim") do |btn| + = btn.icon_right do + = inline_svg_tag "arrow-right.svg" #site-notice - message_name = "" - unless $SITE_NOTICE.nil? || $SITE_NOTICE.empty? diff --git a/config/bioportal_config_env.rb.sample b/config/bioportal_config_env.rb.sample index 90e7aeb64..277b97201 100644 --- a/config/bioportal_config_env.rb.sample +++ b/config/bioportal_config_env.rb.sample @@ -258,6 +258,8 @@ $PORTALS_INSTANCES = [ link: 'https://biodivportal.gfbio.org/' } ] +$ONTOPORTAL_WEBSITE_LINK = "https://ontoportal.org/" +$ONTOPORTAL_GITHUB_REPO = "https://github.com/ontoportal" $GITHUB_ISSUES = "https://github.com/agroportal/project-management/issues" $FOOTER_LINKS = { @@ -275,7 +277,7 @@ $FOOTER_LINKS = { api: "https://data.agroportal.lirmm.fr/", tools: "/tools", sparql: "https://sparql.agroportal.lirmm.fr/test/", - ontoportal: "https://ontoportal.org/" + ontoportal: $ONTOPORTAL_WEBSITE_LINK }, support: { contact_us: "https://#{$SITE}.lirmm.fr/feedback", diff --git a/config/locales/en.yml b/config/locales/en.yml index 6089ff20c..f00316dbc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -409,6 +409,11 @@ en: feedback_complete: title: Feedback sent successfully message: Thank you for taking the time to share your feedback with us. Our support team will review your message and get back to you as soon as possible with a response. We value your opinion and appreciate your help in improving our services. Thank you for your support! + suggest_slice: Suggest a new group/slice + slices_description: Slices allow users to interact (both via API or UI) only with a subset of ontologies in AgroPortal. If browsing the slice, all the portal features will be restricted to the chosen subset, enabling users to focus on their specific use cases. On AgroPortal, slices and groups are synchronized, so every group has a corresponding slice displaying only the ontologies from that group. + ontoportal_description: "The OntoPortal Alliance %{ontoportal_link} is a consortium of research and infrastructure teams dedicated to promoting the development of ontology repositories and semantic artefact catalogues based on the open, collaboratively developed OntoPortal software %{github_link}. Hereafter are the current public and open repositories built with the technology maintained by the Alliance." + viewing_slice: "Viewing the slice:" + view_full_site: View full website landscape: #select_ontologies: Start typing to select ontologies or leave blank to use them all classes: Number of classes diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5ed3522d1..2f4812d8d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -413,6 +413,11 @@ fr: feedback_complete: title: Retour envoyé avec succès message: Merci d'avoir pris le temps de partager votre retour avec nous. Notre équipe de support examinera votre message et vous répondra dès que possible. Nous apprécions votre opinion et sommes reconnaissants de votre aide pour améliorer nos services. Merci de votre soutien ! + suggest_slice: Proposer un nouveau groupe/slice + slices_description: Les "slices" permettent aux utilisateurs d'interagir (à la fois via l'API ou l'interface utilisateur) uniquement avec un sous-ensemble d'ontologies dans AgroPortal. Si vous parcourez une slice, toutes les fonctionnalités du portail seront limitées au sous-ensemble choisi; cela permet aux utilisateurs de se concentrer sur leurs cas d'utilisation spécifiques. Sur AgroPortal, les slices et les groupes sont synchronisés, de sorte que chaque groupe a une slice correspondante affichant uniquement les ontologies de ce groupe. + ontoportal_description: "L'OntoPortal Alliance %{ontoportal_link} est un consortium d'équipes de recherche et d'infrastructure dédiées à promouvoir le développement de portails d'ontologies et de catalogues d'artefacts sémantiques basés sur le logiciel OntoPortal %{github_link} ouvert et collaboratif. Ci-dessous se trouvent les portails publics et ouverts actuels construits avec la technologie maintenue par l'Alliance." + viewing_slice: "Affichage de la slice:" + view_full_site: Voir le site complet landscape: #select_ontologies: Commencez à taper pour sélectionner des ontologies ou laissez vide pour les utiliser toutes