Re: [Freeipa-devel] [PATCH] freeipa-admiyo-freeipa-0073-Clear-fields-after-add.patch

2010-11-08 Thread Endi Sukma Dewata

On 11/8/2010 9:13 AM, Adam Young wrote:

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.


ACKed and pushed to master.

--
Endi S. Dewata

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


Re: [Freeipa-devel] [PATCH] freeipa-admiyo-freeipa-0073-Clear-fields-after-add.patch

2010-11-08 Thread Adam Young

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 
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

Re: [Freeipa-devel] [PATCH] freeipa-admiyo-freeipa-0073-Clear-fields-after-add.patch

2010-11-05 Thread Endi Sukma Dewata

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.


--
Endi S. Dewata

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


Re: [Freeipa-devel] [PATCH] freeipa-admiyo-freeipa-0073-Clear-fields-after-add.patch

2010-11-03 Thread Endi Sukma Dewata

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.


--
Endi S. Dewata

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


Re: [Freeipa-devel] [PATCH] freeipa-admiyo-freeipa-0073-Clear-fields-after-add.patch

2010-11-03 Thread Adam Young

On 11/03/2010 08:33 AM, Endi Sukma Dewata wrote:

On 11/1/2010 12:58 PM, Adam Young wrote:

For the 'add and add again' useage.


NACK. The following for-loop shouldn't be moved into add_win() because 
it breaks the service add dialog.


-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)
-pkey = [value];
-else
+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)
+pkey = [value];
+} else {
 options[field.name] = value;
+}
 }
 }

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?


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


Re: [Freeipa-devel] [PATCH] freeipa-admiyo-freeipa-0073-Clear-fields-after-add.patch

2010-11-03 Thread Endi Sukma Dewata

On 11/1/2010 12:58 PM, Adam Young wrote:

For the 'add and add again' useage.


NACK. The following for-loop shouldn't be moved into add_win() because 
it breaks the service add dialog.


-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)
-pkey = [value];
-else
+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)
+pkey = [value];
+} else {
 options[field.name] = value;
+}
 }
 }

--
Endi S. Dewata

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


[Freeipa-devel] [PATCH] freeipa-admiyo-freeipa-0073-Clear-fields-after-add.patch

2010-11-01 Thread Adam Young

For the 'add and add again' useage.
From cd57386340acaaf5d168d48942ee19020bb6f3ee Mon Sep 17 00:00:00 2001
From: Adam Young 
Date: Mon, 1 Nov 2010 13:42:28 -0400
Subject: [PATCH] Clear fields after add

---
 install/static/add.js |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/install/static/add.js b/install/static/add.js
index b5f9c16d4abcb74847f27030b6a317b8b1ce45c6..7a9389347ff3cef10f4215926c3459b25e8a638b 100644
--- a/install/static/add.js
+++ b/install/static/add.js
@@ -109,22 +109,22 @@ 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)
-pkey = [value];
-else
+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)
+pkey = [value];
+} 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