[50019] Fix untranslated 2fa strategies

This commit is contained in:
Christophe Bliard
2023-11-30 18:11:18 +01:00
parent b7e402bc61
commit f48435bd0d
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ See COPYRIGHT and LICENSE files for more details.
<% component.with_attribute(
key: @application.class.human_attribute_name(:redirect_uri),
value: safe_join(@application.redirect_uri.split("\n"), '<br/>'.html_safe)
value: safe_join(@application.redirect_uri.split("\n"), tag(:br))
) %>
<% if !@application.client_credentials_user_id %>
@@ -20,11 +20,12 @@
value: if configuration['active_strategies'].empty?
t(:label_none)
else
configuration['active_strategies'].join(content_tag(:br)) do |key|
strategies = configuration['active_strategies'].map do |key|
content_tag(:span) do
t("two_factor_authentication.strategies.#{key}")
end
end
safe_join(strategies, tag(:br))
end)
component.with_attribute(key: t('two_factor_authentication.settings.label_enforced'),
@@ -38,6 +38,13 @@ RSpec.describe AttributeGroups::AttributeKeyValueComponent, type: :component do
have_css('.attributes-key-value--value.-text', text: 'Attribute Value')
end
it "preserve html in the value if it's a safe string" do
render_inline(described_class.new(key: 'Attribute Key', value: '<div>Some value</div>'.html_safe))
expect(page).not_to have_css('.attributes-key-value--value.-text', text: "<div>Some value</div>")
expect(page).to have_css('.attributes-key-value--value.-text', text: "Some value")
end
context 'with value and content' do
it 'renders the content' do
render_inline(described_class.new(key: 'Attribute Key', value: 'Attribute Value')) do