summaryrefslogtreecommitdiffstats
path: root/install/ui/hbactest.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/hbactest.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/hbactest.js')
-rw-r--r--install/ui/hbactest.js38
1 files changed, 6 insertions, 32 deletions
diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js
index 26e8085d..f054c913 100644
--- a/install/ui/hbactest.js
+++ b/install/ui/hbactest.js
@@ -230,18 +230,6 @@ IPA.hbac.test_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 values = record[pkey_name];
- pkeys.push(values[0]);
- }
- return pkeys;
- };
-
that.get_search_command_name = function() {
return that.managed_entity.name + '_find' + (that.pagination ? '_pkeys' : '');
};
@@ -730,16 +718,15 @@ IPA.hbac.test_run_facet = function(spec) {
command.execute();
};
- that.get_pkeys = function(data) {
- var pkeys = [];
- that.matched = {};
+ that.get_records_map = function(data) {
+
+ var records_map = $.ordered_map();
var matched = data.result.matched;
if (that.show_matched && matched) {
for (var i=0; i<matched.length; i++) {
var pkey = matched[i];
- pkeys.push(pkey);
- that.matched[pkey] = 'TRUE';
+ records_map.put(pkey, { matched: true });
}
}
@@ -747,12 +734,11 @@ IPA.hbac.test_run_facet = function(spec) {
if (that.show_unmatched && notmatched) {
for (i=0; i<notmatched.length; i++) {
pkey = notmatched[i];
- pkeys.push(pkey);
- that.matched[pkey] = 'FALSE';
+ records_map.put(pkey, { matched: false });
}
}
- return pkeys;
+ return records_map;
};
that.get_records_command_name = function() {
@@ -765,18 +751,6 @@ IPA.hbac.test_run_facet = function(spec) {
return that.managed_entity.name+'_get_records';
};
- that.load_records = function(records) {
- var pkey_name = that.table.entity.metadata.primary_key;
- that.table.empty();
- for (var i=0; i<records.length; i++) {
- var record = records[i];
- var pkey = record[pkey_name][0];
- record.matched = that.matched[pkey];
- that.table.add_record(record);
- }
- that.table.set_values(that.selected_values);
- };
-
init();
return that;