Browse Source

HUE-9354 [editor] Prevent grayed out result when fetch_result_data returns empty data in editor v2

Johan Ahlen 5 năm trước cách đây
mục cha
commit
775b3efe7f

+ 8 - 0
desktop/core/src/desktop/js/apps/notebook2/components/resultGrid/ko.resultGrid.js

@@ -278,6 +278,14 @@ class ResultGrid extends DisposableComponent {
 
     this.subscribe(this.data, this.render.bind(this));
 
+    this.subscribe(this.hasMore, val => {
+      // Hive reports hasMore = true when there's actually no more results, this prevents the grid
+      // from being grayed out after scroll as this.data doesn't change but this.hasMore does.
+      if (!val) {
+        this.showNormalResult();
+      }
+    });
+
     this.subscribe(this.meta, meta => {
       if (meta) {
         if (this.hueDatatable) {