From 27d8529a840bb1f54e520ccd70bf7c2113d03069 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 19 Nov 2010 11:38:35 -0600 Subject: 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. --- install/static/hbacsvc.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'install/static/hbacsvc.js') diff --git a/install/static/hbacsvc.js b/install/static/hbacsvc.js index 012c92a3..13135da2 100755 --- a/install/static/hbacsvc.js +++ b/install/static/hbacsvc.js @@ -26,8 +26,6 @@ function ipa_hbacsvc() { 'name': 'hbacsvc' }); - that.superior_init = that.superior('init'); - that.init = function() { var dialog = ipa_hbacsvc_add_dialog({ @@ -49,7 +47,7 @@ function ipa_hbacsvc() { }); that.add_facet(facet); - that.superior_init(); + that.entity_init(); }; return that; @@ -82,22 +80,21 @@ function ipa_hbacsvc_search_facet(spec) { var that = ipa_search_facet(spec); - that.superior_init = that.superior('init'); - that.superior_create = that.superior('create'); - that.superior_setup = that.superior('setup'); + that.get_action_panel = function() { + return $('#hbac .action-panel'); + }; that.init = function() { that.create_column({name:'cn', label:'Service', primary_key: true}); that.create_column({name:'description', label:'Description'}); - that.superior_init(); + that.search_facet_init(); }; that.create = function(container) { - 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); @@ -123,7 +120,7 @@ function ipa_hbacsvc_search_facet(spec) { } }).appendTo(ul); - that.superior_create(container); + that.search_facet_create(container); // TODO: replace with IPA.metadata[that.entity_name].label container.children().last().prepend( @@ -149,6 +146,10 @@ function ipa_hbacsvc_details_facet(spec) { that.superior_create = that.superior('create'); that.superior_setup = that.superior('setup'); + that.get_action_panel = function() { + return $('#hbac .action-panel'); + }; + that.init = function() { var section = ipa_details_list_section({ -- cgit