From 39a93873f41fcc8150a8ed0531bf45c79ef816cf Mon Sep 17 00:00:00 2001 From: Bilel KIHAL Date: Tue, 5 Nov 2024 12:13:57 +0100 Subject: [PATCH 1/4] fix broken switch style when using a long text with it --- app/assets/stylesheets/components/switch.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/components/switch.scss b/app/assets/stylesheets/components/switch.scss index 003474383d..13fb751035 100644 --- a/app/assets/stylesheets/components/switch.scss +++ b/app/assets/stylesheets/components/switch.scss @@ -9,6 +9,7 @@ color: #666666; margin-bottom: 0; margin-right: 10px; + max-width: 207px; } From c8ad07ae28fed1d76cf44c681f6a82838d3d4a22 Mon Sep 17 00:00:00 2001 From: Bilel KIHAL Date: Tue, 5 Nov 2024 12:45:52 +0100 Subject: [PATCH 2/4] don't show current portal name button in browse page results --- app/controllers/concerns/submission_filter.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/concerns/submission_filter.rb b/app/controllers/concerns/submission_filter.rb index c039147280..f1ff7792e2 100644 --- a/app/controllers/concerns/submission_filter.rb +++ b/app/controllers/concerns/submission_filter.rb @@ -72,6 +72,7 @@ def merge_by_acronym(submissions) submissions.group_by { |x| x[:ontology]&.acronym }.each do |acronym, ontologies| ontology = canonical_ontology(ontologies) ontology[:sources] = ontologies.map { |x| x[:id] } + ontology[:sources].reject! { |id| id.include?(portal_name.downcase) } merged_submissions << ontology end merged_submissions From 24993caed096c48a71c9470bf27e39c23b5feb8a Mon Sep 17 00:00:00 2001 From: Bilel KIHAL Date: Tue, 5 Nov 2024 12:55:57 +0100 Subject: [PATCH 3/4] adjest switch text max-width only for browse filter --- app/assets/stylesheets/browse.scss | 3 +++ app/assets/stylesheets/components/switch.scss | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/browse.scss b/app/assets/stylesheets/browse.scss index a55292bde0..57e857442c 100644 --- a/app/assets/stylesheets/browse.scss +++ b/app/assets/stylesheets/browse.scss @@ -266,6 +266,9 @@ z-index: 1; } +.browse-filter .switch-filter > p, .switch-filter > div{ + max-width: 207px; +} .browse-search-bar input:focus { box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px; diff --git a/app/assets/stylesheets/components/switch.scss b/app/assets/stylesheets/components/switch.scss index 13fb751035..003474383d 100644 --- a/app/assets/stylesheets/components/switch.scss +++ b/app/assets/stylesheets/components/switch.scss @@ -9,7 +9,6 @@ color: #666666; margin-bottom: 0; margin-right: 10px; - max-width: 207px; } From fac4fcaf927c78d9faed4d39c8f8582059e212c7 Mon Sep 17 00:00:00 2001 From: Bilel KIHAL Date: Tue, 5 Nov 2024 13:39:37 +0100 Subject: [PATCH 4/4] don't show portal name only if it's unique in browse page federated results --- app/controllers/concerns/submission_filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/submission_filter.rb b/app/controllers/concerns/submission_filter.rb index f1ff7792e2..5bb9937e1a 100644 --- a/app/controllers/concerns/submission_filter.rb +++ b/app/controllers/concerns/submission_filter.rb @@ -72,7 +72,7 @@ def merge_by_acronym(submissions) submissions.group_by { |x| x[:ontology]&.acronym }.each do |acronym, ontologies| ontology = canonical_ontology(ontologies) ontology[:sources] = ontologies.map { |x| x[:id] } - ontology[:sources].reject! { |id| id.include?(portal_name.downcase) } + ontology[:sources].reject! { |id| id.include?(portal_name.downcase) } if ontology[:sources].size.eql?(1) merged_submissions << ontology end merged_submissions