summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Vomacka <pvomacka@redhat.com>2016-12-13 13:21:29 +0100
committerDavid Kupka <dkupka@redhat.com>2017-03-08 15:43:11 +0100
commit0220fc8986e4fef017185bde675dc9cf0f90afd8 (patch)
tree8897ffcd2e8e872b8a1f956e565e3e961e2083d3
parent56a2642af0a29328df4defef138b9fa65624335a (diff)
downloadfreeipa-0220fc8986e4fef017185bde675dc9cf0f90afd8.tar.gz
freeipa-0220fc8986e4fef017185bde675dc9cf0f90afd8.tar.xz
freeipa-0220fc8986e4fef017185bde675dc9cf0f90afd8.zip
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>
-rw-r--r--install/ui/src/freeipa/aci.js3
-rw-r--r--install/ui/src/freeipa/widget.js4
2 files changed, 6 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 6ac7f4c71..b1629cd51 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -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;
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 0be4315c5..223b44996 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -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);
}