浏览代码

HUE-6363 [importer] Creating a bew database and table links are not working

Romain Rigaux 8 年之前
父节点
当前提交
e047cee
共有 2 个文件被更改,包括 11 次插入19 次删除
  1. 6 14
      desktop/core/src/desktop/templates/assist.mako
  2. 5 5
      desktop/core/src/desktop/templates/hue.mako

+ 6 - 14
desktop/core/src/desktop/templates/assist.mako

@@ -703,22 +703,14 @@ from notebook.conf import get_ordered_interpreters
       % if ENABLE_NEW_CREATE_TABLE.get():
         <!-- ko if: sourceType === 'hive' || sourceType === 'impala' -->
         <!-- ko if: typeof databaseName !== 'undefined' -->
-          <!-- ko if: IS_HUE_4 -->
-            <a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('open.link', '${ url('indexer:importer_prefill', source_type='all', target_type='table') }' + databaseName ); }" title="${_('Create table')}" href="javascript:void(0)">
-              <i class="pointer fa fa-plus" title="${_('Create table')}"></i>
-            </a>
-          <!-- /ko -->
-          <!-- ko if: ! IS_HUE_4 -->
-            <a class="inactive-action" href="javascript:void(0)" data-bind="attr: { 'href': '${ url('indexer:importer_prefill', source_type='all', target_type='table') }' + databaseName }"><i class="pointer fa fa-plus" title="${_('Create table')}"></i></a>
-          <!-- /ko -->
+          <a class="inactive-action" data-bind="hueLink: '${ url('indexer:importer_prefill', source_type='all', target_type='table') }' + databaseName" title="${_('Create table')}" href="javascript:void(0)">
+            <i class="pointer fa fa-plus" title="${_('Create table')}"></i>
+          </a>
         <!-- /ko -->
         <!-- ko if: typeof databases !== 'undefined' -->
-          <!-- ko if: IS_HUE_4 -->
-            <a class="inactive-action" href="javascript:void(0)" data-bind="click: function () { huePubSub.publish('open.link', '${ url('indexer:importer_prefill', source_type='manual', target_type='database') }'); }" href="javascript:void(0)"><i class="pointer fa fa-plus" title="${_('Create database')}"></i></a>
-          <!-- /ko -->
-          <!-- ko if: ! IS_HUE_4 -->
-            <a class="inactive-action" href="javascript:void(0)" data-bind="attr: { 'href': '${ url('indexer:importer_prefill', source_type='manual', target_type='database') }' }"><i class="pointer fa fa-plus" title="${_('Create database')}"></i></a>
-          <!-- /ko -->
+          <a class="inactive-action" data-bind="hueLink: '${ url('indexer:importer_prefill', source_type='manual', target_type='database') }'" href="javascript:void(0)">
+            <i class="pointer fa fa-plus" title="${ _('Create database') }"></i>
+          </a>
         <!-- /ko -->
         <!-- /ko -->
       % endif

+ 5 - 5
desktop/core/src/desktop/templates/hue.mako

@@ -811,15 +811,15 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
           { url: '/indexer/importer/prefill/*', app: function (ctx) {
             self.loadApp('importer');
             self.getActiveAppViewModel(function (viewModel) {
-              var arguments = ctx.path.match(/\/indexer\/importer\/prefill\/?([^/]+)\/?([^/]+)\/?([^/]+)?/);
-              if (! arguments) {
+              var _params = ctx.path.match(/\/indexer\/importer\/prefill\/?([^/]+)\/?([^/]+)\/?([^/]+)?/);
+              if (! _params) {
                 console.warn('Could not match ' + href);
               }
               hueUtils.waitForVariable(viewModel.createWizard, function(){
                 hueUtils.waitForVariable(viewModel.createWizard.prefill, function(){
-                  viewModel.createWizard.prefill.source_type(arguments && arguments[1] ? arguments[1] : '');
-                  viewModel.createWizard.prefill.target_type(arguments && arguments[2] ? arguments[2] : '');
-                  viewModel.createWizard.prefill.target_path(arguments && arguments[3] ? arguments[3] : '');
+                  viewModel.createWizard.prefill.source_type(_params && _params[1] ? _params[1] : '');
+                  viewModel.createWizard.prefill.target_type(_params && _params[2] ? _params[2] : '');
+                  viewModel.createWizard.prefill.target_path(_params && _params[3] ? _params[3] : '');
                 });
               });
             })