From b70ebe5c9f718d184ae6a60931fdccf0e22b9c48 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 7 Dec 2011 10:34:15 -0600 Subject: Fixed matched/unmatched checkboxes in HBAC Test The checkboxes in HBAC Test run page have been fixed to show/hide matched or unmatched rules. The New Test button has been fixed to deselect the inputs in all facets. The test data has been updated as well. Ticket #388 --- install/ui/facet.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'install/ui/facet.js') diff --git a/install/ui/facet.js b/install/ui/facet.js index df5743b1..e16ee670 100644 --- a/install/ui/facet.js +++ b/install/ui/facet.js @@ -107,7 +107,7 @@ IPA.facet = function(spec) { that.load = function(data) { that.data = data; - that.header.load(data.result.result); + that.header.load(data); }; that.refresh = function() { @@ -367,6 +367,8 @@ IPA.facet_header = function(spec) { }; that.load = function(data) { + if (!data) return; + var result = data.result.result; if (!that.facet.disable_facet_tabs) { var pkey = that.facet.pkey; @@ -392,7 +394,7 @@ IPA.facet_header = function(spec) { var facet = facets[j]; var link = $('li[name='+facet.name+'] a', span); - var values = data ? data[facet.name] : null; + var values = result ? result[facet.name] : null; if (values) { link.text(facet.label+' ('+values.length+')'); } else { @@ -472,6 +474,13 @@ IPA.table_facet = function(spec) { that.load = function(data) { that.facet_load(data); + if (!data) { + that.table.empty(); + that.table.summary.text(''); + that.table.pagination_control.css('visibility', 'hidden'); + return; + } + that.table.current_page = 1; that.table.total_pages = 1; @@ -483,6 +492,8 @@ IPA.table_facet = function(spec) { that.table.current_page_input.val(that.table.current_page); that.table.total_pages_span.text(that.table.total_pages); + + that.table.pagination_control.css('visibility', 'visible'); }; -- cgit