diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-02-05 13:29:45 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:17 +0200 |
commit | a3e0e671a1454e690856e0f995896f51f84928f7 (patch) | |
tree | 8ce51e2d3b172bb5f687052fc52344c5fc8b9868 /install/ui | |
parent | 31d7486b88bc0e30c8a84ab4d2f73c35a700dad8 (diff) | |
download | freeipa-a3e0e671a1454e690856e0f995896f51f84928f7.tar.gz freeipa-a3e0e671a1454e690856e0f995896f51f84928f7.tar.xz freeipa-a3e0e671a1454e690856e0f995896f51f84928f7.zip |
Fix nested facet search
https://fedorahosted.org/freeipa/ticket/3236
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/src/freeipa/facet.js | 7 | ||||
-rw-r--r-- | install/ui/src/freeipa/search.js | 20 |
2 files changed, 25 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index f63e6d7ae..9a4fcc0b9 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -221,6 +221,13 @@ IPA.facet = function(spec, no_init) { return new_keys; }; + that.get_pkey_prefix = function() { + var pkeys = that.get_pkeys(); + if (pkeys.length > 0) pkeys.pop(); + + return pkeys; + }; + that.state_diff = function(a, b) { var diff = false; var checked = {}; diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js index 8956470e4..9b7e4faec 100644 --- a/install/ui/src/freeipa/search.js +++ b/install/ui/src/freeipa/search.js @@ -175,15 +175,23 @@ IPA.search_facet = function(spec, no_init) { return name; }; + that.get_refresh_command_args = function() { + var filter = that.state.filter || ''; + // use only prefix, we are looking for records of current entity + var args = that.get_pkey_prefix(); + args.push(filter); + return args; + }; + that.create_refresh_command = function() { - var filter = that.state.filter || ''; + var args = that.get_refresh_command_args(); var command = IPA.command({ name: that.get_search_command_name(), entity: that.managed_entity.name, method: 'find', - args: filter, + args: args, options: { all: that.search_all_attributes } @@ -352,6 +360,14 @@ IPA.nested_search_facet = function(spec) { that.search_facet_refresh(); }; + that.get_refresh_command_args = function() { + var filter = that.state.filter || ''; + // use full pkeys, we are looking for nested entity's records + var args = that.get_pkeys(); + args.push(filter); + return args; + }; + return that; }; |