Skip to content

Commit

Permalink
Fix: Prevent display home portal tooltip if we get a non complete res…
Browse files Browse the repository at this point in the history
…ponse (#851)

* prevent display home portal tooltip if we get a non complete data

* show any info we get from the api in portals home page tooltips
  • Loading branch information
Bilelkihal authored Nov 28, 2024
1 parent aec6da8 commit 34ce85e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def portal_config
@config = $PORTALS_INSTANCES.select { |x| x[:name].downcase.eql?((params[:portal] || helpers.portal_name).downcase) }.first
if @config && @config[:api]
@portal_config = LinkedData::Client::Models::Ontology.top_level_links(@config[:api]).to_h
@color = @portal_config[:color].present? ? @portal_config[:color] : @config[:color]
@name = @portal_config[:title].present? ? @portal_config[:title] : @config[:name]
else
@portal_config = {}
end
Expand Down
12 changes: 6 additions & 6 deletions app/views/home/portal_config.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
.div.d-flex.align-items-center
%div
%div.text-center
= link_to @portal_config[:ui] || @config[:ui], target: '_blank', class: 'home-logo-instances mr-1 m-0', style: "background-color: #{@portal_config[:color] || @config[:color]}" do
= link_to @portal_config[:ui] || @config[:ui], target: '_blank', class: 'home-logo-instances mr-1 m-0', style: "background-color: #{@color}" do
= inline_svg 'logo-white.svg', width: "35", height: "26"
%div
%div.portal-configuration-title{style: "color: #{@portal_config[:color] || @config[:color]}"}
%div.portal-configuration-title{style: "color: #{@color}"}
%h3
= @portal_config[:title] || @config[:name]
= @name
- if @portal_config[:numberOfArtefacts]
.portal-config-ontologies
= inline_svg_tag 'icons/ontology.svg'
%span
= "#{@portal_config[:numberOfArtefacts]} ontologies"
- if @portal_config[:description]
- if @portal_config[:description].present?
.portal-description
= @portal_config[:description]
- if @portal_config[:federated_portals]
- if @portal_config[:federated_portals].present?
%div.mb-1
.home-section-title
.text
Expand All @@ -31,7 +31,7 @@
%p{style: "color: #{portal[:color]}"}
= portal[:name]

- if @portal_config[:fundedBy]
- if @portal_config[:fundedBy].present?
%div.mb-1
.home-section-title
.portal-config-title-text
Expand Down

0 comments on commit 34ce85e

Please sign in to comment.