summaryrefslogtreecommitdiffstats
path: root/install/ui/search.js
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-01-17 15:50:49 -0600
committerPetr Voborník <pvoborni@redhat.com>2012-01-23 15:38:25 +0100
commit7c0c39581c567c2c5bd92f9396b6fd99a2b8a6f8 (patch)
tree6233a8cf7b0df9b21a67c23bb572d6c59fc81ba0 /install/ui/search.js
parentae2e49a22277a17269833ec13fa657fdc2547b36 (diff)
downloadfreeipa.git-7c0c39581c567c2c5bd92f9396b6fd99a2b8a6f8.tar.gz
freeipa.git-7c0c39581c567c2c5bd92f9396b6fd99a2b8a6f8.tar.xz
freeipa.git-7c0c39581c567c2c5bd92f9396b6fd99a2b8a6f8.zip
Enabled paging on automount keys.
The automount keys search facet has been modified to support paging. Since the automountkey-find command doesn't support --pkey-only option, the facet is configured such that during a refresh operation it will retrieve all entries (including the key and info attributes) and then display only the ones that are supposed to be visible in the current page. Ticket #2093
Diffstat (limited to 'install/ui/search.js')
-rw-r--r--install/ui/search.js35
1 files changed, 16 insertions, 19 deletions
diff --git a/install/ui/search.js b/install/ui/search.js
index f82bf0d1..a7074e22 100644
--- a/install/ui/search.js
+++ b/install/ui/search.js
@@ -156,26 +156,15 @@ IPA.search_facet = function(spec) {
IPA.nav.push_state(state);
};
- that.get_pkeys = function(data) {
- var result = data.result.result;
- var pkey_name = that.managed_entity.metadata.primary_key;
- var pkeys = [];
- for (var i=0; i<result.length; i++) {
- var record = result[i];
- var value = record[pkey_name];
- if (value instanceof Array) {
- value = value[0];
- }
- pkeys.push(value);
- }
- return pkeys;
- };
-
that.get_search_command_name = function() {
- return that.managed_entity.name + '_find' + (that.pagination ? '_pkeys' : '');
+ var name = that.managed_entity.name + '_find';
+ if (that.pagination && !that.search_all_entries) {
+ name += '_pkeys';
+ }
+ return name;
};
- that.refresh = function() {
+ that.create_refresh_command = function() {
var filter = [];
var entity = that.managed_entity;
@@ -194,15 +183,22 @@ IPA.search_facet = function(spec) {
method: 'find',
args: filter,
options: {
- all: that.search_all
+ all: that.search_all_attributes
}
});
if (that.pagination) {
- command.set_option('pkey_only', true);
+ if (!that.search_all_entries) command.set_option('pkey_only', true);
command.set_option('sizelimit', 0);
}
+ return command;
+ };
+
+ that.refresh = function() {
+
+ var command = that.create_refresh_command();
+
command.on_success = function(data, text_status, xhr) {
that.filter.focus();
that.load(data);
@@ -230,6 +226,7 @@ IPA.search_facet = function(spec) {
// methods that should be invoked by subclasses
that.search_facet_refresh = that.refresh;
+ that.search_facet_create_refresh_command = that.create_refresh_command;
return that;
};