From b7318e03ccce5777ed05695e90852970ceaf4c43 Mon Sep 17 00:00:00 2001 From: Bilel Kihal <61744974+Bilelkihal@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:41:33 +0100 Subject: [PATCH] Fix: Browse page switch style, and don't display current portal name button in browse results (#828) * fix broken switch style when using a long text with it * don't show current portal name button in browse page results * adjest switch text max-width only for browse filter * don't show portal name only if it's unique in browse page federated results --- app/assets/stylesheets/browse.scss | 3 +++ app/controllers/concerns/submission_filter.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/app/assets/stylesheets/browse.scss b/app/assets/stylesheets/browse.scss index a55292bde..57e857442 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/controllers/concerns/submission_filter.rb b/app/controllers/concerns/submission_filter.rb index c03914728..5bb9937e1 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) } if ontology[:sources].size.eql?(1) merged_submissions << ontology end merged_submissions