diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-11-19 11:38:35 -0600 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-11-22 15:28:42 -0500 |
commit | 27d8529a840bb1f54e520ccd70bf7c2113d03069 (patch) | |
tree | 7f798d63d259f2b85039212917123999ad8555c3 /install/static/hbacsvcgroup.js | |
parent | 861a0fdba9c07d612d6a220b6ec5cf5eb3c24e46 (diff) | |
download | freeipa.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/hbacsvcgroup.js')
-rwxr-xr-x | install/static/hbacsvcgroup.js | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/install/static/hbacsvcgroup.js b/install/static/hbacsvcgroup.js index 30cb2c86..520f8600 100755 --- a/install/static/hbacsvcgroup.js +++ b/install/static/hbacsvcgroup.js @@ -26,8 +26,6 @@ function ipa_hbacsvcgroup() { 'name': 'hbacsvcgroup' }); - that.superior_init = that.superior('init'); - that.init = function() { that.create_association({ @@ -55,12 +53,12 @@ function ipa_hbacsvcgroup() { }); that.add_facet(facet); - facet = ipa_association_facet({ + facet = ipa_hbacsvcgroup_association_facet({ 'name': 'associate' }); that.add_facet(facet); - that.superior_init(); + that.entity_init(); }; return that; @@ -93,22 +91,21 @@ function ipa_hbacsvcgroup_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:'Group', 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); @@ -134,7 +131,8 @@ function ipa_hbacsvcgroup_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( $('<h2/>', { 'html': 'HBAC Service Groups' })); @@ -152,9 +150,9 @@ function ipa_hbacsvcgroup_details_facet(spec) { var that = ipa_details_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() { @@ -167,7 +165,20 @@ function ipa_hbacsvcgroup_details_facet(spec) { section.create_field({ 'name': 'cn', 'label': 'Name' }); section.create_field({ 'name': 'description', 'label': 'Description' }); - that.superior_init(); + that.details_facet_init(); + }; + + return that; +} + +function ipa_hbacsvcgroup_association_facet(spec) { + + spec = spec || {}; + + var that = ipa_association_facet(spec); + + that.get_action_panel = function() { + return $('#hbac .action-panel'); }; return that; |