https://fedorahosted.org/freeipa/ticket/1227
From e0b5c62a22a10629f06484bb2339e927f2e57e6e Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Tue, 31 May 2011 17:48:20 -0400
Subject: [PATCH] redirect on show error.

---
 install/ui/details.js |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/install/ui/details.js b/install/ui/details.js
index fbf2ff52d45e4ffce1069f6029e7836aedfcf5c0..d9c948e978e86b78b890f34c65cac793c58ef264 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -641,9 +641,20 @@ IPA.details_facet = function(spec) {
         };
 
         command.on_error = function(xhr, text_status, error_thrown) {
-            var details = $('.details', that.container).empty();
-            details.append('<p>Error: '+error_thrown.name+'</p>');
-            details.append('<p>'+error_thrown.message+'</p>');
+            if (that.entity.redirect_facet) {
+                var current_entity = that.entity;
+                while (current_entity.containing_entity){
+                    current_entity = current_entity.containing_entity;
+                }
+                IPA.nav.show_page(
+                    current_entity.name,
+                    that.entity.redirect_facet);
+                return;
+            }else{
+                var details = $('.details', that.container).empty();
+                details.append('<p>Error: '+error_thrown.name+'</p>');
+                details.append('<p>'+error_thrown.message+'</p>');
+            }
         };
 
         command.execute();
-- 
1.7.5.1

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

Reply via email to