On 11/05/2010 05:25 PM, Endi Sukma Dewata wrote:
On 11/3/2010 12:03 PM, Endi Sukma Dewata wrote:
On 11/3/2010 8:55 AM, Adam Young wrote:
I suspect then that the service add dialog is wrong. This behaviour has
been spec'ed and working for a long time. What does it break?

The field.setup(dialog, IPA_ADD_UPDATE) should be called before the add
operation to allow constructing krbprincipalname from service name and
hostname. It wouldn't make any sense to call this function after the add
operation is successfully completed.

Do you have an update for this patch? The problem I mentioned above is still valid. You can test it by adding a new service on a live server. Thanks.

I now see what I broke:  I had mistmatched the brackets.
From 5d803399af4e2fd01b288741657f2893c020ac2b Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Mon, 1 Nov 2010 13:42:28 -0400
Subject: [PATCH] Clear fields after add

This version corrects an error in the oriogianl patch cause  by matching
the wrong opening brace
---
 install/static/add.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/install/static/add.js b/install/static/add.js
index fbf9031..671d11f 100644
--- a/install/static/add.js
+++ b/install/static/add.js
@@ -131,22 +131,25 @@ function ipa_add_dialog(spec) {
                 state[that.entity_name + '-facet'] = 'details';
                 state[that.entity_name + '-pkey'] = pkey[0];
                 $.bbq.pushState(state);
+            }else{
+                dialog.find('input').each( function () {
+                    $(this).val('');
+                });
             }
         }
-
         for (var i = 0; i < that.fields.length; ++i) {
             var field = that.fields[i];
             if (field.setup) {
                 var value = field.setup(dialog, IPA_ADD_UPDATE);
                 if (value != null) {
-                    if (field.name == pkey_name)
+                    if (field.name == pkey_name){
                         pkey = [value];
-                    else
+                    } else {
                         options[field.name] = value;
+                    }
                 }
             }
         }
-
         dialog.find('input').each(function () {
             var jobj = $(this);
             var attr = jobj.attr('name');
-- 
1.7.1

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

Reply via email to