[PATCH] Fix numerous errors in UI when host is shut down

From: Socorro Stoppler <socorrob@us.ibm.com> Fix numerous errors in UI when host is shut down Socorro Stoppler (1): Fix displaying numerous error msgs when host is shut down ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 1.9.1

From: Socorro Stoppler <socorrob@us.ibm.com> Fix displaying numerous error msgs when host is shut down Signed-off-by: Socorro Stoppler <socorrob@us.ibm.com> --- ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index 0d4ad43..763834a 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -300,6 +300,7 @@ kimchi.main = function() { }; var initUI = function() { + var errorMsg = ""; $(document).bind('ajaxError', function(event, jqXHR, ajaxSettings, errorThrown) { if (!ajaxSettings['kimchi']) { return; @@ -314,8 +315,9 @@ kimchi.main = function() { document.location.href= isSessionTimeout ? 'login.html?error=sessionTimeout' : 'login.html'; return; } - else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut) { - kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", jqXHR.state())); + else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut && errorMsg == "") { + errorMsg = i18n['KCHAPI6007E'].replace("%1", jqXHR.state()); + kimchi.message.error(errorMsg); } if(ajaxSettings['originalError']) { ajaxSettings['originalError'](jqXHR, jqXHR.statusText, errorThrown); @@ -325,6 +327,7 @@ kimchi.main = function() { kimchi.user.showUser(true); initListeners(); updatePage(); + }; // Load i18n translation strings first and then render the page. -- 1.9.1

Reviewed-by: Daniel Barboza <dhbarboza82@gmail.com> ps: I'll remove the extra blank line when pushing it On 07/13/2015 04:18 PM, Socorro Stoppler wrote:
From: Socorro Stoppler <socorrob@us.ibm.com>
Fix displaying numerous error msgs when host is shut down
Signed-off-by: Socorro Stoppler <socorrob@us.ibm.com> --- ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index 0d4ad43..763834a 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -300,6 +300,7 @@ kimchi.main = function() { };
var initUI = function() { + var errorMsg = ""; $(document).bind('ajaxError', function(event, jqXHR, ajaxSettings, errorThrown) { if (!ajaxSettings['kimchi']) { return; @@ -314,8 +315,9 @@ kimchi.main = function() { document.location.href= isSessionTimeout ? 'login.html?error=sessionTimeout' : 'login.html'; return; } - else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut) { - kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", jqXHR.state())); + else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut && errorMsg == "") { + errorMsg = i18n['KCHAPI6007E'].replace("%1", jqXHR.state()); + kimchi.message.error(errorMsg); } if(ajaxSettings['originalError']) { ajaxSettings['originalError'](jqXHR, jqXHR.statusText, errorThrown); @@ -325,6 +327,7 @@ kimchi.main = function() { kimchi.user.showUser(true); initListeners(); updatePage(); + };
// Load i18n translation strings first and then render the page.

Patch applied to https://github.com/danielhb/kimchi master branch Thanks! On 07/13/2015 04:29 PM, Daniel Henrique Barboza wrote:
Reviewed-by: Daniel Barboza <dhbarboza82@gmail.com>
ps: I'll remove the extra blank line when pushing it
On 07/13/2015 04:18 PM, Socorro Stoppler wrote:
From: Socorro Stoppler <socorrob@us.ibm.com>
Fix displaying numerous error msgs when host is shut down
Signed-off-by: Socorro Stoppler <socorrob@us.ibm.com> --- ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js index 0d4ad43..763834a 100644 --- a/ui/js/src/kimchi.main.js +++ b/ui/js/src/kimchi.main.js @@ -300,6 +300,7 @@ kimchi.main = function() { }; var initUI = function() { + var errorMsg = ""; $(document).bind('ajaxError', function(event, jqXHR, ajaxSettings, errorThrown) { if (!ajaxSettings['kimchi']) { return; @@ -314,8 +315,9 @@ kimchi.main = function() { document.location.href= isSessionTimeout ? 'login.html?error=sessionTimeout' : 'login.html'; return; } - else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut) { - kimchi.message.error(i18n['KCHAPI6007E'].replace("%1", jqXHR.state())); + else if((jqXHR['status'] == 0) && ("error"==jqXHR.statusText) && !kimchi.isLoggingOut && errorMsg == "") { + errorMsg = i18n['KCHAPI6007E'].replace("%1", jqXHR.state()); + kimchi.message.error(errorMsg); } if(ajaxSettings['originalError']) { ajaxSettings['originalError'](jqXHR, jqXHR.statusText, errorThrown); @@ -325,6 +327,7 @@ kimchi.main = function() { kimchi.user.showUser(true); initListeners(); updatePage(); + }; // Load i18n translation strings first and then render the page.

Does this patch fix issue #510? On Mon, Jul 13, 2015 at 4:19 PM Socorro Stoppler <socorro@linux.vnet.ibm.com> wrote:
From: Socorro Stoppler <socorrob@us.ibm.com>
Fix numerous errors in UI when host is shut down
Socorro Stoppler (1): Fix displaying numerous error msgs when host is shut down
ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
-- 1.9.1
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 07/14/2015 09:06 AM, Crístian Viana wrote:
Does this patch fix issue #510?
At first glance, yeah. Socorro, care to check https://github.com/kimchi-project/kimchi/issues/510 to see if this github issue matches the same issue you fixed with this patch?
On Mon, Jul 13, 2015 at 4:19 PM Socorro Stoppler <socorro@linux.vnet.ibm.com <mailto:socorro@linux.vnet.ibm.com>> wrote:
From: Socorro Stoppler <socorrob@us.ibm.com <mailto:socorrob@us.ibm.com>>
Fix numerous errors in UI when host is shut down
Socorro Stoppler (1): Fix displaying numerous error msgs when host is shut down
ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
-- 1.9.1
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org <mailto:Kimchi-devel@ovirt.org> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Per discussion w/Aline before, the error msg should only be shown once when the host is shut down instead of numerous times as stated in the issue. That is what the patch addresses. I see that the issue mentions logging off in this situation as well but that was not discussed w/Aline. Will check w/Daniel regarding this since Aline is not available. Thanks. On 07/14/2015 05:06 AM, Crístian Viana wrote:
Does this patch fix issue #510?
On Mon, Jul 13, 2015 at 4:19 PM Socorro Stoppler <socorro@linux.vnet.ibm.com <mailto:socorro@linux.vnet.ibm.com>> wrote:
From: Socorro Stoppler <socorrob@us.ibm.com <mailto:socorrob@us.ibm.com>>
Fix numerous errors in UI when host is shut down
Socorro Stoppler (1): Fix displaying numerous error msgs when host is shut down
ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
-- 1.9.1
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org <mailto:Kimchi-devel@ovirt.org> http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Cristian, I may have misunderstood your question? As far as my discussion w/Aline from before, I would say this patch fixes issue #510. It's just that it also mentions logging off and that was never discussed as the fix, but since Aline is not available, we can't confirm that. I'll leave it to you to decide if you think this patch is sufficient for Issue #510. Thanks! -Socorro On 07/14/2015 06:46 AM, Socorro Stoppler wrote:
Per discussion w/Aline before, the error msg should only be shown once when the host is shut down instead of numerous times as stated in the issue. That is what the patch addresses. I see that the issue mentions logging off in this situation as well but that was not discussed w/Aline. Will check w/Daniel regarding this since Aline is not available. Thanks.
On 07/14/2015 05:06 AM, Crístian Viana wrote:
Does this patch fix issue #510?
On Mon, Jul 13, 2015 at 4:19 PM Socorro Stoppler <socorro@linux.vnet.ibm.com <mailto:socorro@linux.vnet.ibm.com>> wrote:
From: Socorro Stoppler <socorrob@us.ibm.com <mailto:socorrob@us.ibm.com>>
Fix numerous errors in UI when host is shut down
Socorro Stoppler (1): Fix displaying numerous error msgs when host is shut down
ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
-- 1.9.1
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org <mailto:Kimchi-devel@ovirt.org> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

I haven't tested your patch, but if the error message is displayed only once when restarting/shutting off the host, I consider the issue fixed. Logging off was just one suggestion of what could happen instead of displaying a lot of error messages; displaying it only once is already a good solution. On Tue, Jul 14, 2015 at 12:36 PM Socorro Stoppler < socorro@linux.vnet.ibm.com> wrote:
Cristian,
I may have misunderstood your question? As far as my discussion w/Aline from before, I would say this patch fixes issue #510. It's just that it also mentions logging off and that was never discussed as the fix, but since Aline is not available, we can't confirm that. I'll leave it to you to decide if you think this patch is sufficient for Issue #510.
Thanks!
-Socorro
On 07/14/2015 06:46 AM, Socorro Stoppler wrote:
Per discussion w/Aline before, the error msg should only be shown once when the host is shut down instead of numerous times as stated in the issue. That is what the patch addresses. I see that the issue mentions logging off in this situation as well but that was not discussed w/Aline. Will check w/Daniel regarding this since Aline is not available. Thanks.
On 07/14/2015 05:06 AM, Crístian Viana wrote:
Does this patch fix issue #510?
On Mon, Jul 13, 2015 at 4:19 PM Socorro Stoppler < socorro@linux.vnet.ibm.com> wrote:
From: Socorro Stoppler <socorrob@us.ibm.com>
Fix numerous errors in UI when host is shut down
Socorro Stoppler (1): Fix displaying numerous error msgs when host is shut down
ui/js/src/kimchi.main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
-- 1.9.1
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
_______________________________________________ Kimchi-devel mailing listKimchi-devel@ovirt.orghttp://lists.ovirt.org/mailman/listinfo/kimchi-devel
participants (4)
-
Crístian Viana
-
Daniel Henrique Barboza
-
Daniel Henrique Barboza
-
Socorro Stoppler