WebUI: Allow disabling lowering text in custom_checkbox_widget

Add new attribute which keeps information whether each text added
using custom_checkbox_widget shoud be transformed to lowercase.

Part of: https://fedorahosted.org/freeipa/ticket/6308

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Pavel Vomacka
2016-12-13 13:21:29 +01:00
committed by David Kupka
parent 56a2642af0
commit 0220fc8986
2 changed files with 6 additions and 1 deletions

View File

@@ -546,6 +546,9 @@ aci.attributes_widget = function(spec) {
spec.add_field_label = spec.add_field_label ||
'@i18n:objects.permission.attribute';
spec.set_value_to_lowercase = spec.set_value_to_lowercase === undefined ?
true : spec.set_value_to_lowercase;
var that = IPA.custom_checkboxes_widget(spec);
that.object_type = spec.object_type;

View File

@@ -2502,6 +2502,8 @@ IPA.custom_checkboxes_widget = function(spec) {
var that = IPA.checkboxes_widget(spec);
that.set_value_to_lowercase = spec.set_value_to_lowercase || false;
that.add_dialog_title = spec.add_dialog_title ||
"@i18n:dialogs.add_custom_value";
that.add_field_label = spec.add_field_label ||
@@ -2619,7 +2621,7 @@ IPA.custom_checkboxes_widget = function(spec) {
if (!value || value === '') continue;
value = value.toLowerCase();
if (that.set_value_to_lowercase) value = value.toLowerCase();
that.values.push(value);
}