Browse Source

HUE-7341 [autocomplete] Fix issue where the first folder is ignored for HDFS suggestions

Johan Ahlen 8 years ago
parent
commit
ac0afd6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      desktop/core/src/desktop/static/desktop/js/apiHelper.js

+ 3 - 1
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -397,7 +397,9 @@ var ApiHelper = (function () {
    */
   ApiHelper.prototype.fetchHdfsPath = function (options) {
     var self = this;
-    options.pathParts.shift();
+    if (options.pathParts.length > 0 && options.pathParts[0] === '') {
+      options.pathParts.shift();
+    }
     var url = HDFS_API_PREFIX + options.pathParts.join("/") + '?format=json&sortby=name&descending=false&pagesize=' + (options.pageSize || 500) + '&pagenum=' + (options.page || 1);
     if (options.filter) {
       url += '&filter=' + options.filter;