Explorar o código

HUE-9187 [editor] Remove mako dependency on interface in editor v2

Johan Ahlen %!s(int64=5) %!d(string=hai) anos
pai
achega
e07282c8db

+ 0 - 6
desktop/core/src/desktop/js/apps/notebook2/editorViewModel.js

@@ -120,15 +120,9 @@ class EditorViewModel {
 
     // TODO: Drop the SQL source types from the notebook. They're now set in AssistDbPanel.
     this.sqlSourceTypes = [];
-    this.availableLanguages = [];
 
     if (options.languages && this.snippetViewSettings) {
       options.languages.forEach(language => {
-        this.availableLanguages.push({
-          type: language.type,
-          name: language.name,
-          interface: language.interface
-        });
         const viewSettings = this.snippetViewSettings[language.type];
         if (viewSettings && viewSettings.sqlDialect) {
           this.sqlSourceTypes.push({

+ 1 - 10
desktop/core/src/desktop/js/apps/notebook2/snippet.js

@@ -232,16 +232,7 @@ export default class Snippet {
       }
     });
 
-    this.isBatchable = ko.pureComputed(
-      () =>
-        this.dialect() === DIALECT.hive ||
-        this.dialect() === DIALECT.impala ||
-        this.parentVm.availableLanguages.some(
-          language =>
-            language.type === this.dialect() && // TODO: language.type = dialect ?
-            (language.interface === 'oozie' || language.interface === 'sqlalchemy')
-        )
-    );
+    this.isBatchable = ko.pureComputed(() => this.connector() && this.connector().is_batchable);
 
     this.autocompleteSettings = {
       temporaryOnly: false

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

@@ -1792,6 +1792,7 @@ class ClusterConfig(object):
           'tooltip': _('%s Query') % interpreter['type'].title(),
           'page': '/editor/?type=%(type)s' % interpreter,
           'is_sql': interpreter['is_sql'],
+          'is_batchable': interpreter['dialect'] in ['hive', 'impala'] or interpreter['interface'] in ['oozie', 'sqlalchemy'],
           'dialect': interpreter['dialect'],
           'dialect_properties': interpreter.get('dialect_properties'),
         })