[Freeipa-devel] [PATCH] 161 Fixed Ajax error handling.

2011-05-20 Thread Endi Sukma Dewata

The IPA.command has been modified not to insert a title into the error
object thrown by Ajax operation because the object could be immutable.

Ticket #1240

--
Endi S. Dewata
From 316c242aef50468002fce0659d2bae584ba12519 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata edew...@redhat.com
Date: Fri, 20 May 2011 11:27:58 -0500
Subject: [PATCH] Fixed Ajax error handling.

The IPA.command has been modified not to insert a title into the error
object thrown by Ajax operation because the object could be immutable.

Ticket #1240
---
 install/ui/associate.js |1 -
 install/ui/details.js   |1 -
 install/ui/dns.js   |1 -
 install/ui/hbac.js  |1 -
 install/ui/ipa.js   |   14 +-
 install/ui/search.js|1 -
 install/ui/webui.js |1 -
 install/ui/widget.js|1 -
 8 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/install/ui/associate.js b/install/ui/associate.js
index 9d04b0c85821a09de67a2a754b1c13bb823438bc..371705ece4f25be46326c5006103d2143af19f57 100644
--- a/install/ui/associate.js
+++ b/install/ui/associate.js
@@ -1020,7 +1020,6 @@ IPA.association_facet = function (spec) {
 function on_error(xhr, text_status, error_thrown) {
 var summary = $('span[name=summary]', that.table.tfoot).empty();
 summary.append('pError: '+error_thrown.name+'/p');
-summary.append('p'+error_thrown.title+'/p');
 summary.append('p'+error_thrown.message+'/p');
 }
 
diff --git a/install/ui/details.js b/install/ui/details.js
index e8033b30609bc557b1f6a19b15b1986b354c4fa8..cd9c0528c68573078d9880b1259fe797b976175c 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -618,7 +618,6 @@ IPA.details_facet = function(spec) {
 command.on_error = function(xhr, text_status, error_thrown) {
 var details = $('.details', that.container).empty();
 details.append('pError: '+error_thrown.name+'/p');
-details.append('p'+error_thrown.title+'/p');
 details.append('p'+error_thrown.message+'/p');
 };
 
diff --git a/install/ui/dns.js b/install/ui/dns.js
index e62459afb227863f41c514a37be86364aeee05b3..58196cb4e52ada14bc59530db31f560181d1506d 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -475,7 +475,6 @@ IPA.records_facet = function(spec) {
 function on_error(xhr, text_status, error_thrown) {
 var summary = $('span[name=summary]', that.table.tfoot).empty();
 summary.append('pError: '+error_thrown.name+'/p');
-summary.append('p'+error_thrown.title+'/p');
 summary.append('p'+error_thrown.message+'/p');
 }
 
diff --git a/install/ui/hbac.js b/install/ui/hbac.js
index 2b5e665455846df260b40587c458bc422282fc7d..e077dea10b970ea28b68c07cd8a4017517f11f19 100644
--- a/install/ui/hbac.js
+++ b/install/ui/hbac.js
@@ -998,7 +998,6 @@ IPA.hbacrule_accesstime_widget = function (spec) {
 function on_error(xhr, text_status, error_thrown) {
 var summary = $('span[name=summary]', that.table.tfoot).empty();
 summary.append('pError: '+error_thrown.name+'/p');
-summary.append('p'+error_thrown.title+'/p');
 summary.append('p'+error_thrown.message+'/p');
 }
 
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index c21c16ec6aa21110ef15610e60bd5caa43d7ceb8..665740a7ef14f11638e9a091b6f57265d90ff9c0 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -306,7 +306,7 @@ IPA.command = function(spec) {
 
 IPA.error_dialog.dialog({
 modal: true,
-title: error_thrown.title,
+title: error_thrown.name,
 width: 400,
 buttons: buttons,
 close: function() {
@@ -341,10 +341,6 @@ IPA.command = function(spec) {
 }
 }
 
-if (!error_thrown.title) {
-error_thrown.title = 'AJAX Error: '+error_thrown.name;
-}
-
 if (that.retry) {
 dialog_open.call(this, xhr, text_status, error_thrown);
 
@@ -358,7 +354,7 @@ IPA.command = function(spec) {
 if (!data) {
 IPA.hide_activity_icon();
 var error_thrown = {
-title: 'HTTP Error '+xhr.status,
+name: 'HTTP Error '+xhr.status,
 url: this.url,
 message: data ? xhr.statusText : No response
 };
@@ -367,7 +363,7 @@ IPA.command = function(spec) {
 } else if (data.error) {
 // error_handler() calls IPA.hide_activity_icon()
 error_handler.call(this, xhr, text_status,  /* error_thrown */ {
-title: 'IPA Error '+data.error.code,
+name: 'IPA Error '+data.error.code,
 message: data.error.message
 });
 
@@ -469,7 +465,7 @@ IPA.batch_command = function (spec) {
 

Re: [Freeipa-devel] [PATCH] 161 Fixed Ajax error handling.

2011-05-20 Thread Adam Young

On 05/20/2011 01:12 PM, Endi Sukma Dewata wrote:

The IPA.command has been modified not to insert a title into the error
object thrown by Ajax operation because the object could be immutable.

Ticket #1240


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

ACK. Pushed to master

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