From 0220fc8986e4fef017185bde675dc9cf0f90afd8 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Tue, 13 Dec 2016 13:21:29 +0100 Subject: 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 --- install/ui/src/freeipa/aci.js | 3 +++ install/ui/src/freeipa/widget.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) 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); } -- cgit