浏览代码

HUE-4974 [editor] Use the new tag component in the metastore

Johan Ahlen 9 年之前
父节点
当前提交
ed5f502

+ 0 - 2
apps/beeswax/src/beeswax/templates/create_database.mako

@@ -23,7 +23,6 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_("Create database"), 'metastore', user) | n,unicode }
 ${layout.metastore_menubar()}
@@ -31,7 +30,6 @@ ${layout.metastore_menubar()}
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <script src="${ static('desktop/ext/js/d3.v3.js') }" type="text/javascript" charset="utf-8"></script>
 

+ 0 - 2
apps/beeswax/src/beeswax/templates/create_table_manually.mako

@@ -23,7 +23,6 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_("Create table manually"), 'metastore', user) | n,unicode }
 ${ layout.metastore_menubar() }
@@ -31,7 +30,6 @@ ${ layout.metastore_menubar() }
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <script src="${ static('desktop/ext/js/d3.v3.js') }" type="text/javascript" charset="utf-8"></script>
 

+ 0 - 2
apps/beeswax/src/beeswax/templates/execute.mako

@@ -26,7 +26,6 @@
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="dashboard" file="common_dashboard.mako" />
 <%namespace name="layout" file="layout.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_('Query'), app_name, user) | n,unicode }
 ${ layout.menubar(section='query') }
@@ -878,7 +877,6 @@ ${ commonshare() | n,unicode }
 <script src="${ static('desktop/ext/select2/select2.min.js') }" type="text/javascript" charset="utf-8"></script>
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <style type="text/css">
   h1 {

+ 0 - 2
apps/beeswax/src/beeswax/templates/import_wizard_choose_delimiter.mako

@@ -23,7 +23,6 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 <%namespace name="util" file="util.mako" />
 
 ${ commonheader(_('Create table from file'), 'metastore', user) | n,unicode }
@@ -32,7 +31,6 @@ ${ layout.metastore_menubar() }
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <script src="${ static('desktop/ext/js/d3.v3.js') }" type="text/javascript" charset="utf-8"></script>
 

+ 0 - 2
apps/beeswax/src/beeswax/templates/import_wizard_choose_file.mako

@@ -23,7 +23,6 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_('Create table from file'), 'metastore', user) | n,unicode }
 ${ layout.metastore_menubar() }
@@ -31,7 +30,6 @@ ${ layout.metastore_menubar() }
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <script src="${ static('desktop/ext/js/d3.v3.js') }" type="text/javascript" charset="utf-8"></script>
 

+ 0 - 1
apps/beeswax/src/beeswax/templates/import_wizard_define_columns.mako

@@ -23,7 +23,6 @@ from django.utils.translation import ugettext as _
 <%namespace name="comps" file="beeswax_components.mako" />
 <%namespace name="layout" file="layout.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 <%namespace name="util" file="util.mako" />
 
 

+ 0 - 2
apps/metastore/src/metastore/templates/describe_partitions.mako

@@ -22,7 +22,6 @@
 <%namespace name="assist" file="/assist.mako" />
 <%namespace name="components" file="components.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_('Table Partitions: %(tableName)s') % dict(tableName=table.name), app_name, user) | n,unicode }
 ${ components.menubar() }
@@ -30,7 +29,6 @@ ${ components.menubar() }
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <script src="${ static('desktop/ext/js/d3.v3.js') }" type="text/javascript" charset="utf-8"></script>
 

+ 7 - 49
apps/metastore/src/metastore/templates/metastore.mako

@@ -28,7 +28,6 @@ from desktop.views import commonheader, commonfooter, _ko
 <%namespace name="assist" file="/assist.mako" />
 <%namespace name="components" file="components.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_("Metastore"), app_name, user) | n,unicode }
 ${ components.menubar() }
@@ -36,7 +35,6 @@ ${ components.menubar() }
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <script src="${ static('desktop/ext/js/bootstrap-editable.min.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/ext/js/d3.v3.js') }" type="text/javascript" charset="utf-8"></script>
@@ -397,9 +395,9 @@ ${ sqlContextPopover.sqlContextPopover() }
         </div>
         <!-- /ko -->
 
