From bf9f50f0e38a9b9057b03e58b979b5e2e6cd0ce8 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Fri, 7 Feb 2014 22:47:24 -0500
Subject: [PATCH] Fixed pagination in TPS UI.

The pagination in TPS UI no longer worked due to Jackson change. The
Collection class has been fixed to read the correct attribute names
for pagination links. The table size has been changed to 5 rows.

Ticket #654
---
 base/server/share/webapps/pki/js/pki-ui.js             | 4 ++--
 base/tps-tomcat/shared/webapps/tps/js/activity.js      | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/authenticator.js | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/cert.js          | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/connection.js    | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/group.js         | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/profile.js       | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/selftest.js      | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/token.js         | 2 +-
 base/tps-tomcat/shared/webapps/tps/js/user.js          | 2 +-
 10 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js
index d35de5893e0df665518e12dd5e122eb2c10dacd0..c257d28caaf1e95374e556e5d9e06cdbbf7d2f4c 100644
--- a/base/server/share/webapps/pki/js/pki-ui.js
+++ b/base/server/share/webapps/pki/js/pki-ui.js
@@ -93,8 +93,8 @@ var Collection = Backbone.Collection.extend({
         var self = this;
         self.links = {};
         _(links).each(function(link) {
-            var name = link["@rel"];
-            var href = link["@href"];
+            var name = link.rel;
+            var href = link.href;
             self.links[name] = href;
         });
     },
diff --git a/base/tps-tomcat/shared/webapps/tps/js/activity.js b/base/tps-tomcat/shared/webapps/tps/js/activity.js
index 4039a72cee604c7466d49a6caae5b43637af79c2..fdde689867d5ab7cd1c2442a87fe4552b633b7f1 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/activity.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/activity.js
@@ -77,7 +77,7 @@ var ActivityPage = Page.extend({
 
         new Table({
             el: $("table[name='activities']"),
-            collection: new ActivityCollection({ size: 3 }),
+            collection: new ActivityCollection({ size: 5 }),
             editDialog: editDialog
         });
     }
diff --git a/base/tps-tomcat/shared/webapps/tps/js/authenticator.js b/base/tps-tomcat/shared/webapps/tps/js/authenticator.js
index cacf094147b6edc41a0a19e9e3b767783da0d893..bdbe1f839eab577ee2de07ce71d1c6d7a2bb72ba 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/authenticator.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/authenticator.js
@@ -134,7 +134,7 @@ var AuthenticatorPage = Page.extend({
 
         new Table({
             el: $("table[name='authenticators']"),
-            collection: new AuthenticatorCollection({ size: 3 }),
+            collection: new AuthenticatorCollection({ size: 5 }),
             editDialog: editDialog
         });
     }
diff --git a/base/tps-tomcat/shared/webapps/tps/js/cert.js b/base/tps-tomcat/shared/webapps/tps/js/cert.js
index ede68d8657a31a2f4f6eaaa793380e1de03d7713..cd4164dee0119e30fc125e25f5913e3996a29be6 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/cert.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/cert.js
@@ -83,7 +83,7 @@ var CertificatePage = Page.extend({
 
         new Table({
             el: $("table[name='certificates']"),
-            collection: new CertificateCollection({ size: 3 }),
+            collection: new CertificateCollection({ size: 5 }),
             editDialog: editDialog
         });
     }
diff --git a/base/tps-tomcat/shared/webapps/tps/js/connection.js b/base/tps-tomcat/shared/webapps/tps/js/connection.js
index 94c4522ceca37e11bab259d71a7dcee95f21a126..a796cec7fe7698224ac340ca3ad9a6da8619629f 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/connection.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/connection.js
@@ -134,7 +134,7 @@ var ConnectionPage = Page.extend({
 
         new Table({
             el: $("table[name='connections']"),
-            collection: new ConnectionCollection({ size: 3 }),
+            collection: new ConnectionCollection({ size: 5 }),
             editDialog: editDialog
         });
     }
diff --git a/base/tps-tomcat/shared/webapps/tps/js/group.js b/base/tps-tomcat/shared/webapps/tps/js/group.js
index 7373e0339f598458c4c8db89249fe323af3ae490..4f03d69329956e754ea0025e5283836fe01dafd4 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/group.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/group.js
@@ -72,7 +72,7 @@ var GroupPage = Page.extend({
 
         new Table({
             el: $("table[name='groups']"),
-            collection: new GroupCollection({ size: 3 }),
+            collection: new GroupCollection({ size: 5 }),
             addDialog: addDialog,
             editDialog: editDialog
         });
diff --git a/base/tps-tomcat/shared/webapps/tps/js/profile.js b/base/tps-tomcat/shared/webapps/tps/js/profile.js
index f9d0ebc9b77b7dc0ec9d4f3c7f5c30cb05a36cf4..5b8d06e2bc6bcdaf324447f653859e02a924c9fd 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/profile.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/profile.js
@@ -134,7 +134,7 @@ var ProfilePage = Page.extend({
 
         new Table({
             el: $("table[name='profiles']"),
-            collection: new ProfileCollection({ size: 3 }),
+            collection: new ProfileCollection({ size: 5 }),
             editDialog: editDialog
         });
     }
diff --git a/base/tps-tomcat/shared/webapps/tps/js/selftest.js b/base/tps-tomcat/shared/webapps/tps/js/selftest.js
index 95d0301ecf453ebf1ecf0223d218b7bfbe601c33..9104c6c6f0ccea02947c075d89f81e67ad16039a 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/selftest.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/selftest.js
@@ -70,7 +70,7 @@ var SelfTestPage = Page.extend({
 
         new Table({
             el: $("table[name='selftests']"),
-            collection: new SelfTestCollection({ size: 3 }),
+            collection: new SelfTestCollection({ size: 5 }),
             editDialog: editDialog
         });
     }
diff --git a/base/tps-tomcat/shared/webapps/tps/js/token.js b/base/tps-tomcat/shared/webapps/tps/js/token.js
index dcf2cd99c09e1d6503640c27a001a3feeac9a526..b9686f10e10865ac88badb8bec2ba1952bb2109c 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/token.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/token.js
@@ -93,7 +93,7 @@ var TokenPage = Page.extend({
 
         new Table({
             el: $("table[name='tokens']"),
-            collection: new TokenCollection({ size: 3 }),
+            collection: new TokenCollection({ size: 5 }),
             addDialog: addDialog,
             editDialog: editDialog
         });
diff --git a/base/tps-tomcat/shared/webapps/tps/js/user.js b/base/tps-tomcat/shared/webapps/tps/js/user.js
index e0d4660b51c591e2967525e75976b133384e199f..abcac34ddb4a9e0af4582a04b4a47b69f79f4007 100644
--- a/base/tps-tomcat/shared/webapps/tps/js/user.js
+++ b/base/tps-tomcat/shared/webapps/tps/js/user.js
@@ -136,7 +136,7 @@ var UserPage = Page.extend({
 
         new Table({
             el: $("table[name='users']"),
-            collection: new UserCollection({ size: 3 }),
+            collection: new UserCollection({ size: 5 }),
             addDialog: addDialog,
             editDialog: editDialog
         });
-- 
1.8.4.2

