You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by wu...@apache.org on 2022/11/04 03:21:40 UTC

[ambari] branch trunk updated: AMBARI-25249: Ambari UI quicklinks (#3446)

This is an automated email from the ASF dual-hosted git repository.

wuzhiguo pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a59a032724 AMBARI-25249: Ambari UI quicklinks (#3446)
a59a032724 is described below

commit a59a0327249a630c545a7651fc9c3f380e3d65c9
Author: Zhiguo Wu <wu...@apache.org>
AuthorDate: Fri Nov 4 11:21:36 2022 +0800

    AMBARI-25249: Ambari UI quicklinks (#3446)
---
 .../app/views/common/quick_view_link_view.js       | 33 +++++++++++++++-------
 1 file changed, 23 insertions(+), 10 deletions(-)

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 cc54ea7b03..9515641557 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -420,14 +420,17 @@ App.QuickLinksView = Em.View.extend({
 
       var links = Em.get(quickLinksConfig, 'links');
       links.forEach(function (link) {
-        var publicHostName = this.publicHostName(link, hosts, protocol);
-        if (publicHostName) {
-          if (link.protocol) {
-            protocol = this.setProtocol(configProperties, link.protocol);
-          }
-          var newItem = this.getHostLink(link, publicHostName, protocol, configProperties, response); //quicklink generated for the hbs template
-          if (!Em.isNone(newItem)) {
-            quickLinks.push(newItem);
+        var isRelatedComponentInstalled = this.isRelatedComponentInstalled(link);
+        if (isRelatedComponentInstalled) {
+          var publicHostName = this.publicHostName(link, hosts, protocol);
+          if (publicHostName) {
+            if (link.protocol) {
+              protocol = this.setProtocol(configProperties, link.protocol);
+            }
+            var newItem = this.getHostLink(link, publicHostName, protocol, configProperties, response); //quicklink generated for the hbs template
+            if (!Em.isNone(newItem)) {
+              quickLinks.push(newItem);
+            }
           }
         }
       }, this);
@@ -482,7 +485,8 @@ App.QuickLinksView = Em.View.extend({
       links.forEach(function (link) {
         var linkRemoved = Em.get(link, 'removed');
         var url = Em.get(link, 'url');
-        if (url && !linkRemoved) {
+        var isRelatedComponentInstalled = this.isRelatedComponentInstalled(link);
+        if (url && !linkRemoved && isRelatedComponentInstalled) {
           var hostNameRegExp = new RegExp('([\\w\\W]*):\\d+');
           if (serviceName === 'HDFS') {
             var config;
@@ -876,5 +880,14 @@ App.QuickLinksView = Em.View.extend({
         App.tooltip($(`[rel="${this.get('tooltipAttribute')}"]`));
       }
     });
-  }.observes('showQuickLinks', 'isLoaded', 'quickLinksArray.length')
+  }.observes('showQuickLinks', 'isLoaded', 'quickLinksArray.length'),
+
+  /**
+   * Check if host component related to quickLink is installed
+   * @param quickLink
+   * @returns {Boolean}
+   */
+  isRelatedComponentInstalled: function (quickLink) {
+    return App.HostComponent.find().someProperty('componentName', quickLink.component_name);
+  }
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org