-      <!-- ko if: $root.navigatorEnabled() && $root.database().navigatorStats() && $root.database().navigatorStats().tags -->
-        <!-- ko template: { name: 'metastore-databases-tags', data: $root.database() }--><!-- /ko -->
-      <!-- /ko -->
+        <div style="margin-top: 5px" data-bind="component: { name: 'nav-tags', params: {
+          defaultDatabase: db_name
+        } }"></div>
       </div>
       <!-- /ko -->
 
@@ -530,28 +528,6 @@ ${ sqlContextPopover.sqlContextPopover() }
   </div>
 </script>
 
-
-<script type="text/html" id="metastore-databases-tags">
-  <div>
-      <h4>${ _('Tagging') }</h4>
-      <div title="${ _('Tags') }"><i class="fa fa-fw fa-tags muted"></i>
-        <!-- ko foreach: $data.navigatorStats().tags() -->
-          <span class="badge badge-info" data-bind="text: $data"></span> <i class="fa fa-minus pointer" data-bind="click: $parent.deleteTags"></i>
-        <!-- /ko -->
-
-        <!-- ko if: $data.navigatorStats().tags().length == 0 -->
-          ${ _('No tags') }
-        <!-- /ko -->
-        <div data-bind="visible: $data.showAddTagName">
-          <input type="text" data-bind="value: $data.addTagName, valueUpdate:'afterkeydown'">
-          <i class="fa fa-save pointer" data-bind="click: $data.addTags, visible: $data.addTagName" title="${ _('Save tag') }"></i>
-        </div>
-        <i class="fa fa-plus pointer" data-bind="click: function() { $data.showAddTagName(true); }, visible: ! $data.showAddTagName()" title="${ _('Add a tag') }"></i>
-      </div>
-  </div>
-</script>
-
-
 <script type="text/html" id="metastore-databases-actions">
   <div class="inline-block pull-right">
     <a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('assist.db.refresh', 'hive'); }"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : $root.reloading }" title="${_('Refresh')}"></i></a>
@@ -613,20 +589,10 @@ ${ sqlContextPopover.sqlContextPopover() }
     <!-- ko if: $root.navigatorEnabled() && navigatorStats() -->
     <div class="span6 tile">
       <h4>${ _('Tagging') }</h4>
-      <div title="${ _('Tags') }"><i class="fa fa-fw fa-tags muted"></i>
-        <!-- ko foreach: navigatorStats().tags() -->
-          <span class="badge badge-info" data-bind="text: $data"></span> <i class="fa fa-minus pointer" data-bind="click: $parent.deleteTags"></i>
-        <!-- /ko -->
-
-        <!-- ko if: navigatorStats().tags().length == 0 -->
-          ${ _('No tags') }
-        <!-- /ko -->
-        <div data-bind="visible: showAddTagName">
-          <input type="text" data-bind="value: addTagName, valueUpdate:'afterkeydown'">
-          <i class="fa fa-save pointer" data-bind="click: addTags, visible: addTagName" title="${ _('Save tag') }"></i>
-        </div>
-        <i class="fa fa-plus pointer" data-bind="click: function() { showAddTagName(true); }, visible: ! showAddTagName()" title="${ _('Add a tag') }"></i>
-      </div>
+      <div style="margin-top: 5px" data-bind="component: { name: 'nav-tags', params: {
+        defaultDatabase: database.name,
+        table: name
+      } }"></div>
     </div>
     <!-- /ko -->
   </div>
@@ -1172,14 +1138,6 @@ ${ sqlContextPopover.sqlContextPopover() }
 
 <script type="text/javascript" charset="utf-8">
 
