URL: https://github.com/freeipa/freeipa/pull/331 Author: pvomacka Title: #331: WebUI: don't change casing of Auth Indicators values Action: synchronized
To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/331/head:pr331 git checkout pr331
From 1b068b1f0710bdfaef252ae4c81da41bfd91ebbd Mon Sep 17 00:00:00 2001 From: Pavel Vomacka <pvoma...@redhat.com> Date: Tue, 13 Dec 2016 13:21:29 +0100 Subject: [PATCH 1/2] 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 --- 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 6ac7f4c..b1629cd 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 17b1376..375b85e 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); } From ec7923f7bbfdf88d1b1f04db7aaa663bf62b8a58 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka <pvoma...@redhat.com> Date: Tue, 13 Dec 2016 13:25:48 +0100 Subject: [PATCH 2/2] WebUI: don't change casing of Auth Indicators values All values were previously converted to lowercase which was not coresponding with CLI behaviour. Now they stay as they are inserted. I also have to change the strings to lowercase because the otp and radius should be inserted as lowercase words. https://fedorahosted.org/freeipa/ticket/6308 --- install/ui/src/freeipa/host.js | 4 ++-- install/ui/src/freeipa/service.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js index a09535c..ac434d8 100644 --- a/install/ui/src/freeipa/host.js +++ b/install/ui/src/freeipa/host.js @@ -124,11 +124,11 @@ return { add_field_label: '@i18n:authtype.auth_indicator', options: [ { - label: '@i18n:authtype.otp', + label: 'otp', value: 'otp' }, { - label: '@i18n:authtype.type_radius', + label: 'radius', value: 'radius' } ], diff --git a/install/ui/src/freeipa/service.js b/install/ui/src/freeipa/service.js index 10f86ce..279f842 100644 --- a/install/ui/src/freeipa/service.js +++ b/install/ui/src/freeipa/service.js @@ -134,11 +134,11 @@ return { add_field_label: '@i18n:authtype.auth_indicator', options: [ { - label: '@i18n:authtype.otp', + label: 'otp', value: 'otp' }, { - label: '@i18n:authtype.type_radius', + label: 'radius', value: 'radius' } ],
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code