Jelajahi Sumber

HUE-8943 [importer] Add importer to the new left menu

Romain 6 tahun lalu
induk
melakukan
c1af5fc748

+ 1 - 0
desktop/core/src/desktop/js/ko/bindings/ko.hueAppIcon.js

@@ -28,6 +28,7 @@ const APP_ICON_INDEX = {
   hdfs: `<i class="fa fa-fw fa-folder-o"></i>`,
   hive: `<svg class="hi hi-fw"><use xlink:href="#hi-hive"></use></svg>`,
   impala: `<svg class="hi hi-fw"><use xlink:href="#hi-impala"></use></svg>`,
+  importer: `<svg class="hi hi-fw"><use xlink:href="#hi-exchange"></use></svg>`,
   indexes: `<i class="fa fa-fw fa-search-plus"></i>`,
   jar: `<svg class="hi hi-fw"><use xlink:href="#hi-spark"></use></svg>`,
   java: `<i class="fa fa-fw fa-file-code-o"></i>`,

+ 9 - 0
desktop/core/src/desktop/models.py

@@ -1845,6 +1845,15 @@ class ClusterConfig():
         'page': '/security/hive'
       })
 
+    if 'indexer' in self.apps and self.user.has_hue_permission(action="access:importer", app="indexer") and not IS_EMBEDDED.get():
+      interpreters.append({
+        'type': 'importer',
+        'displayName': _('Importer'),
+        'buttonName': _('Import'),
+        'tooltip': _('Importer'),
+        'page': '/indexer/importer'
+      })
+
     if 'sqoop' in self.apps and ANALYTIC_DB not in self.cluster_type:
       from sqoop.conf import IS_ENABLED
       if IS_ENABLED.get():

+ 4 - 0
desktop/libs/indexer/src/indexer/settings.py

@@ -22,3 +22,7 @@ MENU_INDEX = 43
 ICON = "search/art/icon_search_48.png"
 
 IS_URL_NAMESPACED = True
+
+PERMISSION_ACTIONS = (
+  ("access:importer", "Access to the data importer"),
+)