浏览代码

[hplsql] adding 'HPL/SQL with 'Hive' in editor heading

ayush.goyal 4 年之前
父节点
当前提交
3012f07284

+ 7 - 3
desktop/core/src/desktop/js/apps/editor/EditorViewModel.js

@@ -88,9 +88,13 @@ export default class EditorViewModel {
     });
 
     this.editorType = ko.pureComputed(() => this.activeConnector() && this.activeConnector().id);
-    this.editorTitle = ko.pureComputed(
-      () => this.activeConnector() && this.activeConnector().displayName
-    );
+    this.editorTitle = ko.pureComputed(() => {
+      return window.HPLSQL &&
+        this.activeConnector() &&
+        this.activeConnector().displayName === 'Hive'
+        ? 'Hive HPL/SQL'
+        : this.activeConnector() && this.activeConnector().displayName;
+    });
 
     this.editorIcon = ko.pureComputed(() => {
       const dialect = this.activeConnector()?.dialect;

+ 4 - 1
desktop/core/src/desktop/js/apps/notebook/NotebookViewModel.js

@@ -168,7 +168,10 @@ export default class NotebookViewModel {
       const foundInterpreter = options.languages.find(
         interpreter => interpreter.type === self.editorType()
       );
-      return foundInterpreter?.displayName || foundInterpreter?.name || self.editorType();
+      return window.HPLSQL &&
+        (foundInterpreter?.displayName || foundInterpreter?.name || self.editorType()) === 'Hive'
+        ? 'Hive HPL/SQL'
+        : foundInterpreter?.displayName || foundInterpreter?.name || self.editorType();
     });
     self.autocompleteTimeout = options.autocompleteTimeout;
     self.selectedNotebook = ko.observable();