Преглед на файлове

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

Johan Ahlen преди 5 години
родител
ревизия
775b3efe7f
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 8 0
      desktop/core/src/desktop/js/apps/notebook2/components/resultGrid/ko.resultGrid.js

+ 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) {