소스 검색

[connector] Directly link to the connector page from editor menu

Romain Rigaux 5 년 전
부모
커밋
bbd53584f9
2개의 변경된 파일17개의 추가작업 그리고 8개의 파일을 삭제
  1. 15 6
      desktop/core/src/desktop/js/ko/components/ko.sidebar.js
  2. 2 2
      desktop/core/src/desktop/templates/global_js_constants.mako

+ 15 - 6
desktop/core/src/desktop/js/ko/components/ko.sidebar.js

@@ -424,12 +424,21 @@ class Sidebar {
 
               if (appName === 'editor' && window.SHOW_ADD_MORE_EDITORS) {
                 subApps.push(new SidebarItem({ isDivider: true }));
-                subApps.push(
-                  new SidebarItem({
-                    displayName: I18n('Add more...'),
-                    href: 'https://docs.gethue.com/administrator/configuration/connectors/'
-                  })
-                );
+                if (window.HAS_CONNECTORS) {
+                  subApps.push(
+                    new SidebarItem({
+                      displayName: I18n('Add more...'),
+                      url: '/desktop/connectors'
+                    })
+                  );
+                } else {
+                  subApps.push(
+                    new SidebarItem({
+                      displayName: I18n('Add more...'),
+                      href: 'https://docs.gethue.com/administrator/configuration/connectors/'
+                    })
+                  );
+                }
               }
               appsItems.push(
                 new SidebarItem({

+ 2 - 2
desktop/core/src/desktop/templates/global_js_constants.mako

@@ -21,7 +21,7 @@
   from desktop.auth.backend import is_admin, is_hue_admin
   from desktop.conf import APP_SWITCHER_ALTUS_BASE_URL, APP_SWITCHER_MOW_BASE_URL, CUSTOM_DASHBOARD_URL, \
       DISPLAY_APP_SWITCHER, IS_K8S_ONLY, IS_MULTICLUSTER_ONLY, USE_DEFAULT_CONFIGURATION, USE_NEW_SIDE_PANELS, \
-      VCS, ENABLE_GIST, ENABLE_LINK_SHARING, has_channels
+      VCS, ENABLE_GIST, ENABLE_LINK_SHARING, has_channels, has_connectors
   from desktop.models import hue_version, _get_apps, get_cluster_config
 
   from beeswax.conf import DOWNLOAD_BYTES_LIMIT, DOWNLOAD_ROW_LIMIT, LIST_PARTITIONS_LIMIT, CLOSE_SESSIONS
@@ -112,7 +112,7 @@
   window.AUTO_UPLOAD_OPTIMIZER_STATS = '${ OPTIMIZER.AUTO_UPLOAD_STATS.get() }' === 'True';
 
   window.HAS_GIST = '${ ENABLE_GIST.get() }' === 'True';
-  window.HAS_LINK_SHARING = '${ ENABLE_LINK_SHARING.get() }' === 'True';
+  window.HAS_CONNECTORS = '${ has_connectors() }' === 'True';
 
   ## In the past was has_workload_analytics()
   window.HAS_WORKLOAD_ANALYTICS = '${ ENABLE_QUERY_ANALYSIS.get() }' === 'True';