summaryrefslogtreecommitdiffstats
path: root/install/static/hbacsvcgroup.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-11-15 11:10:55 -0600
committerEndi Sukma Dewata <edewata@redhat.com>2010-11-15 12:48:45 -0500
commit9c502641b5f7bf613eb9dbd4be21fbaf92312267 (patch)
tree9421ac0faa0dd3bbd2dac71c6b0a4a94ec3fd6b1 /install/static/hbacsvcgroup.js
parent629e9520e0b5ce1ae6138d4e2c69ac52927c044a (diff)
downloadfreeipa-9c502641b5f7bf613eb9dbd4be21fbaf92312267.tar.gz
freeipa-9c502641b5f7bf613eb9dbd4be21fbaf92312267.tar.xz
freeipa-9c502641b5f7bf613eb9dbd4be21fbaf92312267.zip
HBAC details page enhancement
The HBAC details page has been enhanced to support Undo and Reset operations. The functionality is implemented in the base widget class so the behavior will be more consistent across widgets. A <span> tag now used to define the field boundary in the HTML doc. The tag contains the visual representation of the field which include the input tag and optionally the undo link. The Update method on HBAC details page has been modified so that it executes several operations using a batch command. The operations being executed depends on the changes made to the fields. These operations may include: - removing access time if access time is changed to any time - removing memberships if member category is changed to all - modifying rule attributes if description or rule type is changed - enabling/disabling the rule if rule status is changed The behavior of the Add & Remove buttons also has been changed such that it adjust the category attribute properly in addition to adding the memberships using batch command. For example, if category is initially set to all, adding a new member will also change the category to empty. The ipa_command have been modified to store the on_success and on_error handlers as properties. When the command is executed as a part of batch operation, the result of each command will be passed to the appropriate handler. The unit tests and test data have been updated as well.
Diffstat (limited to 'install/static/hbacsvcgroup.js')
-rwxr-xr-xinstall/static/hbacsvcgroup.js57
1 files changed, 13 insertions, 44 deletions
diff --git a/install/static/hbacsvcgroup.js b/install/static/hbacsvcgroup.js
index 979decdb7..3a3365559 100755
--- a/install/static/hbacsvcgroup.js
+++ b/install/static/hbacsvcgroup.js
@@ -80,8 +80,8 @@ function ipa_hbacsvcgroup_add_dialog(spec) {
this.superior_init();
- this.add_field(ipa_text_widget({name:'cn', label:'Name'}));
- this.add_field(ipa_text_widget({name:'description', label:'Description'}));
+ this.add_field(ipa_text_widget({name:'cn', label:'Name', undo: false}));
+ this.add_field(ipa_text_widget({name:'description', label:'Description', undo: false}));
};
return that;
@@ -102,12 +102,6 @@ function ipa_hbacsvcgroup_search_facet(spec) {
that.create_column({name:'cn', label:'Group', primary_key: true});
that.create_column({name:'description', label:'Description'});
- that.create_column({
- name: 'quick_links',
- label: 'Quick Links',
- setup: ipa_hbacsvcgroup_quick_links
- });
-
that.superior_init();
};
@@ -118,31 +112,29 @@ function ipa_hbacsvcgroup_search_facet(spec) {
// TODO: replace with IPA.metadata[that.entity_name].label
$('<h2/>', { 'html': 'HBAC Service Groups' }).appendTo(container);
- var right_buttons = $('<li/>', {
- 'style': 'float: right;'
- }).appendTo($('.action-panel ul'));
+ var ul = $('.action-panel ul');
- right_buttons.append(ipa_button({
- 'label': 'HBAC Rules',
+ $('<li/>', {
+ title: 'hbac',
+ text: 'HBAC Rules',
'click': function() {
var state = {};
state['entity'] = 'hbac';
nav_push_state(state);
return false;
}
- }));
+ }).appendTo(ul);
- right_buttons.append(ipa_button({
- 'label': 'HBAC Services',
+ $('<li/>', {
+ title: 'hbacsvc',
+ text: 'HBAC Services',
'click': function() {
var state = {};
state['entity'] = 'hbacsvc';
nav_push_state(state);
return false;
}
- }));
-
- container.append('<br/><br/>');
+ }).appendTo(ul);
that.superior_create(container);
};
@@ -151,30 +143,6 @@ function ipa_hbacsvcgroup_search_facet(spec) {
}
-function ipa_hbacsvcgroup_quick_links(container, name, value, record) {
-
- var that = this;
-
- var pkey = IPA.metadata[that.entity_name].primary_key;
- var pkey_value = record[pkey];
-
- var link = $('<a/>', {
- 'href': '#details',
- 'title': 'Details',
- 'text': 'Details',
- 'click': function() {
- var state = {};
- state[that.entity_name+'-facet'] = 'details';
- state[that.entity_name+'-pkey'] = pkey_value;
- nav_push_state(state);
- return false;
- }
- });
-
- var span = $('span[name="'+name+'"]', container);
- span.html(link);
-}
-
function ipa_hbacsvcgroup_details_facet(spec) {
spec = spec || {};
@@ -187,10 +155,11 @@ function ipa_hbacsvcgroup_details_facet(spec) {
that.init = function() {
- var section = that.create_section({
+ var section = ipa_details_list_section({
'name': 'general',
'label': 'General'
});
+ that.add_section(section);
section.create_field({ 'name': 'cn', 'label': 'Name' });
section.create_field({ 'name': 'description', 'label': 'Description' });