Browse Source

HUE-9198 [assist] Fix ABFS upload issue in left assist

Johan Ahlen 5 years ago
parent
commit
19dddfab7d

+ 4 - 1
desktop/core/src/desktop/js/ko/components/assist/assistStorageEntry.js

@@ -63,11 +63,14 @@ class AssistStorageEntry {
     self.path = '';
     if (self.parent !== null) {
       self.path = self.parent.path;
-      if (self.parent.path !== '/') {
+      if (self.parent.path !== '/' && !/\/$/.test(self.path)) {
         self.path += '/';
       }
     }
+
     self.path += self.definition.name;
+    self.abfsPath = (/^\//.test(self.path) ? 'abfs:/' : 'abfs://') + self.path;
+
     self.currentPage = 1;
     self.hasMorePages = true;
     self.preview = ko.observable();

+ 2 - 2
desktop/core/src/desktop/js/ko/components/assist/ko.assistStoragePanel.js

@@ -65,8 +65,8 @@ const TEMPLATE = `
       <!-- /ko -->
       <!-- ko if: source.type === 'abfs' && path !== '/' && window.SHOW_UPLOAD_BUTTON -->
       <a class="inactive-action" data-bind="dropzone: {
-            url: '/filebrowser/upload/file?dest=' + 'abfs:/' + path,
-            params: { dest: 'abfs:/' + path },
+            url: '/filebrowser/upload/file?dest=' + abfsPath,
+            params: { dest: abfsPath },
             paramName: 'hdfs_file',
             onError: function(x, e){ $(document).trigger('error', e); },
             onComplete: function () { huePubSub.publish('assist.storage.refresh'); } }" title="${I18n(