From d669b5523282df99d97829e68de7f4c4a17d25d2 Mon Sep 17 00:00:00 2001 From: Adam Young <[email protected]> Date: Wed, 20 Jul 2011 11:43:41 -0400 Subject: [PATCH] no dns
Remove all DNS entities if the DNS server is not installed. Removes it from the navigation as well. https://fedorahosted.org/freeipa/ticket/1498 --- install/ui/dns.js | 5 +++++ install/ui/navigation.js | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/install/ui/dns.js b/install/ui/dns.js index 7401926532fb44e4b3c0dd7e9b2feda206b82fe8..58aeaddff84d3d93723a0cf081287ca2b32edcf2 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -117,6 +117,11 @@ IPA.dns_record_search_load = function (result) { }; IPA.entity_factories.dnsrecord = function() { + + if (!IPA.dns_enabled) { + throw "DNS not enabled on server"; + } + return IPA.entity_builder(). entity('dnsrecord'). containing_entity('dnszone'). diff --git a/install/ui/navigation.js b/install/ui/navigation.js index 25c519dcefd11b997765331ded37c66710ad17ed..b63741053e5dc6f803c5f426f4beee4360eeac1f 100644 --- a/install/ui/navigation.js +++ b/install/ui/navigation.js @@ -217,6 +217,7 @@ IPA.navigation = function(spec) { container.addClass('tabs'+depth); var ul = $('<ul/>').appendTo(container); + var created_count = 0; for (var i=0; i<tabs.length; i++) { var tab = tabs[i]; @@ -234,13 +235,14 @@ IPA.navigation = function(spec) { if (!tab.label) { tab.label = entity.label; } + created_count += 1; } var tab_li =$('<li/>').append($('<a/>', { href: '#'+tab_id, title: tab.label, html: tab.label - })).appendTo(ul); + })); if (tab.hidden){ tab_li.css('display','none'); @@ -249,12 +251,22 @@ IPA.navigation = function(spec) { tab.container = $('<div/>', { id: tab_id, name: tab.name - }).appendTo(container); + }); if (tab.children && tab.children.length) { - that._create(tab.children, tab.container, depth+1); + var kids = + that._create(tab.children, tab.container, depth+1); + /*If there are no child tabs, remove the container */ + if (kids === 0){ + tabs.splice(i,1); + i -= 1; + continue; + } } + tab_li.appendTo(ul); + tab.container.appendTo(container); } + return created_count; }; that.update = function() { -- 1.7.5.2
_______________________________________________ Freeipa-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/freeipa-devel
