On 11/25/2010 8:24 PM, Adam Young wrote:
Updated version that doesn't break SUDO or HBAC. The third level nesting
in the tabs set is only used for this kind of navigation now, but should
be used for Action panel shortly.

Conditional ACK... :)

There are some additional changes that need to be done to get SUDO navigation working properly. Please take a look at the attached patch. If this is OK we can commit both patches together.

--
Endi S. Dewata
From 45394c8afaace87d3e17eed723239f38b4d4a2f5 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Mon, 29 Nov 2010 11:52:08 -0600
Subject: [PATCH] Fixed navigation problem with nested entities.

Replaced _entity with -entity in IPA.tab_state().
Replaced sudo-entity with sudorule-entity.
---
 install/static/navigation.js   |    2 +-
 install/static/sudocmd.js      |    4 ++--
 install/static/sudocmdgroup.js |    4 ++--
 install/static/sudorule.js     |    4 ++--
 install/static/webui.js        |    2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/install/static/navigation.js b/install/static/navigation.js
index 240ee959208247e73bd8707f78041d48734c2785..98c13a923677ec734f11550bc2c42b7027f830a3 100644
--- a/install/static/navigation.js
+++ b/install/static/navigation.js
@@ -138,7 +138,7 @@ function _nav_update_tabs(nls, container,depth)
 
         // TODO: do not hard-code
         if (entity_name == 'hbac' && nav_get_state('hbac-entity')) entity_name = nav_get_state('hbac-entity');
-        if (entity_name == 'sudorule' && nav_get_state('sudo-entity')) entity_name = nav_get_state('sudo-entity');
+        if (entity_name == 'sudorule' && nav_get_state('sudorule-entity')) entity_name = nav_get_state('sudorule-entity');
 
         var entity = IPA.get_entity(entity_name);
         entity.setup(container2);
diff --git a/install/static/sudocmd.js b/install/static/sudocmd.js
index 4255a31e3b415811b32c0bb88b26029d1b7194b8..b4492c254cfddb5621fc3a5ff96737243a97ce4e 100755
--- a/install/static/sudocmd.js
+++ b/install/static/sudocmd.js
@@ -125,7 +125,7 @@ function ipa_sudocmd_search_facet(spec) {
         var li = $('li[title=sudorule]', action_panel);
         li.click(function() {
             var state = {};
-            state['sudo-entity'] = 'sudorule';
+            state['sudorule-entity'] = 'sudorule';
             nav_push_state(state);
             return false;
         });
@@ -133,7 +133,7 @@ function ipa_sudocmd_search_facet(spec) {
         li = $('li[title=sudocmdgroup]', action_panel);
         li.click(function() {
             var state = {};
-            state['sudo-entity'] = 'sudocmdgroup';
+            state['sudorule-entity'] = 'sudocmdgroup';
             nav_push_state(state);
             return false;
         });
diff --git a/install/static/sudocmdgroup.js b/install/static/sudocmdgroup.js
index 6fddafb155e144d1f1f167262832679189239ab5..2e53ce791816859f5aad0afddc2ba8b4baf0225b 100755
--- a/install/static/sudocmdgroup.js
+++ b/install/static/sudocmdgroup.js
@@ -140,7 +140,7 @@ function ipa_sudocmdgroup_search_facet(spec) {
         var li = $('li[title=sudorule]', action_panel);
         li.click(function() {
             var state = {};
-            state['sudo-entity'] = 'sudorule';
+            state['sudorule-entity'] = 'sudorule';
             nav_push_state(state);
             return false;
         });
@@ -148,7 +148,7 @@ function ipa_sudocmdgroup_search_facet(spec) {
         li = $('li[title=sudocmd]', action_panel);
         li.click(function() {
             var state = {};
-            state['sudo-entity'] = 'sudocmd';
+            state['sudorule-entity'] = 'sudocmd';
             nav_push_state(state);
             return false;
         });
diff --git a/install/static/sudorule.js b/install/static/sudorule.js
index f936ebcde8198575e48d06257d44f0ae23ace366..023cafde29a1f0c35c043642e798cf9f27363fd4 100755
--- a/install/static/sudorule.js
+++ b/install/static/sudorule.js
@@ -124,7 +124,7 @@ function ipa_sudorule_search_facet(spec) {
         var li = $('li[title=sudocmd]', action_panel);
         li.click(function() {
             var state = {};
-            state['sudo-entity'] = 'sudocmd';
+            state['sudorule-entity'] = 'sudocmd';
             nav_push_state(state);
             return false;
         });
@@ -132,7 +132,7 @@ function ipa_sudorule_search_facet(spec) {
         li = $('li[title=sudocmdgroup]', action_panel);
         li.click(function() {
             var state = {};
-            state['sudo-entity'] = 'sudocmdgroup';
+            state['sudorule-entity'] = 'sudocmdgroup';
             nav_push_state(state);
             return false;
         });
diff --git a/install/static/webui.js b/install/static/webui.js
index 093d32b22b4adc079054256e364f01aaeeccbbbd..0e3adb27d6d6418211738c77a44db4010b5b184e 100644
--- a/install/static/webui.js
+++ b/install/static/webui.js
@@ -83,7 +83,7 @@ IPA.tab_state = function(entity_name){
                         if (nested_entities[nested_index].name === entity_name){
                             state.navigation =  top_tab_index;
                              state[top_tab.name] =  subtab_index;
-                             state[ top_tab.children[subtab_index].name+'_entity'] =  entity_name;
+                             state[ top_tab.children[subtab_index].name+'-entity'] =  entity_name;
                              return state;
                         }
                     }
-- 
1.6.6.1

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

Reply via email to