Преглед изворни кода

HUE-6356 [importer] Add proper hueLinks

Romain Rigaux пре 8 година
родитељ
комит
eee5c11

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

@@ -39,7 +39,6 @@ from django.views.decorators.http import require_http_methods, require_POST
 import django.views.debug
 
 from aws.conf import is_enabled as is_s3_enabled, has_s3_access
-from notebook.conf import get_ordered_interpreters
 
 import desktop.conf
 import desktop.log.log_buffer

+ 3 - 3
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -403,7 +403,7 @@ ${ assist.assistPanel() }
               <input type="text" class="form-control path input-xxlarge" data-bind="value: createWizard.source.path, filechooser: createWizard.source.path, filechooserOptions: { linkMarkup: true, skipInitialPathIfEmpty: true, openOnFocus: true, selectFolder: false }" placeholder="${ _('Click or drag from the assist') }">
             </label>
             <!-- ko if: createWizard.source.path().length > 0 -->
-              <a data-bind="attr: {href: '/filebrowser/view=' + createWizard.source.path() }" target="_blank" title="${ _('Open') }">
+              <a data-bind="hueLink: '/filebrowser/view=' + createWizard.source.path()" target="_blank" title="${ _('Open') }">
                 <i class="fa fa-external-link-square"></i>
               </a>
             <!-- /ko -->
@@ -518,7 +518,7 @@ ${ assist.assistPanel() }
               <!-- ko if: outputFormat() != 'index' -->
               <i class="fa fa-warning" style="color: #c09853"></i> ${ _('Already existing') } <span data-bind="text: outputFormat"></span>
               <!-- /ko -->
-              <a href="javascript:void(0)" data-bind="attr: { href: existingTargetUrl() }, text: name" target="_blank" title="${ _('Open it.') }"></a>
+              <a href="javascript:void(0)" data-bind="hueLink: existingTargetUrl(), text: name" target="_blank" title="${ _('Open') }"></a>
             </span>
           </div>
         </div>
@@ -549,7 +549,7 @@ ${ assist.assistPanel() }
 
             <div class="control-group">
               <label class="control-label"><div>${ _('Extras') }</div>
-                <a href="javascript:void(0)" data-bind="css: {'inactive-action': !showProperties()}, click: function() {showProperties(!showProperties()) }" title="${ _('Show extra properties') }">
+                <a href="javascript:void(0)" data-bind="css: { 'inactive-action': !showProperties() }, click: function() { showProperties(!showProperties()) }" title="${ _('Show extra properties') }">
                   <i class="fa fa-sliders fa-padding-top"></i>
                 </a>
               </label>

+ 1 - 0
desktop/libs/indexer/src/indexer/views.py

@@ -113,6 +113,7 @@ def _importer(request, prefill):
       'operators_json' : json.dumps([operator.to_dict() for operator in OPERATORS]),
       'file_types_json' : json.dumps([format_.format_info() for format_ in get_file_indexable_format_types()]),
       'default_field_type' : json.dumps(Field().to_dict()),
+      'prefill' : json.dumps(prefill),
       'sourceType': 'hive'  # TODO check Impala, config.get('default_sql_interpreter', 'hive')
   })