On 03/08/2011 02:57 PM, Endi Sukma Dewata wrote:
On 3/8/2011 1:15 PM, Adam Young wrote:
Now manages to pre-populate the pkey for the user.


It pops up 'invalid uid: must be Unicode text'.
The IPA.whoami is an associative array, not a string.


From e045236875ed695381e29a3b264dd9312a791a3e Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Tue, 8 Mar 2011 13:11:19 -0500
Subject: [PATCH] selfservice facets
 don't default to search behavior for facets if in the self service use case

https://fedorahosted.org/freeipa/ticket/1070
---
 install/ui/details.js |    6 ++++++
 install/ui/entity.js  |    6 +++++-
 install/ui/webui.js   |    2 ++
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/install/ui/details.js b/install/ui/details.js
index 895c19aa11d756ee4ea60b598441ac4e8692c476..47e1b38b9547ff2e0d351603313c699e4db06fb0 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -594,6 +594,12 @@ IPA.details_refresh = function() {
     var that = this;
 
     that.pkey = $.bbq.getState(that.entity_name + '-pkey', true) ;
+    if (!that.pkey){
+        if (IPA.is_self_service){
+            that.pkey = IPA.whoami.uid[0];
+        }
+    }
+
 
     var command = IPA.command({
         method: that.entity_name+'_show',
diff --git a/install/ui/entity.js b/install/ui/entity.js
index f8e61af8edd4a7ea2688c0b819f449044bdd10ac..1a49420232e80a2c7d70fc64fc7f6d68d7da6415 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -339,7 +339,11 @@ IPA.entity_set_facet_definition = function (entity_name, list) {
 IPA.current_facet =  function (entity){
     var facet_name = $.bbq.getState(entity.name + '-facet', true);
     if (!facet_name && entity.facets.length) {
-        facet_name = entity.facets[0].name;
+        if (IPA.is_self_service){
+            facet_name = 'details';
+        }else{
+            facet_name = entity.facets[0].name;
+        }
     }
     return facet_name;
 };
diff --git a/install/ui/webui.js b/install/ui/webui.js
index fd33120d89f6daf849207e5541ab0b638f172e8e..17c2efcdcbd309a1832be1b12b6a08fe82d5e5c3 100644
--- a/install/ui/webui.js
+++ b/install/ui/webui.js
@@ -147,9 +147,11 @@ $(function() {
         var navigation = $('#navigation');
 
         if (should_show_all_ui()){
+            IPA.is_self_service = false;
             IPA.tab_set = IPA.admin_tab_set();
             IPA.nav.create(IPA.tab_set, navigation, 'tabs');
         } else {
+            IPA.is_self_service = true;
             IPA.tab_set = IPA.self_serv_tab_set();
             IPA.nav.create(IPA.tab_set, navigation, 'tabs');
 
-- 
1.7.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to