Redirection in 'Add and edit' in automember hostgroup now navigates to correct facet.

https://fedorahosted.org/freeipa/ticket/2422
--
Petr Vobornik
From 5b898f7a63f92c2caf36f4c2a280ceb6d0ccb092 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Voborn=C3=ADk?= <pvobo...@redhat.com>
Date: Thu, 23 Feb 2012 14:39:56 +0100
Subject: [PATCH] Fixed redirection in Add and edit in automember hostgroup.

Redirection in 'Add and edit' in automember hostgroup now navigates to correct facet.

https://fedorahosted.org/freeipa/ticket/2422
---
 install/ui/automember.js |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/install/ui/automember.js b/install/ui/automember.js
index 4a07b4f012e1ab2917e94dcd2ab9fc2c584c3fea..a9812a71f6a7b60fbd7b9bfe50617b1df38cbfd2 100644
--- a/install/ui/automember.js
+++ b/install/ui/automember.js
@@ -309,6 +309,19 @@ IPA.automember.rule_adder_dialog = function(spec) {
 
     var that = IPA.entity_adder_dialog(spec);
 
+    that.show_edit_page = function (entity,result) {
+        var pkey_name = entity.metadata.primary_key;
+        var pkey = result[pkey_name];
+        if (pkey instanceof Array) {
+            pkey = pkey[0];
+        }
+        var facet = IPA.current_entity.get_facet();
+        var facetname = facet.group_type === 'group' ? 'usergrouprule' :
+                            'hostgrouprule';
+
+        IPA.nav.show_entity_page(that.entity, facetname, pkey);
+    };
+
     that.reset = function() {
 
         var field = that.fields.get_field('cn');
@@ -329,6 +342,7 @@ IPA.automember.rule_adder_dialog = function(spec) {
         return command;
     };
 
+
     return that;
 };
 
-- 
1.7.7.6

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

Reply via email to