Skip to content

Commit

Permalink
use sorted_labels helper in get_collections_labels
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Sep 4, 2023
1 parent 74a4440 commit 519a60c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
11 changes: 1 addition & 10 deletions app/helpers/collections_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,7 @@ def get_collections_labels(collections, main_uri = '')
end
end

collections_labels.sort_by! do |s|
pref_label = s['prefLabel']

if pref_label.is_a? String
pref_label
else
pref_label.last
end
end

collections_labels = sorted_labels(collections_labels)
collections_labels.unshift selected_label if selected_label
[collections_labels, selected_label]
end
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/multi_languages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def select_language_label(concept_label, platform_languages = %i[en fr])
end

def main_language_label(label)
select_language_label(label).last
select_language_label(label)&.last
end

def display_in_multiple_languages(label)
Expand Down
5 changes: 1 addition & 4 deletions app/helpers/schemes_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ def get_schemes_labels(schemes, main_uri)
end

schemes_labels = sorted_labels(schemes_labels)

if selected_label
schemes_labels.unshift selected_label
end
schemes_labels.unshift selected_label if selected_label
[schemes_labels, selected_label]
end

Expand Down

0 comments on commit 519a60c

Please sign in to comment.