summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-05-21 15:23:06 +0200
committerPetr Vobornik <pvoborni@redhat.com>2012-06-04 10:45:07 +0200
commitbd36600efee8b06b68262d5bf21285ab724eb797 (patch)
tree556c8ab0ad8ad3876ea4c9cb7c1ed6de4b64f8c2
parent306f380258354bae4d40758aec42f9f1c34ae2e7 (diff)
downloadfreeipa-bd36600efee8b06b68262d5bf21285ab724eb797.tar.gz
freeipa-bd36600efee8b06b68262d5bf21285ab724eb797.tar.xz
freeipa-bd36600efee8b06b68262d5bf21285ab724eb797.zip
Refactored entities to use changed actions concept
It's continuation of previous refactoring effort. This part is changing specs in entities to used changed concept. https://fedorahosted.org/freeipa/ticket/2248
-rw-r--r--install/ui/dns.js82
-rw-r--r--install/ui/hbac.js82
-rw-r--r--install/ui/selinux.js82
-rw-r--r--install/ui/sudo.js82
-rw-r--r--install/ui/user.js88
5 files changed, 228 insertions, 188 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js
index d6e6099bc..183bf67d3 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -110,32 +110,34 @@ IPA.dns.zone_entity = function(spec) {
formatter: IPA.boolean_status_formatter()
}
],
- control_buttons: {
- buttons: [
- {
- name: 'disable',
- label: IPA.messages.buttons.disable,
- icon: 'disabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'disable',
- enable_cond: ['item-selected']
- }
- },
- {
- name: 'enable',
- label: IPA.messages.buttons.enable,
- icon: 'enabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'enable',
- enable_cond: ['item-selected']
- }
- }
- ]
- }
+ actions: [
+ {
+ name: 'disable',
+ factory: IPA.batch_items_action,
+ method: 'disable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ },
+ {
+ name: 'enable',
+ factory: IPA.batch_items_action,
+ method: 'enable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ }
+ ],
+ control_buttons: [
+ {
+ name: 'disable',
+ label: IPA.messages.buttons.disable,
+ icon: 'disabled-icon'
+ },
+ {
+ name: 'enable',
+ label: IPA.messages.buttons.enable,
+ icon: 'enabled-icon'
+ }
+ ]
}).
details_facet({
factory: IPA.dnszone_details_facet,
@@ -224,17 +226,23 @@ IPA.dns.zone_entity = function(spec) {
}
]
}],
- action_list: {
- factory: IPA.action_list_widget,
- name: 'action',
- state_evaluator: {
- factory: IPA.enable_state_evaluator,
- field: 'idnszoneactive'
- },
- actions: [
- IPA.enable_action,
- IPA.disable_action,
- IPA.delete_action
+ actions: [
+ IPA.select_action,
+ IPA.enable_action,
+ IPA.disable_action,
+ IPA.delete_action
+ ],
+ header_actions: ['select_action', 'enable', 'disable', 'delete'],
+ state: {
+ evaluators: [
+ {
+ factory: IPA.enable_state_evaluator,
+ field: 'idnszoneactive'
+ }
+ ],
+ summary_conditions: [
+ IPA.enabled_summary_cond(),
+ IPA.disabled_summary_cond()
]
}
}).
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index a5bd008af..cb3249426 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -47,48 +47,56 @@ IPA.hbac.rule_entity = function(spec) {
},
'description'
],
- control_buttons: {
- buttons: [
- {
- name: 'disable',
- label: IPA.messages.buttons.disable,
- icon: 'disabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'disable',
- enable_cond: ['item-selected']
- }
- },
- {
- name: 'enable',
- label: IPA.messages.buttons.enable,
- icon: 'enabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'enable',
- enable_cond: ['item-selected']
- }
- }
- ]
- }
+ actions: [
+ {
+ name: 'disable',
+ factory: IPA.batch_items_action,
+ method: 'disable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ },
+ {
+ name: 'enable',
+ factory: IPA.batch_items_action,
+ method: 'enable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ }
+ ],
+ control_buttons: [
+ {
+ name: 'disable',
+ label: IPA.messages.buttons.disable,
+ icon: 'disabled-icon'
+ },
+ {
+ name: 'enable',
+ label: IPA.messages.buttons.enable,
+ icon: 'enabled-icon'
+ }
+ ]
}).
details_facet({
factory: IPA.hbacrule_details_facet,
entity: that,
command_mode: 'info',
- action_list: {
- factory: IPA.action_list_widget,
- name: 'action',
- state_evaluator: {
- factory: IPA.enable_state_evaluator,
- field: 'ipaenabledflag'
- },
- actions: [
- IPA.enable_action,
- IPA.disable_action,
- IPA.delete_action
+ actions: [
+ IPA.select_action,
+ IPA.enable_action,
+ IPA.disable_action,
+ IPA.delete_action
+ ],
+ header_actions: ['select_action', 'enable', 'disable', 'delete'],
+ state: {
+ evaluators: [
+ {
+ factory: IPA.enable_state_evaluator,
+ field: 'ipaenabledflag'
+ }
+ ],
+ summary_conditions: [
+ IPA.enabled_summary_cond(),
+ IPA.disabled_summary_cond()
]
}
}).
diff --git a/install/ui/selinux.js b/install/ui/selinux.js
index 766277f14..6c6d240ca 100644
--- a/install/ui/selinux.js
+++ b/install/ui/selinux.js
@@ -46,48 +46,56 @@ IPA.selinux.selinuxusermap_entity = function(spec) {
},
'description'
],
- control_buttons: {
- buttons: [
- {
- name: 'disable',
- label: IPA.messages.buttons.disable,
- icon: 'disabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'disable',
- enable_cond: ['item-selected']
- }
- },
- {
- name: 'enable',
- label: IPA.messages.buttons.enable,
- icon: 'enabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'enable',
- enable_cond: ['item-selected']
- }
- }
- ]
- }
+ actions: [
+ {
+ name: 'disable',
+ factory: IPA.batch_items_action,
+ method: 'disable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ },
+ {
+ name: 'enable',
+ factory: IPA.batch_items_action,
+ method: 'enable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ }
+ ],
+ control_buttons: [
+ {
+ name: 'disable',
+ label: IPA.messages.buttons.disable,
+ icon: 'disabled-icon'
+ },
+ {
+ name: 'enable',
+ label: IPA.messages.buttons.enable,
+ icon: 'enabled-icon'
+ }
+ ]
}).
details_facet({
factory: IPA.selinux_details_facet,
entity: that,
command_mode: 'info',
- action_list: {
- factory: IPA.action_list_widget,
- name: 'action',
- state_evaluator: {
- factory: IPA.enable_state_evaluator,
- field: 'ipaenabledflag'
- },
- actions: [
- IPA.enable_action,
- IPA.disable_action,
- IPA.delete_action
+ actions: [
+ IPA.select_action,
+ IPA.enable_action,
+ IPA.disable_action,
+ IPA.delete_action
+ ],
+ header_actions: ['select_action', 'enable', 'disable', 'delete'],
+ state: {
+ evaluators: [
+ {
+ factory: IPA.enable_state_evaluator,
+ field: 'ipaenabledflag'
+ }
+ ],
+ summary_conditions: [
+ IPA.enabled_summary_cond(),
+ IPA.disabled_summary_cond()
]
}
}).
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 1fa768573..a586c4349 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -45,48 +45,56 @@ IPA.sudo.rule_entity = function(spec) {
},
'description'
],
- control_buttons: {
- buttons: [
- {
- name: 'disable',
- label: IPA.messages.buttons.disable,
- icon: 'disabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'disable',
- enable_cond: ['item-selected']
- }
- },
- {
- name: 'enable',
- label: IPA.messages.buttons.enable,
- icon: 'enabled-icon',
- needs_confirm: true,
- action: {
- factory: IPA.batch_items_action,
- method: 'enable',
- enable_cond: ['item-selected']
- }
- }
- ]
- }
+ actions: [
+ {
+ name: 'disable',
+ factory: IPA.batch_items_action,
+ method: 'disable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ },
+ {
+ name: 'enable',
+ factory: IPA.batch_items_action,
+ method: 'enable',
+ needs_confirm: true,
+ enable_cond: ['item-selected']
+ }
+ ],
+ control_buttons: [
+ {
+ name: 'disable',
+ label: IPA.messages.buttons.disable,
+ icon: 'disabled-icon'
+ },
+ {
+ name: 'enable',
+ label: IPA.messages.buttons.enable,
+ icon: 'enabled-icon'
+ }
+ ]
}).
details_facet({
factory: IPA.sudorule_details_facet,
entity: that,
command_mode: 'info',
- action_list: {
- factory: IPA.action_list_widget,
- name: 'action',
- state_evaluator: {
- factory: IPA.enable_state_evaluator,
- field: 'ipaenabledflag'
- },
- actions: [
- IPA.enable_action,
- IPA.disable_action,
- IPA.delete_action
+ actions: [
+ IPA.select_action,
+ IPA.enable_action,
+ IPA.disable_action,
+ IPA.delete_action
+ ],
+ header_actions: ['select_action', 'enable', 'disable', 'delete'],
+ state: {
+ evaluators: [
+ {
+ factory: IPA.enable_state_evaluator,
+ field: 'ipaenabledflag'
+ }
+ ],
+ summary_conditions: [
+ IPA.enabled_summary_cond(),
+ IPA.disabled_summary_cond()
]
}
}).
diff --git a/install/ui/user.js b/install/ui/user.js
index ba25b006f..65d3de726 100644
--- a/install/ui/user.js
+++ b/install/ui/user.js
@@ -55,34 +55,36 @@ IPA.user.entity = function(spec) {
'telephonenumber',
'title'
],
- control_buttons: {
- buttons: [
- {
- name: 'disable',
- label: IPA.messages.buttons.disable,
- icon: 'disabled-icon',
- needs_confirm: true,
- hide_cond: ['self-service'],
- action: {
- factory: IPA.batch_items_action,
- method: 'disable',
- enable_cond: ['item-selected']
- }
- },
- {
- name: 'enable',
- label: IPA.messages.buttons.enable,
- icon: 'enabled-icon',
- needs_confirm: true,
- hide_cond: ['self-service'],
- action: {
- factory: IPA.batch_items_action,
- method: 'enable',
- enable_cond: ['item-selected']
- }
- }
- ]
- }
+ actions: [
+ {
+ name: 'disable',
+ factory: IPA.batch_items_action,
+ method: 'disable',
+ needs_confirm: true,
+ hide_cond: ['self-service'],
+ enable_cond: ['item-selected']
+ },
+ {
+ name: 'enable',
+ factory: IPA.batch_items_action,
+ method: 'enable',
+ needs_confirm: true,
+ hide_cond: ['self-service'],
+ enable_cond: ['item-selected']
+ }
+ ],
+ control_buttons: [
+ {
+ name: 'disable',
+ label: IPA.messages.buttons.disable,
+ icon: 'disabled-icon'
+ },
+ {
+ name: 'enable',
+ label: IPA.messages.buttons.enable,
+ icon: 'enabled-icon'
+ }
+ ]
}).
details_facet({
factory: IPA.user.details_facet,
@@ -217,18 +219,24 @@ IPA.user.entity = function(spec) {
fields: [ 'carlicense' ]
}
],
- action_list: {
- factory: IPA.action_list_widget,
- name: 'action',
- state_evaluator: {
- factory: IPA.enable_state_evaluator,
- field: 'nsaccountlock',
- invert_value: true
- },
- actions: [
- IPA.enable_action,
- IPA.disable_action,
- IPA.delete_action
+ actions: [
+ IPA.select_action,
+ IPA.enable_action,
+ IPA.disable_action,
+ IPA.delete_action
+ ],
+ header_actions: ['select_action', 'enable', 'disable', 'delete'],
+ state: {
+ evaluators: [
+ {
+ factory: IPA.enable_state_evaluator,
+ field: 'nsaccountlock',
+ invert_value: true
+ }
+ ],
+ summary_conditions: [
+ IPA.enabled_summary_cond(),
+ IPA.disabled_summary_cond()
]
}
}).