From 2b676ce95e3bf7071a0ba5aa2fb4b825dd02cde2 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Wed, 3 Apr 2024 08:11:33 +0200 Subject: [PATCH] fix: login page icons size --- app/components/display/info_tooltip_component.rb | 6 +++++- app/controllers/annotator_controller.rb | 2 +- app/views/login/index.html.haml | 6 +++--- test/system/login_flows_test.rb | 3 +-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/components/display/info_tooltip_component.rb b/app/components/display/info_tooltip_component.rb index 753f4159f..a9e10fd89 100644 --- a/app/components/display/info_tooltip_component.rb +++ b/app/components/display/info_tooltip_component.rb @@ -9,7 +9,11 @@ def initialize(text: nil , icon: "info.svg") end def call content_tag(:div, data:{controller:'tooltip', 'tooltip-interactive-value': 'true'}, title: @text, style: 'display: inline-block;') do - inline_svg_tag "icons/#{@icon}", width: '20', height: '20' + if content + content + else + inline_svg_tag "icons/#{@icon}", width: '20', height: '20' + end end end diff --git a/app/controllers/annotator_controller.rb b/app/controllers/annotator_controller.rb index 7a8e05d85..cfda565c3 100644 --- a/app/controllers/annotator_controller.rb +++ b/app/controllers/annotator_controller.rb @@ -153,7 +153,7 @@ def get_semantic_types return semantic_types if sty_ont.nil? # The first 500 items should be more than sufficient to get all semantic types. sty_classes = sty_ont.explore.classes({'pagesize'=>500, include: 'prefLabel'}) - sty_classes.collection.each do |cls| + Array(sty_classes.collection).each do |cls| code = cls.id.split("/").last semantic_types[ code ] = cls.prefLabel end diff --git a/app/views/login/index.html.haml b/app/views/login/index.html.haml index 80c50a39f..2ab02ae26 100644 --- a/app/views/login/index.html.haml +++ b/app/views/login/index.html.haml @@ -27,9 +27,9 @@ class: 'btn btn-lg',disabled: !config[:enable] ,style:'width: 70px', title: t('login.login_with_provider', provider: provider.to_s.humanize), 'data-turbo': false do; - if config[:icon] = inline_svg "icons/#{config[:icon]}", class: 'login-active-sso' - - else + - else = provider.to_s.humanize - else .disabled-login-sso - = render Display::InfoTooltipComponent.new(text: "#{provider.to_s.humanize} is disabled", icon: config[:icon]) - \ No newline at end of file + = render Display::InfoTooltipComponent.new(text: "#{provider.to_s.humanize} is disabled") do + = inline_svg "icons/#{config[:icon]}", width: "40", height: "40" \ No newline at end of file diff --git a/test/system/login_flows_test.rb b/test/system/login_flows_test.rb index 1ac94324d..0c4a152f1 100644 --- a/test/system/login_flows_test.rb +++ b/test/system/login_flows_test.rb @@ -62,9 +62,8 @@ class LoginFlowsTest < ApplicationSystemTestCase assert_selector '.account-page-card-title', text: 'API Key' assert_selector '.account-page-card-title', text: 'Subscriptions' - assert_selector '.account-page-card-title', text: 'Submitted Semantic Resources' + assert_selector '.account-page-card-title', text: 'Submitted Ontologies' assert_selector '.account-page-card-title', text: 'Projects Created' - end test "go to login page and click save" do