mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Search facets show translated boolean values
Created format method for getting translated messages for boolean values - IPA.boolean_format. Used in hosts, sudo rules, hbac rules and hbac test. https://fedorahosted.org/freeipa/ticket/2027
This commit is contained in:
parent
c1d0f72c20
commit
0e8b57b089
@ -40,7 +40,10 @@ IPA.hbac.rule_entity = function(spec) {
|
||||
search_all: true,
|
||||
columns: [
|
||||
'cn',
|
||||
'ipaenabledflag',
|
||||
{
|
||||
name: 'ipaenabledflag',
|
||||
format: IPA.boolean_format
|
||||
},
|
||||
'description'
|
||||
]
|
||||
}).
|
||||
|
@ -61,7 +61,8 @@ IPA.hbac.test_entity = function(spec) {
|
||||
'description',
|
||||
{
|
||||
name: 'has_keytab',
|
||||
label: IPA.messages.objects.host.enrolled
|
||||
label: IPA.messages.objects.host.enrolled,
|
||||
format: IPA.boolean_format
|
||||
}
|
||||
]
|
||||
}).
|
||||
@ -89,7 +90,8 @@ IPA.hbac.test_entity = function(spec) {
|
||||
'description',
|
||||
{
|
||||
name: 'has_keytab',
|
||||
label: IPA.messages.objects.host.enrolled
|
||||
label: IPA.messages.objects.host.enrolled,
|
||||
format: IPA.boolean_format
|
||||
}
|
||||
]
|
||||
}).
|
||||
@ -102,7 +104,10 @@ IPA.hbac.test_entity = function(spec) {
|
||||
facet_group: 'default',
|
||||
columns: [
|
||||
'cn',
|
||||
'ipaenabledflag',
|
||||
{
|
||||
name: 'ipaenabledflag',
|
||||
format: IPA.boolean_format
|
||||
},
|
||||
'description'
|
||||
]
|
||||
}).
|
||||
@ -118,9 +123,13 @@ IPA.hbac.test_entity = function(spec) {
|
||||
'cn',
|
||||
{
|
||||
name: 'matched',
|
||||
label: IPA.messages.objects.hbactest.matched
|
||||
label: IPA.messages.objects.hbactest.matched,
|
||||
format: IPA.boolean_format
|
||||
},
|
||||
{
|
||||
name: 'ipaenabledflag',
|
||||
format: IPA.boolean_format
|
||||
},
|
||||
'ipaenabledflag',
|
||||
'description'
|
||||
]
|
||||
});
|
||||
|
@ -39,7 +39,8 @@ IPA.host.entity = function(spec) {
|
||||
'description',
|
||||
{
|
||||
name: 'has_keytab',
|
||||
label: IPA.messages.objects.host.enrolled
|
||||
label: IPA.messages.objects.host.enrolled,
|
||||
format: IPA.boolean_format
|
||||
}
|
||||
]
|
||||
}).
|
||||
|
@ -38,7 +38,10 @@ IPA.sudo.rule_entity = function(spec) {
|
||||
that.builder.search_facet({
|
||||
columns: [
|
||||
'cn',
|
||||
'ipaenabledflag',
|
||||
{
|
||||
name: 'ipaenabledflag',
|
||||
format: IPA.boolean_format
|
||||
},
|
||||
'description'
|
||||
]
|
||||
}).
|
||||
|
@ -902,6 +902,27 @@ IPA.textarea_widget = function (spec) {
|
||||
return that;
|
||||
};
|
||||
|
||||
IPA.boolean_format = function(value) {
|
||||
|
||||
if (value === undefined || value === null) return '';
|
||||
|
||||
if (value instanceof Array) {
|
||||
value = value[0];
|
||||
}
|
||||
|
||||
var normalized_value = typeof value === 'string' ? value.toLowerCase() : '';
|
||||
|
||||
if (value === false || normalized_value === 'false') {
|
||||
return IPA.messages['false'];
|
||||
}
|
||||
|
||||
if (value === true || normalized_value === 'true') {
|
||||
return IPA.messages['true'];
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
/*
|
||||
The entity name must be set in the spec either directly or via entity.name
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user