summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2011-12-09 18:12:25 -0600
committerMartin Kosek <mkosek@redhat.com>2012-01-16 20:11:37 +0100
commit5febffbeccde7ba4c2b49139b6aa657c77445351 (patch)
treed721cc20537e869b46f9c68b31f0c997f761ec3b
parent6642bc288174fd2f4f1215d5db49f92242714164 (diff)
downloadfreeipa-5febffbeccde7ba4c2b49139b6aa657c77445351.tar.gz
freeipa-5febffbeccde7ba4c2b49139b6aa657c77445351.tar.xz
freeipa-5febffbeccde7ba4c2b49139b6aa657c77445351.zip
Enabled paging on self-service permissions and delegations.
Paging has been enabled on self-service permissions and delegations list pages. The search facet's get_pkeys() has been fixed to handle non-array value. New test data files have been added as well. Ticket #2092
-rw-r--r--install/ui/aci.js2
-rw-r--r--install/ui/search.js7
-rw-r--r--install/ui/test/data/delegation_find_pkeys.json14
-rw-r--r--install/ui/test/data/delegation_get_records.json30
-rw-r--r--install/ui/test/data/selfservice_find_pkeys.json17
-rw-r--r--install/ui/test/data/selfservice_get_records.json69
6 files changed, 135 insertions, 4 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js
index badc7953b..fc72b5192 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -327,7 +327,6 @@ IPA.aci.selfservice_entity = function(spec) {
that.entity_init();
that.builder.search_facet({
- pagination: false,
columns: [ 'aciname' ]
}).
details_facet({
@@ -371,7 +370,6 @@ IPA.aci.delegation_entity = function(spec) {
that.entity_init();
that.builder.search_facet({
- pagination: false,
columns: [ 'aciname' ]
}).
details_facet({
diff --git a/install/ui/search.js b/install/ui/search.js
index e541833c4..f82bf0d1e 100644
--- a/install/ui/search.js
+++ b/install/ui/search.js
@@ -162,8 +162,11 @@ IPA.search_facet = function(spec) {
var pkeys = [];
for (var i=0; i<result.length; i++) {
var record = result[i];
- var values = record[pkey_name];
- pkeys.push(values[0]);
+ var value = record[pkey_name];
+ if (value instanceof Array) {
+ value = value[0];
+ }
+ pkeys.push(value);
}
return pkeys;
};
diff --git a/install/ui/test/data/delegation_find_pkeys.json b/install/ui/test/data/delegation_find_pkeys.json
new file mode 100644
index 000000000..502737565
--- /dev/null
+++ b/install/ui/test/data/delegation_find_pkeys.json
@@ -0,0 +1,14 @@
+{
+ "error": null,
+ "id": null,
+ "result": {
+ "count": 1,
+ "result": [
+ {
+ "aciname": "Test Delegation"
+ }
+ ],
+ "summary": "1 delegation matched",
+ "truncated": false
+ }
+}
diff --git a/install/ui/test/data/delegation_get_records.json b/install/ui/test/data/delegation_get_records.json
new file mode 100644
index 000000000..3012b04a6
--- /dev/null
+++ b/install/ui/test/data/delegation_get_records.json
@@ -0,0 +1,30 @@
+{
+ "error": null,
+ "id": null,
+ "result": {
+ "count": 1,
+ "results": [
+ {
+ "error": null,
+ "result": {
+ "aciname": "Test Delegation",
+ "attrs": [
+ "cn",
+ "displayname",
+ "givenname",
+ "initials",
+ "sn",
+ "title"
+ ],
+ "group": "editors",
+ "memberof": "ipausers",
+ "permissions": [
+ "write"
+ ]
+ },
+ "summary": null,
+ "value": "Test Delegation"
+ }
+ ]
+ }
+}
diff --git a/install/ui/test/data/selfservice_find_pkeys.json b/install/ui/test/data/selfservice_find_pkeys.json
new file mode 100644
index 000000000..0aee1fe47
--- /dev/null
+++ b/install/ui/test/data/selfservice_find_pkeys.json
@@ -0,0 +1,17 @@
+{
+ "error": null,
+ "id": null,
+ "result": {
+ "count": 2,
+ "result": [
+ {
+ "aciname": "Self can write own password"
+ },
+ {
+ "aciname": "User Self service"
+ }
+ ],
+ "summary": "2 selfservices matched",
+ "truncated": false
+ }
+}
diff --git a/install/ui/test/data/selfservice_get_records.json b/install/ui/test/data/selfservice_get_records.json
new file mode 100644
index 000000000..ee0caafd5
--- /dev/null
+++ b/install/ui/test/data/selfservice_get_records.json
@@ -0,0 +1,69 @@
+{
+ "error": null,
+ "id": null,
+ "result": {
+ "count": 2,
+ "results": [
+ {
+ "error": null,
+ "result": {
+ "aciname": "Self can write own password",
+ "attrs": [
+ "userpassword",
+ "krbprincipalkey",
+ "sambalmpassword",
+ "sambantpassword"
+ ],
+ "permissions": [
+ "write"
+ ],
+ "selfaci": true
+ },
+ "summary": null,
+ "value": "Self can write own password"
+ },
+ {
+ "error": null,
+ "result": {
+ "aciname": "User Self service",
+ "attrs": [
+ "givenname",
+ "sn",
+ "cn",
+ "displayname",
+ "title",
+ "initials",
+ "loginshell",
+ "gecos",
+ "homephone",
+ "mobile",
+ "pager",
+ "facsimiletelephonenumber",
+ "telephonenumber",
+ "street",
+ "roomnumber",
+ "l",
+ "st",
+ "postalcode",
+ "manager",
+ "secretary",
+ "description",
+ "carlicense",
+ "labeleduri",
+ "inetuserhttpurl",
+ "seealso",
+ "employeetype",
+ "businesscategory",
+ "ou"
+ ],
+ "permissions": [
+ "write"
+ ],
+ "selfaci": true
+ },
+ "summary": null,
+ "value": "User Self service"
+ }
+ ]
+ }
+}