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/hbactest.js | 87 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 28 deletions(-) (limited to 'install/ui/hbactest.js') diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js index d9a854f1..916a2380 100644 --- a/install/ui/hbactest.js +++ b/install/ui/hbactest.js @@ -117,7 +117,6 @@ IPA.hbac.test_entity = function(spec) { label: IPA.messages.objects.hbactest.run_test, managed_entity_name: 'hbacrule', disable_breadcrumb: true, - pagination: true, facet_group: 'default', columns: [ 'cn', @@ -198,13 +197,6 @@ IPA.hbac.test_facet = function(spec) { }).appendTo(buttons); }; - that.find = function() { - var filter = that.filter.val(); - var state = {}; - state[that.entity.name+'-'+that.name+'-filter'] = filter; - IPA.nav.push_state(state); - }; - that.prev = function() { var facet_group = that.entity.get_facet_group('default'); var index = facet_group.get_facet_index(that.name); @@ -262,7 +254,6 @@ IPA.hbac.test_facet = function(spec) { } command.on_success = function(data, text_status, xhr) { - if (that.filter) that.filter.focus(); that.load(data); }; @@ -368,7 +359,7 @@ IPA.hbac.test_select_facet = function(spec) { td.append(' '); that.external_text = $('', { - name: 'external', + name: id, focus: function() { that.external_radio.click(); } @@ -381,6 +372,13 @@ IPA.hbac.test_select_facet = function(spec) { that.create_buttons(footer); }; + that.find = function() { + var filter = that.filter.val(); + var state = {}; + state[that.entity.name+'-'+that.name+'-filter'] = filter; + IPA.nav.push_state(state); + }; + that.get_selected_values = function() { var values = that.table.get_selected_values(); if (values && values.length) return values; @@ -393,8 +391,9 @@ IPA.hbac.test_select_facet = function(spec) { }; that.reset = function() { - that.table.set_values([]); + delete that.selected_values; if (that.external_radio) that.external_radio.attr('checked', false); + if (that.external_text) that.external_text.val(''); }; that.save = function(record) { @@ -475,9 +474,9 @@ IPA.hbac.test_rules_facet = function(spec) { }; that.reset = function() { - that.table.set_values([]); + delete that.selected_values; if (that.enabled) that.enabled.attr('checked', false); - if (that.disabled) that.enabled.attr('checked', false); + if (that.disabled) that.disabled.attr('checked', false); }; that.save = function(record) { @@ -505,6 +504,8 @@ IPA.hbac.test_run_facet = function(spec) { var init = function() { that.table.selectable = false; + that.show_matched = true; + that.show_unmatched = true; }; that.create_content = function(container) { @@ -547,10 +548,15 @@ IPA.hbac.test_run_facet = function(spec) { header.append(' '); - that.matched = $('', { + that.matched_checkbox = $('', { id: 'hbactest-rules-matched', type: 'checkbox', - name: 'matched' + name: 'matched', + checked: true, + change: function() { + that.show_matched = that.matched_checkbox.is(':checked'); + that.refresh(); + } }).appendTo(header); $('