AMBARI-20826 - HIVE "Quick Links" section showing Graphana related quicklinks when Graphana is not installed (rzang)
Change-Id: Ie85bb7eff5a78bb4f3d2425f64dcadfeb8428f4d Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0197813e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0197813e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0197813e Branch: refs/heads/branch-feature-AMBARI-12556 Commit: 0197813e05baa711f4dd215f407b2e29442318e6 Parents: 2958fbe Author: Richard Zang <rz...@apache.org> Authored: Mon Apr 24 13:52:50 2017 -0700 Committer: Richard Zang <rz...@apache.org> Committed: Mon Apr 24 13:52:50 2017 -0700 ---------------------------------------------------------------------- .../SPARK2/2.0.0/quicklinks/quicklinks.json | 1 + .../app/views/common/quick_view_link_view.js | 17 +++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0197813e/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/quicklinks/quicklinks.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/quicklinks/quicklinks.json b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/quicklinks/quicklinks.json index ff285fc..9cd07f1 100755 --- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/quicklinks/quicklinks.json +++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/quicklinks/quicklinks.json @@ -11,6 +11,7 @@ { "name": "spark2_history_server_ui", "label": "Spark2 History Server UI", + "component_name": "SPARK2_JOBHISTORYSERVER", "requires_user_name": "false", "url": "%@://%@:%@", "port":{ http://git-wip-us.apache.org/repos/asf/ambari/blob/0197813e/ambari-web/app/views/common/quick_view_link_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js index dfaf953..94cc2d3 100644 --- a/ambari-web/app/views/common/quick_view_link_view.js +++ b/ambari-web/app/views/common/quick_view_link_view.js @@ -404,24 +404,20 @@ App.QuickLinksView = Em.View.extend({ var quickLinks = []; var configProperties = this.get('configProperties'); var protocol = this.setProtocol(configProperties, quickLinksConfig.get('protocol')); - var publicHostName = hosts[0].publicHostName; var links = Em.get(quickLinksConfig, 'links'); links.forEach(function (link) { var componentName = link.component_name; var hostNameForComponent = hosts.findProperty('componentName',componentName); if (hostNameForComponent) { - publicHostName = hostNameForComponent.publicHostName; + var publicHostName = hostNameForComponent.publicHostName; if (link.protocol) { protocol = this.setProtocol(configProperties, link.protocol); } - } - if (componentName && !hostNameForComponent) { - return; - } - var newItem = this.getHostLink(link, publicHostName, protocol, configProperties, response); //quicklink generated for the hbs template - if (!Em.isNone(newItem)) { - quickLinks.push(newItem); + var newItem = this.getHostLink(link, publicHostName, protocol, configProperties, response); //quicklink generated for the hbs template + if (!Em.isNone(newItem)) { + quickLinks.push(newItem); + } } }, this); this.set('quickLinks', quickLinks); @@ -637,9 +633,6 @@ App.QuickLinksView = Em.View.extend({ } default: hosts = hosts.concat(componentHosts); - if(hosts.length < 1 && this.getWithDefault('content.hostComponents', []).someProperty('isMaster')) { - hosts = this.findHosts(this.get('content.hostComponents').findProperty('isMaster').get('componentName'), response); - } break; } }, this);