mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
DNS forward policy: checkboxes changed to radio buttons
DNS forward policy fields were using mutually exclusive checkboxes. Such behavior is unusual for users. Checkboxes were changed to radios. https://fedorahosted.org/freeipa/ticket/2599
This commit is contained in:
@@ -52,10 +52,19 @@ IPA.dns.config_entity = function(spec) {
|
||||
validators: [IPA.dnsforwarder_validator()]
|
||||
},
|
||||
{
|
||||
type: 'checkboxes',
|
||||
type: 'radio',
|
||||
name: 'idnsforwardpolicy',
|
||||
mutex: true,
|
||||
options: IPA.create_options(['only', 'first'])
|
||||
default_value: 'first',
|
||||
options: [
|
||||
{
|
||||
value: 'first',
|
||||
label: IPA.messages.objects.dnsconfig.forward_first
|
||||
},
|
||||
{
|
||||
value: 'only',
|
||||
label: IPA.messages.objects.dnsconfig.forward_only
|
||||
}
|
||||
]
|
||||
},
|
||||
'idnszonerefresh'
|
||||
]
|
||||
@@ -170,10 +179,19 @@ IPA.dns.zone_entity = function(spec) {
|
||||
validators: [IPA.dnsforwarder_validator()]
|
||||
},
|
||||
{
|
||||
type: 'checkboxes',
|
||||
type: 'radio',
|
||||
name: 'idnsforwardpolicy',
|
||||
mutex: true,
|
||||
options: IPA.create_options(['only', 'first'])
|
||||
default_value: 'first',
|
||||
options: [
|
||||
{
|
||||
value: 'first',
|
||||
label: IPA.messages.objects.dnsconfig.forward_first
|
||||
},
|
||||
{
|
||||
value: 'only',
|
||||
label: IPA.messages.objects.dnsconfig.forward_only
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'checkbox',
|
||||
|
||||
@@ -1516,17 +1516,22 @@ IPA.limit_text = function(value, max_length) {
|
||||
return limited_text;
|
||||
};
|
||||
|
||||
IPA.create_options = function(labels, values) {
|
||||
|
||||
if(!values) values = labels;
|
||||
IPA.create_options = function(values) {
|
||||
|
||||
var options = [];
|
||||
|
||||
for (var i=0; i<labels.length; i++) {
|
||||
options.push({
|
||||
label: labels[i],
|
||||
value: values[i]
|
||||
});
|
||||
for (var i=0; i<values.length; i++) {
|
||||
var val = values[i];
|
||||
var option = val;
|
||||
|
||||
if (typeof val === 'string') {
|
||||
option = {
|
||||
value: val,
|
||||
label: val
|
||||
};
|
||||
}
|
||||
|
||||
options.push(option);
|
||||
}
|
||||
|
||||
return options;
|
||||
|
||||
@@ -201,6 +201,8 @@
|
||||
},
|
||||
"delegation": {},
|
||||
"dnsconfig": {
|
||||
"forward_first": "Forward first",
|
||||
"forward_only": "Forward only",
|
||||
"options": "Options"
|
||||
},
|
||||
"dnsrecord": {
|
||||
|
||||
@@ -338,6 +338,8 @@ class i18n_messages(Command):
|
||||
"delegation": {
|
||||
},
|
||||
"dnsconfig": {
|
||||
"forward_first": _("Forward first"),
|
||||
"forward_only": _("Forward only"),
|
||||
"options": _("Options"),
|
||||
},
|
||||
"dnsrecord": {
|
||||
|
||||
Reference in New Issue
Block a user