diff options
-rw-r--r-- | install/ui/hbac.js | 5 | ||||
-rw-r--r-- | install/ui/hbactest.js | 19 | ||||
-rw-r--r-- | install/ui/host.js | 3 | ||||
-rw-r--r-- | install/ui/sudo.js | 5 | ||||
-rw-r--r-- | install/ui/widget.js | 21 |
5 files changed, 45 insertions, 8 deletions
diff --git a/install/ui/hbac.js b/install/ui/hbac.js index 21333fa7..3d2124e4 100644 --- a/install/ui/hbac.js +++ b/install/ui/hbac.js @@ -40,7 +40,10 @@ IPA.hbac.rule_entity = function(spec) { search_all: true, columns: [ 'cn', - 'ipaenabledflag', + { + name: 'ipaenabledflag', + format: IPA.boolean_format + }, 'description' ] }). diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js index 57ded45b..d9a854f1 100644 --- a/install/ui/hbactest.js +++ b/install/ui/hbactest.js @@ -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' ] }); diff --git a/install/ui/host.js b/install/ui/host.js index 94dd6465..7427a9b1 100644 --- a/install/ui/host.js +++ b/install/ui/host.js @@ -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 } ] }). diff --git a/install/ui/sudo.js b/install/ui/sudo.js index 2d3baf95..5e1dedc7 100644 --- a/install/ui/sudo.js +++ b/install/ui/sudo.js @@ -38,7 +38,10 @@ IPA.sudo.rule_entity = function(spec) { that.builder.search_facet({ columns: [ 'cn', - 'ipaenabledflag', + { + name: 'ipaenabledflag', + format: IPA.boolean_format + }, 'description' ] }). diff --git a/install/ui/widget.js b/install/ui/widget.js index ef2c6eb6..a8ad5cd8 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -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 */ |