Skip to content

Commit

Permalink
add the option to not show the language alert message for synonyms
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jan 9, 2025
1 parent 7d3480b commit 70fe026
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/helpers/multi_languages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def lang_code(code_in)
end

# @param label String | Array | OpenStruct
def display_in_multiple_languages(label, show_max: 10, style_as_badge: false)
if label.blank?
def display_in_multiple_languages(label, show_max: 10, style_as_badge: false, show_empty_alert: false)
if label.blank? || show_empty_alert
return render Display::AlertComponent.new(message: t('ontology_details.concept.no_preferred_name_for_selected_language'),
type: "warning",
closable: true)
Expand Down
2 changes: 1 addition & 1 deletion app/views/concepts/_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- t.add_row({th: t('ontology_details.concept.synonyms')}) do |h|
- h.td do
%div.d-flex.justify-content-between
= display_in_multiple_languages(@concept.synonym, style_as_badge: true, show_max: 5)
= display_in_multiple_languages(@concept.synonym, show_empty_alert: false, style_as_badge: true)
%div.synonym-change-request
= add_synonym_button
= remove_synonym_button
Expand Down

0 comments on commit 70fe026

Please sign in to comment.