-  function list_tags() {
-    $.post("${ url('metadata:list_tags') }", { // '/metadata/api/navigator/list_tags/'
-      // prefix: 'bla'
-    }, function(data) {
-      console.log(JSON.stringify(data));
-    });
-  }
-
   function suggest() {
     $.post("${ url('metadata:suggest') }", { // '/metadata/api/navigator/suggest/'
       prefix: 'blah'

+ 6 - 11
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -1085,9 +1085,10 @@
     var clonedIdentifierChain = options.identifierChain.concat();
 
     var database = options.defaultDatabase;
-    if (typeof self.lastKnownDatabases[clonedIdentifierChain[0].name] !== 'undefined') {
-      database = clonedIdentifierChain.shift().name;
-    }
+    // TODO: Fix with proper source type
+    // if (typeof self.lastKnownDatabases[clonedIdentifierChain[0].name] !== 'undefined') {
+    //   database = clonedIdentifierChain.shift().name;
+    // }
     var url = NAV_FIND_ENTITY_API + '?type=database&name=' + database;
 
     if (clonedIdentifierChain.length > 0) {
@@ -1253,17 +1254,11 @@
   return {
 
     /**
-     * @param {Object} options
-     * @param {Object} options.i18n
-     * @param {string} options.i18n.errorLoadingDatabases
-     * @param {string} options.i18n.errorLoadingTablePreview
-     * @param {string} options.user
-     *
      * @returns {ApiHelper}
      */
-    getInstance: function (options) {
+    getInstance: function () {
       if (instance === null) {
-        instance = new ApiHelper(options.i18n, options.user);
+        instance = new ApiHelper(ApiHelperGlobals.i18n, ApiHelperGlobals.user);
       }
       return instance;
     }

+ 0 - 4
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -174,10 +174,6 @@
    *
    * Example:
    *
-   * <!-- ko hueSpinner: loading --><!-- /ko -->
-   *
-   * Or with options:
-   *
    * <!-- ko hueSpinner: { spin: loading, center: true, size: 'large' } --><!-- /ko -->
    *
    */

+ 8 - 0
desktop/core/src/desktop/templates/assist.mako

@@ -23,9 +23,17 @@ from django.utils.translation import ugettext as _
 from metadata.conf import has_navigator
 %>
 
+
 <%def name="assistPanel()">
+  <%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
+  <%namespace name="nav_components" file="/nav_components.mako" />
+
+  ${ sqlContextPopover.sqlContextPopover() }
+  ${ nav_components.nav_tags() }
+
   <style>
 
+
     .assist-icon {
       width: 16px;
       height: 16px;

+ 7 - 0
desktop/core/src/desktop/templates/common_header.mako

@@ -155,6 +155,13 @@ if USE_NEW_EDITOR.get():
       attribution: '${ leaflet['attribution'] |n,unicode }'
     };
 
+    ApiHelperGlobals = {
+      i18n: {
+        errorLoadingDatabases: '${ _('There was a problem loading the databases') }',
+        errorLoadingTablePreview: '${ _('There was a problem loading the preview') }'
+      },
+      user: '${ user.username }'
+    }
   </script>
 
   <!--[if lt IE 9]>

+ 0 - 2
desktop/core/src/desktop/templates/home2.mako

@@ -21,14 +21,12 @@
 <%namespace name="assist" file="/assist.mako" />
 <%namespace name="fileBrowser" file="/file_browser.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_('Welcome Home'), "home", user) | n,unicode }
 
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 ${ fileBrowser.fileBrowser() }
 
 <style type="text/css">

+ 157 - 0
desktop/core/src/desktop/templates/nav_components.mako

@@ -0,0 +1,157 @@
+## Licensed to Cloudera, Inc. under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  Cloudera, Inc. licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+
+<%!
+from desktop import conf
+from desktop.conf import USE_NEW_SIDE_PANELS
+from desktop.lib.i18n import smart_unicode
+from desktop.views import _ko
+from django.utils.translation import ugettext as _
+from metadata.conf import has_navigator
+%>
+
+<%def name="nav_tags()">
+  <link href="${ static('desktop/ext/css/selectize.css') }" rel="stylesheet">
+
+  <script type="text/html" id="nav-tags-template">
+    <!-- ko hueSpinner: { spin: loading } --><!-- /ko -->
+    <!-- ko ifnot: loading -->
+    <div style="width: 100%">
+      <textarea style="width: 100%" data-bind="tagEditor: {
+        placeholder: '${_ko('No tags found...')}',
+        setTags: currentTags,
+        onSave: onSave,
+        load: loadTags
+      }"></textarea>
+    </div>
+    <!-- /ko -->
+  </script>
+
+  <script type="text/javascript" charset="utf-8">
+    (function (factory) {
+      if(typeof require === "function") {
+        require([
+          'knockout',
+          'desktop/js/apiHelper',
+          'selectize'
+        ], factory);
+      } else {
+        factory(ko, ApiHelper);
+      }
+    }(function (ko, ApiHelper) {
+
+      /**
+       * @param {object} params
+       * @param {String} defaultDatabase
+       * @param {object[]} [params.identifierChain]
+       * @param {String} [params.database]
+       * @param {String} [params.table]
+       * @param {String} [params.column]
+       *
+       * @constructor
+       */
+      function NavTags(params) {
+        var self = this;
+        var apiHelper = ApiHelper.getInstance();
+
+        var identifierChain = ko.unwrap(params.identifierChain);
+        if (! params.identifierChain) {
+          identifierChain = [];
+          if (params.database) {
+            identifierChain.push({ name: ko.unwrap(params.database) });
+          }
+          if (params.table) {
+            identifierChain.push({ name: ko.unwrap(params.table) });
+          }
+          if (params.column) {
+            identifierChain.push({ name: ko.unwrap(params.column) });
+          }
+        }
+
+        self.identity;
+        self.loading = ko.observable(true);
+        self.navEntity = ko.observable();
+        self.currentTags = ko.observableArray();
+        self.allTags = ko.observableArray();
+
+        apiHelper.fetchNavEntity({
+          identifierChain: identifierChain,
+          defaultDatabase: ko.unwrap(params.defaultDatabase),
+          silenceErrors: true,
+          noCache: true,
+          successCallback: function (data) {
+            self.identity = data.entity.identity;
+            self.currentTags(data.entity.tags);
+            self.loading(false);
+          },
+          errorCallback: function () {
+            self.loading(false);
+          }
+        });
+
+        var fetchAllTags = function () {
+          apiHelper.listNavTags({
+            successCallback: function (data) {
+              self.allTags(Object.keys(data.tags))
+            },
+            silenceErrors: true
+          });
+        };
+        fetchAllTags();
+
+        self.loadTags = function (query, callback) {
+          callback($.map(self.allTags(), function (tag) { return { value: tag, text: tag }}));
+        };
+
+        self.onSave = function (value) {
+          var newTags = value.split(',');
+          var tagsToRemove = [];
+          var tagsToAdd = [];
+          var tagIndex = {};
+          self.currentTags().forEach(function (tag) {
+            tagIndex[tag] = false;
+          });
+          newTags.forEach(function (newTag) {
+            if (typeof tagIndex[newTag] !== 'undefined') {
+              tagIndex[newTag] = true;
+            } else {
+              tagsToAdd.push(newTag);
+            }
+          });
+          Object.keys(tagIndex).forEach(function (oldTag) {
+            if (! tagIndex[oldTag]) {
+              tagsToRemove.push(oldTag);
+            }
+          });
+
+          if (tagsToAdd.length > 0) {
+            apiHelper.addNavTags(self.identity, tagsToAdd);
+          }
+          if (tagsToRemove.length > 0) {
+            apiHelper.deleteNavTags(self.identity, tagsToRemove);
+          }
+          self.currentTags(newTags);
+          fetchAllTags();
+        };
+      }
+
+      ko.components.register('nav-tags', {
+        viewModel: NavTags,
+        template: { element: 'nav-tags-template' }
+      });
+    }));
+  </script>
+</%def>

+ 20 - 93
desktop/core/src/desktop/templates/sql_context_popover.mako

@@ -278,8 +278,17 @@ from metadata.conf import has_navigator
   </script>
 
   <script type="text/html" id="sql-context-table-and-column-tags">
-    <div class="sql-context-flex-fill" data-bind="with: fetchedData">
-      <!-- ko component: { name: 'sql-nav-tags', params: { entity: entity } } --><!-- /ko -->
+    <div class="sql-context-flex-fill">
+      <div class="sql-context-flex">
+        <div class="sql-context-flex-header">
+          <div style="margin: 10px 5px 0 10px;">
+            <span style="font-size: 15px; font-weight: 300;">${_('Tags')}</span>
+          </div>
+        </div>
+        <div class="sql-context-flex-fill sql-columns-table" style="position:relative; height: 100%; overflow-y: auto;">
+          <div style="margin: 10px" data-bind="component: { name: 'nav-tags', params: $data } "></div>
+        </div>
+      </div>
     </div>
   </script>
 
@@ -533,6 +542,14 @@ from metadata.conf import has_navigator
         });
       };
 
+      function TagsTab (identifierChain, defaultDatabase) {
+        var self = this;
+        self.loading = ko.observable(false);
+        self.hasErrors = ko.observable(false);
+        self.identifierChain = identifierChain;
+        self.defaultDatabase = defaultDatabase;
+      }
+
       function TableAndColumnContextTabs(data, sourceType, defaultDatabase, isColumn) {
         var self = this;
         self.tabs = ko.observableArray();
@@ -540,7 +557,7 @@ from metadata.conf import has_navigator
         var apiHelper = ApiHelper.getInstance();
 
         self.details = new TableAndColumnTabContents(data.identifierChain, sourceType, defaultDatabase, apiHelper.fetchAutocomplete);
-        self.tags = new TableAndColumnTabContents(data.identifierChain, sourceType, defaultDatabase, apiHelper.fetchNavEntity);
+        self.tags = new TagsTab(data.identifierChain, defaultDatabase);
         self.sample = new TableAndColumnTabContents(data.identifierChain, sourceType, defaultDatabase, apiHelper.fetchSamples);
         self.analysis = new TableAndColumnTabContents(data.identifierChain, sourceType, defaultDatabase, apiHelper.fetchAnalysis);
         self.partitions = new TableAndColumnTabContents(data.identifierChain, sourceType, defaultDatabase, apiHelper.fetchPartitions);
@@ -601,8 +618,6 @@ from metadata.conf import has_navigator
         self.activeTab.subscribe(function (newValue) {
           if (newValue === 'sample' && typeof self.sample.fetchedData() === 'undefined') {
             self.sample.fetch(self.initializeSamplesTable);
-          } else if (newValue === 'tags' && typeof self.tags.fetchedData() === 'undefined') {
-            self.tags.fetch();
           } else if (newValue === 'analysis' && typeof self.analysis.fetchedData() === 'undefined') {
             self.analysis.fetch();
           } else if (newValue === 'partitions' && typeof self.partitions.fetchedData() === 'undefined') {
@@ -1033,94 +1048,6 @@ from metadata.conf import has_navigator
     }));
   </script>
 
-  <link href="${ static('desktop/ext/css/selectize.css') }" rel="stylesheet">
-
-  <script type="text/html" id="sql-nav-tags-template">
-    <div class="sql-context-flex">
-      <div class="sql-context-flex-header">
-        <div style="margin: 10px 5px 0 10px;">
-          <span style="font-size: 15px; font-weight: 300;">${_('Tags')}</span>
-        </div>
-      </div>
-      <div class="sql-context-flex-fill sql-columns-table" style="position:relative; height: 100%; overflow-y: auto;">
-        <div style="margin: 10px">
-          <textarea style="width: 100%" data-bind="tagEditor: { placeholder: '${_ko('Enter tags...')}', setTags: currentTags, onSave: onSave, load: loadTags  }"></textarea>
-        </div>
-      </div>
-    </div>
-  </script>
-
-  <script type="text/javascript" charset="utf-8">
-    (function (factory) {
-      if(typeof require === "function") {
-        require([
-          'knockout',
-          'desktop/js/apiHelper'
-        ], factory);
-      } else {
-        factory(ko, ApiHelper);
-      }
-    }(function (ko, ApiHelper) {
-
-      function SqlNavTags(params) {
-        var self = this;
-        var apiHelper = ApiHelper.getInstance();
-
-        self.currentTags = ko.observableArray(params.entity.tags);
-        self.allTags = ko.observableArray();
-
-        var fetchAllTags = function () {
-          apiHelper.listNavTags({
-            successCallback: function (data) {
-              self.allTags(Object.keys(data.tags))
-            },
-            silenceErrors: true
-          });
-        };
-        fetchAllTags();
-
-        self.loadTags = function (query, callback) {
-          callback($.map(self.allTags(), function (tag) { return { value: tag, text: tag }}));
-        };
-
-        self.onSave = function (value) {
-          var newTags = value.split(',');
-          var tagsToRemove = [];
-          var tagsToAdd = [];
-          var tagIndex = {};
-          self.currentTags().forEach(function (tag) {
-            tagIndex[tag] = false;
-          });
-          newTags.forEach(function (newTag) {
-            if (typeof tagIndex[newTag] !== 'undefined') {
-              tagIndex[newTag] = true;
-            } else {
-              tagsToAdd.push(newTag);
-            }
-          });
-          Object.keys(tagIndex).forEach(function (oldTag) {
-            if (! tagIndex[oldTag]) {
-              tagsToRemove.push(oldTag);
-            }
-          });
-
-          if (tagsToAdd.length > 0) {
-            apiHelper.addNavTags(params.entity.identity, tagsToAdd);
-          }
-          if (tagsToRemove.length > 0) {
-            apiHelper.deleteNavTags(params.entity.identity, tagsToRemove);
-          }
-          self.currentTags(newTags);
-        };
-      }
-
-      ko.components.register('sql-nav-tags', {
-        viewModel: SqlNavTags,
-        template: { element: 'sql-nav-tags-template' }
-      });
-    }));
-  </script>
-
   <script type="text/html" id="sql-columns-table-template">
     <div class="sql-context-flex">
       <div class="sql-context-flex-header">

+ 0 - 2
desktop/libs/indexer/src/indexer/templates/indexer.mako

@@ -23,14 +23,12 @@
 <%namespace name="actionbar" file="actionbar.mako" />
 <%namespace name="assist" file="/assist.mako" />
 <%namespace name="require" file="/require.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_("Solr Indexes"), "search", user, "60px") | n,unicode }
 
 ${ require.config() }
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 
 <link rel="stylesheet" href="${ static('notebook/css/notebook.css') }">
 <link rel="stylesheet" href="${ static('desktop/css/wizard.css') }">

+ 1 - 2
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1953,9 +1953,8 @@
   };
 
 
-  function EditorViewModel(editor_id, notebooks, options, i18n, CoordinatorEditorViewModel, RunningCoordinatorModel) {
+  function EditorViewModel(editor_id, notebooks, options, CoordinatorEditorViewModel, RunningCoordinatorModel) {
     var self = this;
-    self.i18n = i18n;
     self.user = options.user;
     self.userId = options.userId;
     self.editorType = ko.observable(options.editor_type);

+ 0 - 2
desktop/libs/notebook/src/notebook/templates/editor.mako

@@ -23,7 +23,6 @@
 <%namespace name="configKoComponents" file="/config_ko_components.mako" />
 <%namespace name="editorComponents" file="editor_components.mako" />
 <%namespace name="notebookKoComponents" file="notebook_ko_components.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_('Editor'), editor_type, user, "68px") | n,unicode }
 
@@ -38,7 +37,6 @@ ${ editorComponents.includes() }
 ${ editorComponents.topBar() }
 ${ editorComponents.commonHTML() }
 
-${ sqlContextPopover.sqlContextPopover() }
 ${ assist.assistPanel() }
 ${ configKoComponents.config() }
 ${ notebookKoComponents.downloadSnippetResults() }

+ 2 - 5
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -3208,13 +3208,10 @@ ${ hueIcons.symbols() }
 
 
     $(document).ready(function () {
-      var i18n = {
-        errorLoadingDatabases: "${ _('There was a problem loading the databases') }"
-      }
       % if ENABLE_QUERY_SCHEDULING.get():
-      viewModel = new EditorViewModel(${ editor_id or 'null' }, ${ notebooks_json | n,unicode }, VIEW_MODEL_OPTIONS, i18n, CoordinatorEditorViewModel, RunningCoordinatorModel);
+      viewModel = new EditorViewModel(${ editor_id or 'null' }, ${ notebooks_json | n,unicode }, VIEW_MODEL_OPTIONS, CoordinatorEditorViewModel, RunningCoordinatorModel);
       % else:
-      viewModel = new EditorViewModel(${ editor_id or 'null' }, ${ notebooks_json | n,unicode }, VIEW_MODEL_OPTIONS, i18n);
+      viewModel = new EditorViewModel(${ editor_id or 'null' }, ${ notebooks_json | n,unicode }, VIEW_MODEL_OPTIONS);
       % endif
       ko.applyBindings(viewModel);
       viewModel.init();

+ 0 - 2
desktop/libs/notebook/src/notebook/templates/notebook.mako

@@ -23,7 +23,6 @@
 <%namespace name="configKoComponents" file="/config_ko_components.mako" />
 <%namespace name="editorComponents" file="editor_components.mako" />
 <%namespace name="notebookKoComponents" file="notebook_ko_components.mako" />
-<%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
 
 ${ commonheader(_('Notebook'), app_name, user, "68px") | n,unicode }
 
@@ -49,7 +48,6 @@ ${ editorComponents.topBar() }
 </%editorComponents:commonHTML>
 
 ${ assist.assistPanel() }
-${ sqlContextPopover.sqlContextPopover() }
 ${ configKoComponents.config() }
 ${ notebookKoComponents.addSnippetMenu() }
 ${ notebookKoComponents.downloadSnippetResults() }