浏览代码

HUE-5935 [importer] Opening the importer without a prefill throws a JS error

Enrico Berti 8 年之前
父节点
当前提交
e99f911
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      desktop/libs/indexer/src/indexer/templates/importer.mako

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

@@ -388,19 +388,19 @@ ${ assist.assistPanel() }
       <h3 class="card-heading simple">${_('Source')}</h3>
       <div class="card-body">
         <div>
-          <div class="control-group" data-bind="visible: !createWizard.prefill.target_type() || createWizard.prefill.source_type() == 'all'">
+          <div class="control-group" data-bind="visible: !createWizard.prefill.target_type || !createWizard.prefill.target_type() || createWizard.prefill.source_type() == 'all'">
             <label for="sourceType" class="control-label"><div>${ _('Type') }</div>
               <select id="sourceType" data-bind="selectize: createWizard.source.inputFormats, value: createWizard.source.inputFormat, optionsText: 'name', optionsValue: 'value'"></select>
             </label>
           </div>
 
-          <div class="control-group" data-bind="visible: createWizard.prefill.target_type() == 'database'">
+          <div class="control-group" data-bind="visible: createWizard.prefill.target_type && createWizard.prefill.target_type() == 'database'">
             <label for="sourceType" class="control-label">${ _('No source is needed for creating a database.') }</label>
           </div>
 
           <div class="control-group" data-bind="visible: createWizard.source.inputFormat() == 'file'">
             <label for="path" class="control-label"><div>${ _('Path') }</div>
-              <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 & drop') }">
+              <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') }">