[PATCH] webui: dislay server suffixes in server search page

There was a change where suffixes in server are not longer returned as DNs but rather a cn of related topology suffix. I.e. they share "memberof" logic. This caused that search page doesn't get the data because it uses "no_member: true" option by default.

This patch overrides the behavior because it is OK for server search page to fetch also member data - it is not so costly as e.g. in users.

https://fedorahosted.org/freeipa/ticket/5609
--
Petr Vobornik
From ccc2680f6bc2795580cddb24d61c374f19a8d6c9 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Tue, 19 Jan 2016 18:23:51 +0100
Subject: [PATCH] webui: dislay server suffixes in server search page

There was a change where suffixes in server are not longer returned as DNs
but rather a cn of related topology suffix. I.e. they share "memberof" logic.
This caused that search page doesn't get the data because it uses
"no_member: true" option by default.

This patch overrides the behavior because it is OK for server search page
to fetch also member data - it is not so costly as e.g. in users.

https://fedorahosted.org/freeipa/ticket/5609
---
 install/ui/src/freeipa/facet.js    | 12 +++++++++++-
 install/ui/src/freeipa/topology.js |  1 +
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js
index 3743794e73a196459375aaa8bbc373ea7cb269b3..9d71487c970368279dc2812b14d8171cf795c8bc 100644
--- a/install/ui/src/freeipa/facet.js
+++ b/install/ui/src/freeipa/facet.js
@@ -1829,6 +1829,16 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
     that.search_all_entries = spec.search_all_entries;
 
     /**
+     * Member resolution(no_member: true ) in rpc request is skipped by default
+     * to improve performance of getting data.
+     *
+     * Set always_request_members to true to skip this default behavior.
+     * @property {boolean}
+     */
+    that.always_request_members = spec.always_request_members !== undefined ?
+        spec.always_request_members : false;
+
+    /**
      * Sort records
      */
     that.sort_enabled = spec.sort_enabled === undefined ? true : spec.sort_enabled;
@@ -2196,7 +2206,7 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
                 args: [pkey]
             });
 
-            if (that.table.entity.has_members()) {
+            if (!that.always_request_members && that.table.entity.has_members()) {
                 command.set_options({no_members: true});
             }
 
diff --git a/install/ui/src/freeipa/topology.js b/install/ui/src/freeipa/topology.js
index 8e74918bf237dba335ce2f63441423191b2f89e8..6e67484cc7542765056f0887928a64e4dc576836 100644
--- a/install/ui/src/freeipa/topology.js
+++ b/install/ui/src/freeipa/topology.js
@@ -200,6 +200,7 @@ return {
             disable_facet_tabs: false,
             tabs_in_sidebar: true,
             tab_label: '@mo:server.label',
+            always_request_members: true,
             facet_groups: [topology.search_facet_group],
             facet_group: 'search',
             columns: [
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to