소스 검색

HUE-3145 [metastore] Show error when missing permission to load data table

Romain Rigaux 9 년 전
부모
커밋
95cc25d652
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

+ 9 - 3
apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

@@ -363,10 +363,16 @@
   }
   }
 
 
   MetastoreTable.prototype.showImportData = function () {
   MetastoreTable.prototype.showImportData = function () {
-    var self = this;
+    var self = this; console.log('aaa');
     $.get('/metastore/table/' + self.database.name + '/' + self.name + '/load', function (response) {
     $.get('/metastore/table/' + self.database.name + '/' + self.name + '/load', function (response) {
-      $("#import-data-modal").html(response['data']);
-      $("#import-data-modal").modal("show");
+      if (data.status == 0) {
+        $("#import-data-modal").html(response['data']);
+        $("#import-data-modal").modal("show");
+      } else {
+        $(document).trigger("error", data.message);  
+      }
+    }).fail(function (xhr, textStatus, errorThrown) {
+      $(document).trigger("error", xhr.responseText);
     });
     });
   };
   };