瀏覽代碼

HUE-6468 [frontend] Dropping an xls/json file to 'Drop files here' shouldn't redirect to importer

Enrico Berti 8 年之前
父節點
當前提交
258b6e1a8b
共有 1 個文件被更改,包括 11 次插入4 次删除
  1. 11 4
      desktop/core/src/desktop/templates/hue.mako

+ 11 - 4
desktop/core/src/desktop/templates/hue.mako

@@ -811,13 +811,20 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
           self.getActiveAppViewModel(function (vm) {
           self.getActiveAppViewModel(function (vm) {
             vm.createWizard.source.path(DropzoneGlobals.homeDir + '/' + filename);
             vm.createWizard.source.path(DropzoneGlobals.homeDir + '/' + filename);
           });
           });
+          $('.dz-drag-hover').removeClass('dz-drag-hover');
         };
         };
 
 
         self.dropzoneComplete = function (path) {
         self.dropzoneComplete = function (path) {
-          self.loadApp('importer');
-          self.getActiveAppViewModel(function (vm) {
-            vm.createWizard.source.path(path);
-          });
+          if (path.toLowerCase().endsWith('.csv')){
+            self.loadApp('importer');
+            self.getActiveAppViewModel(function (vm) {
+              vm.createWizard.source.path(path);
+            });
+          }
+          else {
+            huePubSub.publish('open.link', '/filebrowser/view=' + path);
+          }
+          $('.dz-drag-hover').removeClass('dz-drag-hover');
         };
         };
 
 
         // prepend /hue to all the link on this page
         // prepend /hue to all the link on this page