URL: https://github.com/freeipa/freeipa/pull/3346
Author: serg-cymbaluk
 Title: #3346: [Backport][ipa-4-7] WebUI: Fix automount maps pagination
Action: opened

PR body:
"""
This PR was opened automatically because PR #3308 was pushed to master and 
backport to ipa-4-7 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/3346/head:pr3346
git checkout pr3346
From 2ab3e65fdc00e260407ba75a068df73f66592d90 Mon Sep 17 00:00:00 2001
From: Serhii Tsymbaliuk <stsym...@redhat.com>
Date: Mon, 24 Jun 2019 12:57:05 +0200
Subject: [PATCH] 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 <stsym...@redhat.com>
---
 install/ui/src/freeipa/facet.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js
index 2bf5b96289..9aa0dd8cf4 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;
         }
 
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org

Reply via email to