By adding no_members option to commands which supports it.

It then skips memberof procession on the server side.

https://fedorahosted.org/freeipa/ticket/5271
--
Petr Vobornik
From 39beb39966dff537b82aca1204cc124f52677ba7 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Mon, 31 Aug 2015 17:18:49 +0200
Subject: [PATCH] webui: improve performance of search in association dialog

By adding no_members option to commands which supports it.

It then skips memberof procession on the server side.

https://fedorahosted.org/freeipa/ticket/5271
---
 install/ui/src/freeipa/association.js | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js
index 0448fad843c125a44e5a016665e30f4eeaa4e1e6..1867e30ceae9af4936c17cd4fff1b21805b4f687 100644
--- a/install/ui/src/freeipa/association.js
+++ b/install/ui/src/freeipa/association.js
@@ -28,6 +28,7 @@ define([
     './metadata',
     './ipa',
     './jquery',
+    './metadata',
     './navigation',
     './phases',
     './reg',
@@ -37,8 +38,8 @@ define([
     './facet',
     './search',
     './dialog'],
-        function(lang, Deferred, metadata_provider, IPA, $, navigation,
-                 phases, reg, rpc, su, text) {
+        function(lang, Deferred, metadata_provider, IPA, $, metadata,
+                 navigation, phases, reg, rpc, su, text) {
 
 /**
  * Association module
@@ -315,13 +316,19 @@ IPA.association_adder_dialog = function(spec) {
             }
         }
 
-        rpc.command({
+        var cmd = rpc.command({
             entity: that.other_entity.name,
             method: 'find',
             args: [that.get_filter()],
             options: options,
             on_success: on_success
-        }).execute();
+        });
+
+        var no_members = metadata.get('@mc-opt:' + cmd.get_command() + ':no_members');
+        if (no_members) {
+            cmd.set_option('no_members', true);
+        }
+        cmd.execute();
     };
 
     that.normalize_values = function(values) {
-- 
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