summaryrefslogtreecommitdiffstats
path: root/install/static/hbac.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-11-19 11:38:35 -0600
committerAdam Young <ayoung@redhat.com>2010-11-22 15:28:42 -0500
commit27d8529a840bb1f54e520ccd70bf7c2113d03069 (patch)
tree7f798d63d259f2b85039212917123999ad8555c3 /install/static/hbac.js
parent861a0fdba9c07d612d6a220b6ec5cf5eb3c24e46 (diff)
downloadfreeipa.git-27d8529a840bb1f54e520ccd70bf7c2113d03069.tar.gz
freeipa.git-27d8529a840bb1f54e520ccd70bf7c2113d03069.tar.xz
freeipa.git-27d8529a840bb1f54e520ccd70bf7c2113d03069.zip
Fixed action panel queries
Previously the queries for action panel were done globally. Since each entity container has its own action panel, the queries will return multiple results. This is fixed by qualifying the query to run within the entity container. The query has also been moved into ipa_facet.get_action_panel(). Entities that do not have their own entity container (e.g. HBAC services and service groups) will need to override this method to get the action panel from the right entity container (e.g. HBAC rules). The facet.setup_views() has been renamed to facet.create_action_panel(). New test data for SUDO rules have been added.
Diffstat (limited to 'install/static/hbac.js')
-rwxr-xr-xinstall/static/hbac.js42
1 files changed, 26 insertions, 16 deletions
diff --git a/install/static/hbac.js b/install/static/hbac.js
index 894b2f4a..12883efa 100755
--- a/install/static/hbac.js
+++ b/install/static/hbac.js
@@ -120,31 +120,18 @@ function ipa_hbac_search_facet(spec) {
'label': 'Cull Disabled Rules'
}));
*/
- var entity_container = $('#' + that.entity_name);
- var action_panel = $('.action-panel', entity_container);
+ var action_panel = that.get_action_panel();
var ul = $('ul', action_panel);
$('<li/>', {
title: 'hbacsvc',
- text: 'HBAC Services',
- 'click': function() {
- var state = {};
- state['entity'] = 'hbacsvc';
- nav_push_state(state);
- return false;
- }
+ text: 'HBAC Services'
}).appendTo(ul);
$('<li/>', {
title: 'hbacsvcgroup',
- text: 'HBAC Service Groups',
- 'click': function() {
- var state = {};
- state['entity'] = 'hbacsvcgroup';
- nav_push_state(state);
- return false;
- }
+ text: 'HBAC Service Groups'
}).appendTo(ul);
that.search_facet_create(container);
@@ -156,6 +143,29 @@ function ipa_hbac_search_facet(spec) {
};
+ that.setup = function(container) {
+
+ that.search_facet_setup(container);
+
+ var action_panel = that.get_action_panel();
+
+ var li = $('li[title=hbacsvc]', action_panel);
+ li.click(function() {
+ var state = {};
+ state['entity'] = 'hbacsvc';
+ nav_push_state(state);
+ return false;
+ });
+
+ li = $('li[title=hbacsvcgroup]', action_panel);
+ li.click(function() {
+ var state = {};
+ state['entity'] = 'hbacsvcgroup';
+ nav_push_state(state);
+ return false;
+ });
+ };
+
return that;
}