Re: [Freeipa-devel] [PATCH] webui: 949 crash nicely if sessionStorage is not available

2016-01-27 Thread Tomas Babej
On 01/26/2016 06:59 PM, Tomas Babej wrote:
> ACK
> 
> On 01/26/2016 06:57 PM, Petr Vobornik wrote:
>> https://fedorahosted.org/freeipa/ticket/5643
>>
>>
> 

Pushed to master: 6e1eb5bc8f83faa38203bd308896d0b15f359b24

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


[Freeipa-devel] [PATCH] webui: 949 crash nicely if sessionStorage is not available

2016-01-26 Thread Petr Vobornik

https://fedorahosted.org/freeipa/ticket/5643
--
Petr Vobornik
From 006be0e198b79fd07dd413afcb05f0cf8f7cb57d Mon Sep 17 00:00:00 2001
From: Petr Vobornik 
Date: Tue, 26 Jan 2016 18:55:06 +0100
Subject: [PATCH] webui: crash nicely if sessionStorage is not available

https://fedorahosted.org/freeipa/ticket/5643
---
 install/ui/src/freeipa/Application_controller.js | 17 +++--
 install/ui/src/freeipa/app_container.js  |  8 
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js
index 69b9cd1c3c5873e10729f808ca3ec27688a1ecf2..5c040e4a05a140a1842f7265c036cd0eae962a35 100644
--- a/install/ui/src/freeipa/Application_controller.js
+++ b/install/ui/src/freeipa/Application_controller.js
@@ -257,15 +257,20 @@ define([
 'class': 'error-details'
 }).appendTo(error_container);
 
-details.append($('', { text: 'Web UI got in unrecoverable state during "' + error.phase + '" phase' }));
+details.append($('', { text: 'Web UI got in unrecoverable state during "' + error.phase + '" phase.' }));
 if (error.name) window.console.error(error.name);
 if (error.results) {
-var msg = error.results.message;
-var stack = error.results.stack.toString();
-window.console.error(stack);
 details.append('Technical details:');
-details.append($('', { text: error.results.message }));
-details.append($('').append($('', { text: stack })));
+var msg = error.results.message;
+if (msg) {
+window.console.error(msg);
+details.append($('', { text: msg }));
+}
+if (error.results.stack) {
+var stack = error.results.stack.toString();
+window.console.error(stack);
+details.append($('').append($('', { text: stack })));
+}
 }
 },
 
diff --git a/install/ui/src/freeipa/app_container.js b/install/ui/src/freeipa/app_container.js
index 0a49307e31f4875724ee430f32c9483a23c6b51e..1194fd14263a1b6f1a5a0a2fa4bc605f344ef417 100644
--- a/install/ui/src/freeipa/app_container.js
+++ b/install/ui/src/freeipa/app_container.js
@@ -63,6 +63,14 @@ define([
 
 phases.on('init', lang.hitch(this, function() {
 var deferred = new Deferred();
+if (!window.sessionStorage) {
+deferred.reject({
+message: "Web UI requires sessionStorage enabled. " +
+ "This might be caused by too strict browser " +
+ "configuration."
+});
+return deferred.promise;
+}
 if (window.sessionStorage.getItem('logout')) {
 window.sessionStorage.removeItem('logout');
 var login_facet = reg.facet.get('login');
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH] webui: 949 crash nicely if sessionStorage is not available

2016-01-26 Thread Tomas Babej
ACK

On 01/26/2016 06:57 PM, Petr Vobornik wrote:
> https://fedorahosted.org/freeipa/ticket/5643
> 
> 

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code