Ver código fonte

[hplsql] changing the name from Hplsql to HPL/SQL in editor and icon (#2686)

Ayush Goyal 3 anos atrás
pai
commit
1a6aee2f9f

+ 1 - 0
desktop/core/src/desktop/templates/hue_icons.mako

@@ -565,6 +565,7 @@
     <!-- ko case: 'hbase' --><svg class="hi hi-fw"><use xlink:href="#hi-hbase"></use></svg><!-- /ko -->
     <!-- ko case: 'hdfs' --><i class="fa fa-fw fa-folder-o"></i><!-- /ko -->
     <!-- ko case: 'hive' --><svg class="hi hi-fw"><use xlink:href="#hi-hive"></use></svg><!-- /ko -->
+    <!-- ko case: 'hplsql' --><svg class="hi hi-fw"><use xlink:href="#hi-hive"></use></svg><!-- /ko -->
     <!-- ko case: 'impala' --><svg class="hi hi-fw"><use xlink:href="#hi-impala"></use></svg><!-- /ko -->
     <!-- ko case: 'indexes' --><i class="fa fa-fw fa-search-plus"></i><!-- /ko -->
     <!-- ko case: 'jar' --><svg class="hi hi-fw"><use xlink:href="#hi-spark"></use></svg><!-- /ko -->

+ 10 - 1
desktop/libs/notebook/src/notebook/conf.py

@@ -77,6 +77,15 @@ def _connector_to_interpreter(connector):
   }
 
 
+def displayName(dialect, name):
+  if ENABLE_UNIFIED_ANALYTICS.get() and dialect == 'hive':
+    return 'Unified Analytics'
+  elif name.lower() == 'hplsql':
+    return 'HPL/SQL'
+  else:
+    return name
+
+
 def get_ordered_interpreters(user=None):
   global INTERPRETERS_CACHE
 
@@ -128,7 +137,7 @@ def get_ordered_interpreters(user=None):
 
   return [{
       "name": i.get('nice_name', i['name']),
-      'displayName': 'Unified Analytics' if ENABLE_UNIFIED_ANALYTICS.get() and i.get('dialect', i['name']).lower() == 'hive' else i.get('nice_name', i['name']),
+      'displayName': displayName(i.get('dialect', i['name']).lower(), i.get('nice_name', i['name'])),
       "type": i['type'],
       "interface": i['interface'],
       "options": i['options'],