diff options
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/dns.js | 15 | ||||
-rw-r--r-- | install/ui/hbac.js | 10 | ||||
-rw-r--r-- | install/ui/hbactest.js | 21 | ||||
-rw-r--r-- | install/ui/selinux.js | 10 | ||||
-rw-r--r-- | install/ui/sudo.js | 10 | ||||
-rw-r--r-- | install/ui/test/data/dnszone_find_pkeys.json | 6 | ||||
-rw-r--r-- | install/ui/test/data/dnszone_get_records.json | 49 | ||||
-rw-r--r-- | install/ui/test/data/ipa_init.json | 21 | ||||
-rw-r--r-- | install/ui/user.js | 36 | ||||
-rw-r--r-- | install/ui/widget.js | 13 |
10 files changed, 129 insertions, 62 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js index 6383d9227..d23eca3a9 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -43,8 +43,16 @@ IPA.dns.zone_entity = function(spec) { that.builder.facet_groups([ 'dnsrecord', 'settings' ]). search_facet({ + row_enabled_attribute: 'idnszoneactive', title: IPA.metadata.objects.dnszone.label, - columns: [ 'idnsname' ] + columns: [ + 'idnsname', + { + name: 'idnszoneactive', + label: IPA.messages.status.label, + format: IPA.boolean_status_format() + } + ] }). details_facet({ factory: IPA.dnszone_details_facet, @@ -55,9 +63,10 @@ IPA.dns.zone_entity = function(spec) { { type: 'radio', name: 'idnszoneactive', + label: IPA.messages.status.label, options: [ - { value: 'TRUE', label: IPA.get_message('true') }, - { value: 'FALSE', label: IPA.get_message('false') } + { value: 'TRUE', label: IPA.messages.status.enabled }, + { value: 'FALSE', label: IPA.messages.status.disabled } ] }, 'idnssoamname', diff --git a/install/ui/hbac.js b/install/ui/hbac.js index 5d6de15d3..bff2af30c 100644 --- a/install/ui/hbac.js +++ b/install/ui/hbac.js @@ -43,9 +43,8 @@ IPA.hbac.rule_entity = function(spec) { 'cn', { name: 'ipaenabledflag', - format: IPA.boolean_format({ - show_false: true - }) + label: IPA.messages.status.label, + format: IPA.boolean_status_format() }, 'description' ] @@ -208,6 +207,7 @@ IPA.hbacrule_details_facet = function(spec) { { type: 'enable', name: 'ipaenabledflag', + label: IPA.messages.status.label, priority: IPA.hbac.enable_priority, widget: 'general.ipaenabledflag' } @@ -230,8 +230,8 @@ IPA.hbacrule_details_facet = function(spec) { type: 'enable', name: 'ipaenabledflag', options: [ - { value: 'TRUE', label: IPA.get_message('true') }, - { value: 'FALSE', label: IPA.get_message('false') } + { value: 'TRUE', label: IPA.messages.status.enabled }, + { value: 'FALSE', label: IPA.messages.status.disabled } ] } ] diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js index b529a1d5f..e9b02a14c 100644 --- a/install/ui/hbactest.js +++ b/install/ui/hbactest.js @@ -50,13 +50,10 @@ IPA.hbac.test_entity = function(spec) { 'sn', { name: 'nsaccountlock', - format: IPA.boolean_format({ - true_value: IPA.messages.objects.user.active, - false_value: IPA.messages.objects.user.inactive, - invert_value: true, - show_false: true - }), - label: IPA.messages.objects.user.account_status + label: IPA.messages.status.label, + format: IPA.boolean_status_format({ + invert_value: true + }) } ] }). @@ -118,9 +115,8 @@ IPA.hbac.test_entity = function(spec) { 'cn', { name: 'ipaenabledflag', - format: IPA.boolean_format({ - show_false: true - }) + label: IPA.messages.status.label, + format: IPA.boolean_status_format() }, 'description' ] @@ -142,9 +138,8 @@ IPA.hbac.test_entity = function(spec) { }, { name: 'ipaenabledflag', - format: IPA.boolean_format({ - show_false: true - }) + label: IPA.messages.status.label, + format: IPA.boolean_status_format() }, 'description' ] diff --git a/install/ui/selinux.js b/install/ui/selinux.js index 1ca11760d..050659a67 100644 --- a/install/ui/selinux.js +++ b/install/ui/selinux.js @@ -42,9 +42,8 @@ IPA.selinux.selinuxusermap_entity = function(spec) { 'ipaselinuxuser', { name: 'ipaenabledflag', - format: IPA.boolean_format({ - show_false: true - }) + label: IPA.messages.status.label, + format: IPA.boolean_status_format() }, 'description' ] @@ -96,6 +95,7 @@ IPA.selinux_details_facet = function(spec) { { type: 'enable', name: 'ipaenabledflag', + label: IPA.messages.status.label, priority: IPA.selinux.enable_priority, widget: 'general.ipaenabledflag' } @@ -128,8 +128,8 @@ IPA.selinux_details_facet = function(spec) { type: 'enable', name: 'ipaenabledflag', options: [ - { value: 'TRUE', label: IPA.get_message('true') }, - { value: 'FALSE', label: IPA.get_message('false') } + { value: 'TRUE', label: IPA.messages.status.enabled }, + { value: 'FALSE', label: IPA.messages.status.disabled } ] } ] diff --git a/install/ui/sudo.js b/install/ui/sudo.js index f1b64bd55..78af5fce1 100644 --- a/install/ui/sudo.js +++ b/install/ui/sudo.js @@ -41,9 +41,8 @@ IPA.sudo.rule_entity = function(spec) { 'cn', { name: 'ipaenabledflag', - format: IPA.boolean_format({ - show_false: true - }) + label: IPA.messages.status.label, + format: IPA.boolean_status_format() }, 'description' ] @@ -206,6 +205,7 @@ IPA.sudorule_details_facet = function(spec) { { type: 'enable', name: 'ipaenabledflag', + label: IPA.messages.status.label, priority: IPA.sudo.enable_priority, widget: 'general.ipaenabledflag' } @@ -228,8 +228,8 @@ IPA.sudorule_details_facet = function(spec) { type: 'enable', name: 'ipaenabledflag', options: [ - { value: 'TRUE', label: IPA.get_message('true') }, - { value: 'FALSE', label: IPA.get_message('false') } + { value: 'TRUE', label: IPA.messages.status.enabled }, + { value: 'FALSE', label: IPA.messages.status.disabled } ] } ] diff --git a/install/ui/test/data/dnszone_find_pkeys.json b/install/ui/test/data/dnszone_find_pkeys.json index f40636f43..8f642cce8 100644 --- a/install/ui/test/data/dnszone_find_pkeys.json +++ b/install/ui/test/data/dnszone_find_pkeys.json @@ -15,6 +15,12 @@ "idnsname": [ "example.com" ] + }, + { + "dn": "idnsname=test.com,cn=dns,dc=example,dc=com", + "idnsname": [ + "test.com" + ] } ], "summary": null, diff --git a/install/ui/test/data/dnszone_get_records.json b/install/ui/test/data/dnszone_get_records.json index 2e14716ce..d1d20bf03 100644 --- a/install/ui/test/data/dnszone_get_records.json +++ b/install/ui/test/data/dnszone_get_records.json @@ -101,6 +101,55 @@ }, "summary": null, "value": "example.com" + }, + { + "error": null, + "result": { + "dn": "idnsname=test.com,cn=dns,dc=example,dc=com", + "idnsallowdynupdate": [ + "TRUE" + ], + "idnsname": [ + "test.com" + ], + "idnssoaexpire": [ + "1209600" + ], + "idnssoaminimum": [ + "3600" + ], + "idnssoamname": [ + "dev.example.com." + ], + "idnssoarefresh": [ + "3600" + ], + "idnssoaretry": [ + "900" + ], + "idnssoarname": [ + "root.dev.example.com." + ], + "idnssoaserial": [ + "2010021201" + ], + "idnsupdatepolicy": [ + "grant TEST.COM krb5-self * A;" + ], + "idnszoneactive": [ + "FALSE" + ], + "nsrecord": [ + "dev.example.com." + ], + "objectclass": [ + "top", + "idnsrecord", + "idnszone" + ] + }, + "summary": null, + "value": "test.com" } ] } diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index a0738734b..b819c30b1 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -202,12 +202,10 @@ "posix": "Is this a POSIX group?" }, "hbacrule": { - "active": "Active", "any_host": "Any Host", "any_service": "Any Service", "anyone": "Anyone", "host": "Accessing", - "inactive": "Inactive", "ipaenabledflag": "Rule status", "service": "Via Service", "sourcehost": "From", @@ -310,7 +308,6 @@ "commands": "Commands" }, "sudorule": { - "active": "Active", "allow": "Allow", "any_command": "Any Command", "any_group": "Any Group", @@ -320,7 +317,6 @@ "deny": "Deny", "external": "External", "host": "Access this host", - "inactive": "Inactive", "ipaenabledflag": "Rule status", "options": "Options", "runas": "As Whom", @@ -333,17 +329,13 @@ "user": { "account": "Account Settings", "account_status": "Account Status", - "activate": "Activate", - "activation_confirmation": "Are you sure you want to ${action} the user?<br/>The change will take effect immediately.", - "activation_link": "Click to ${action}", - "active": "Active", "contact": "Contact Settings", - "deactivate": "Deactivate", "employee": "Employee Information", "error_changing_status": "Error changing account status", - "inactive": "Inactive", "mailing": "Mailing Address", - "misc": "Misc. Information" + "misc": "Misc. Information", + "status_confirmation": "Are you sure you want to ${action} the user?<br/>The change will take effect immediately.", + "status_link": "Click to ${action}" } }, "password": { @@ -363,6 +355,13 @@ "truncated": "Query returned more results than the configured size limit. Displaying the first ${counter} results.", "unselect_all": "Unselect All" }, + "status": { + "disable": "Disable", + "disabled": "Disabled", + "enable": "Enable", + "enabled": "Enabled", + "label": "Status" + }, "tabs": { "audit": "Audit", "automount": "Automount", diff --git a/install/ui/user.js b/install/ui/user.js index 92ac86a83..2466b8801 100644 --- a/install/ui/user.js +++ b/install/ui/user.js @@ -43,13 +43,10 @@ IPA.user.entity = function(spec) { 'sn', { name: 'nsaccountlock', - format: IPA.boolean_format({ - true_value: IPA.messages.objects.user.active, - false_value: IPA.messages.objects.user.inactive, - invert_value: true, - show_false: true - }), - label: IPA.messages.objects.user.account_status + label: IPA.messages.status.label, + format: IPA.boolean_status_format({ + invert_value: true + }) }, 'uidnumber', 'mail', @@ -78,7 +75,7 @@ IPA.user.entity = function(spec) { { factory: IPA.user_status_widget, name: 'nsaccountlock', - label: IPA.messages.objects.user.account_status + label: IPA.messages.status.label }, 'uid', { @@ -439,19 +436,19 @@ IPA.user_status_widget = function(spec) { var action; if (locked) { - status = IPA.messages.objects.user.inactive; - action = 'activate'; + status = IPA.messages.status.disabled; + action = 'enable'; } else { - status = IPA.messages.objects.user.active; - action = 'deactivate'; + status = IPA.messages.status.enabled; + action = 'disable'; } that.status_span.html(status); that.status_link.attr('href', action); - var message = IPA.messages.objects.user.activation_link; - var action_label = IPA.messages.objects.user[action]; + var message = IPA.messages.objects.user.status_link; + var action_label = IPA.messages.status[action]; message = message.replace('${action}', action_label); that.status_link.html(message); @@ -473,12 +470,12 @@ IPA.user_status_widget = function(spec) { var action = that.status_link.attr('href'); - var message = IPA.messages.objects.user.activation_confirmation; - var action_label = IPA.messages.objects.user[action]; + var message = IPA.messages.objects.user.status_confirmation; + var action_label = IPA.messages.status[action]; message = message.replace('${action}', action_label.toLocaleLowerCase()); var dialog = IPA.dialog({ - 'title': IPA.messages.dialogs.confirmation + title: IPA.messages.dialogs.confirmation }); dialog.create = function() { @@ -490,7 +487,7 @@ IPA.user_status_widget = function(spec) { label: action_label, click: function() { that.set_status( - action == 'activate', + action, function(data, textStatus, xhr) { var facet = that.entity.get_facet(); facet.refresh(); @@ -511,10 +508,9 @@ IPA.user_status_widget = function(spec) { dialog.open(that.container); }; - that.set_status = function(enabled, on_success, on_error) { + that.set_status = function(method, on_success, on_error) { var pkey = IPA.nav.get_state('user-pkey'); - var method = enabled ? 'enable' : 'disable'; IPA.command({ entity: 'user', diff --git a/install/ui/widget.js b/install/ui/widget.js index 85d9282c2..a7dd81e67 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -1019,6 +1019,19 @@ IPA.boolean_format = function(spec) { return that; }; +IPA.boolean_status_format = function(spec) { + + spec = spec || {}; + + var that = IPA.boolean_format(spec); + + that.true_value = spec.true_value || IPA.messages.status.enabled; + that.false_value = spec.false_value || IPA.messages.status.disabled; + that.show_false = true; + + return that; +}; + /* The entity name must be set in the spec either directly or via entity.name */ |