WebUI: Fix automount maps pagination

Apply pagination filter for cases when all table data is already loaded.

Ticket: https://pagure.io/freeipa/issue/6627

Signed-off-by: Serhii Tsymbaliuk <stsymbal@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Serhii Tsymbaliuk 2019-06-24 12:57:05 +02:00
parent 93dc2d569d
commit dd7198acec
No known key found for this signature in database
GPG Key ID: 632C7F5C1BC85519

View File

@ -2175,14 +2175,12 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
pkeys_map = pkeys_map.slice(start-1, end);
var columns = that.table.columns.values;
if (columns.length == 1) { // show primary keys only
that.load_records(records_map.values);
return;
}
if (that.search_all_entries) {
// map contains the primary keys and the complete records
that.load_records(records_map.values);
if (columns.length == 1 || that.search_all_entries) {
// All needed pkeys/objects are already fetched from server,
// so we just filter and show them.
that.load_records(pkeys_map.keys.map(function(x) {
return records_map.get(x);
}));
return;
}