ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [02/29] ambari git commit: AMBARI-22490. Uploading a Zero KB file to HDFS via File View Fails (pallavkul)
Date Fri, 01 Dec 2017 21:40:38 GMT
AMBARI-22490. Uploading a Zero KB file to HDFS via File View Fails (pallavkul)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ff08592a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ff08592a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ff08592a

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: ff08592a32d3b8bf4c2ba2c674b73233c775f424
Parents: ca174fb
Author: pallavkul <pallav.kul@gmail.com>
Authored: Thu Nov 30 07:16:47 2017 +0530
Committer: pallavkul <pallav.kul@gmail.com>
Committed: Thu Nov 30 07:16:47 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/components/upload-file.js  | 38 ++++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ff08592a/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/components/upload-file.js b/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
index 8a14272..1a5e911 100644
--- a/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
+++ b/contrib/views/files/src/main/resources/ui/app/components/upload-file.js
@@ -104,25 +104,25 @@ export default Ember.Component.extend(OperationModal, {
           url: url
         });
         this.set('uploader', uploader);
-        if(!Ember.isEmpty(file)) {
-          uploader.upload(file, {path: this.get('path')});
-          this.setUploading(file.name);
-          uploader.on('progress', (e) => {
-            this.setUploadPercent(e.percent);
-          });
-          uploader.on('didUpload', (e) => {
-            this.set('uploader');
-            this.send('close');
-            this.sendAction('refreshAction');
-          });
-          uploader.on('didError', (jqXHR, textStatus, errorThrown) => {
-            var error = Ember.$.parseJSON(jqXHR.responseText);
-            this.set('uploader');
-            this.get('logger').danger(`Failed to upload ${file.name} to ${this.get('path')}`,
error);
-            this.send('close');
-            return false;
-          });
-        }
+        uploader.upload(file, {
+          path: this.get('path')
+        });
+        this.setUploading(file.name);
+        uploader.on('progress', (e) => {
+          this.setUploadPercent(e.percent);
+        });
+        uploader.on('didUpload', (e) => {
+          this.set('uploader');
+          this.send('close');
+          this.sendAction('refreshAction');
+        });
+        uploader.on('didError', (jqXHR, textStatus, errorThrown) => {
+          var error = Ember.$.parseJSON(jqXHR.responseText);
+          this.set('uploader');
+          this.get('logger').danger(`Failed to upload ${file.name} to ${this.get('path')}`,
error);
+          this.send('close');
+          return false;
+        });
       }, (error) => {
         console.error("Cannot add a directory.", error);
         this.send('close');


Mime
View raw message