Bläddra i källkod

HUE-5901 [importer] Disable submission if one of the column has an empty name

Romain Rigaux 8 år sedan
förälder
incheckning
6d2b905

+ 1 - 1
desktop/conf.dist/hue.ini

@@ -1631,7 +1631,7 @@
     ## api_url=http://localhost:7187/api
 
     # Which authentication to use: CM or external via LDAP or SAML.
-    ## navmetaserver_auth_type=CMDB
+    ## navmetadataserver_auth_type=CMDB
 
     # Username of the CM user used for authentication.
     ## navmetadataserver_cmdb_user=hue

+ 1 - 1
desktop/conf/pseudo-distributed.ini.tmpl

@@ -1635,7 +1635,7 @@
     ## api_url=http://localhost:7187/api
 
     # Which authentication to use: CM or external via LDAP or SAML.
-    ## navmetaserver_auth_type=CMDB
+    ## navmetadataserver_auth_type=CMDB
 
     # Username of the CM user used for authentication.
     ## navmetadataserver_cmdb_user=hue

+ 4 - 1
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -1443,9 +1443,12 @@ ${ assist.assistPanel() }
       self.readyToIndex = ko.computed(function () {
         var validFields = self.destination.columns().length || self.destination.outputFormat() == 'database';
         var validDestination = self.destination.name().length > 0 && (['table', 'database'].indexOf(self.destination.outputFormat()) == -1 || /^([a-zA-Z0-9_]+\.)?[a-zA-Z0-9_]*$/.test(self.destination.name()));
+        var validTableColumns = self.destination.outputFormat() != 'table' || $.grep(self.destination.columns(), function(column) {
+          return column.name().length == 0;
+        }).length == 0;
         var isTargetAlreadyExisting = ! self.destination.isTargetExisting() || self.destination.outputFormat() == 'index';
 
-        return validDestination && validFields && isTargetAlreadyExisting;
+        return validDestination && validFields && validTableColumns && isTargetAlreadyExisting;
       });
 
       self.formatTypeSubscribed = false;

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

@@ -639,7 +639,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
         % if conf.USE_DEFAULT_CONFIGURATION.get():
           <a class="inactive-action pointer margin-left-10" title="${ _('Save session settings as default') }" rel="tooltip" data-bind="click: function() { $parent.saveDefaultUserProperties($data) }"><i class="fa fa-save"></i> ${ _('Set as default settings') }</a>
         % endif
-        <!-- ko if: type()== 'impala' && typeof http_addr != 'undefined' -->
+        <!-- ko if: type() == 'impala' && typeof http_addr != 'undefined' -->
         <a class="margin-left-10" data-bind="attr: {'href': window.location.protocol + '//' + http_addr().replace(/^(https?):\/\//, '')}" target="_blank"><i class="fa fa-external-link"></i> <span data-bind="text: http_addr().replace(/^(https?):\/\//, '')"></span></a>
         <!-- /ko -->
       </div>
@@ -1030,7 +1030,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
 </script>
 
 <script type="text/html" id="code-editor-snippet-body">
-  <!-- ko if: HAS_OPTIMIZER -->
+  <!-- ko if: HAS_OPTIMIZER && (type() == 'impala' || type() == 'hive') -->
   <div data-bind="css: { 'active': showOptimizer }">
     <div class="round-icon empty">&nbsp;</div>
     <!-- ko if: hasSuggestion() == null -->