From dd7198acec797342a6ef0bed6573d8963164a77b Mon Sep 17 00:00:00 2001 From: Serhii Tsymbaliuk Date: Jul 01 2019 07:10:01 +0000 Subject: 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 Reviewed-By: Alexander Bokovoy --- diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index 2bf5b96..9aa0dd8 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -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; }