diff --git a/install/ui/facet.js b/install/ui/facet.js
index df5743b1c..e16ee6704 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');
};
diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js
index d9a854f11..916a23803 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);
$('', {
@@ -558,10 +564,15 @@ IPA.hbac.test_run_facet = function(spec) {
text: IPA.messages.objects.hbactest.matched
}).appendTo(header);
- that.unmatched = $('', {
+ that.unmatched_checkbox = $('', {
id: 'hbactest-rules-unmatched',
type: 'checkbox',
- name: 'disabled'
+ name: 'disabled',
+ checked: true,
+ change: function() {
+ that.show_unmatched = that.unmatched_checkbox.is(':checked');
+ that.refresh();
+ }
}).appendTo(header);
$('', {
@@ -634,12 +645,26 @@ IPA.hbac.test_run_facet = function(spec) {
};
that.reset = function() {
- that.test_result.text('');
- that.table.empty();
- that.table.set_values([]);
+ delete that.data;
+ that.show_matched = true;
+ that.show_unmatched = true;
+ if (that.matched_checkbox) that.matched_checkbox.attr('checked', true);
+ if (that.unmatched_checkbox) that.unmatched_checkbox.attr('checked', true);
+ that.refresh();
};
that.refresh = function() {
+ if (that.data) {
+ var message = that.data.result.value ?
+ IPA.messages.objects.hbactest.access_granted :
+ IPA.messages.objects.hbactest.access_denied;
+ that.test_result.text(message);
+
+ } else {
+ that.test_result.text('');
+ }
+
+ that.load(that.data);
};
that.run = function() {
@@ -666,12 +691,8 @@ IPA.hbac.test_run_facet = function(spec) {
command.set_options(options);
command.on_success = function(data, text_status, xhr) {
- var message = data.result.value ?
- IPA.messages.objects.hbactest.access_granted :
- IPA.messages.objects.hbactest.access_denied;
- that.test_result.text(message);
-
- that.load(data);
+ that.data = data;
+ that.refresh();
};
command.execute();
@@ -682,7 +703,7 @@ IPA.hbac.test_run_facet = function(spec) {
that.matched = {};
var matched = data.result.matched;
- if (matched) {
+ if (that.show_matched && matched) {
for (var i=0; i