Repository: zeppelin
Updated Branches:
  refs/heads/master c904e56a8 -> 0267ecf76


[ZEPPELIN-3289] Table not using full height after paragraph height has been 
changed

Changing paragraph height does not work correctly anymore in conjunction with 
table output. Refer screen shot:
![image](https://user-images.githubusercontent.com/674497/36977669-f28c77a2-20a7-11e8-854a-0b6d40973700.png)

[Bug Fix]

* [ZEPPELIN-3289](https://issues.apache.org/jira/browse/ZEPPELIN-3289)
* [ZEPPELIN-3272](https://issues.apache.org/jira/browse/ZEPPELIN-3272)

* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A

Author: Prabhjyot Singh <prabhjyotsi...@gmail.com>

Closes #2835 from prabhjyotsingh/ZEPPELIN-3289 and squashes the following 
commits:

40322606a [Prabhjyot Singh] data duplication fix
d63c5e70c [Prabhjyot Singh] fix `core` undefined
dd6a6d121 [Prabhjyot Singh] ZEPPELIN-3289: refresh() also updates height

Change-Id: I4056f796cd34cf23af12dcf4af6ee9c3ae6067e7


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/0267ecf7
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/0267ecf7
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/0267ecf7

Branch: refs/heads/master
Commit: 0267ecf76d313ba3c3ccea2d35e9b1919c7c9956
Parents: c904e56
Author: Prabhjyot Singh <prabhjyotsi...@gmail.com>
Authored: Tue Mar 6 12:55:35 2018 +0530
Committer: Prabhjyot Singh <prabhjyotsi...@gmail.com>
Committed: Thu Mar 8 09:56:04 2018 +0530

----------------------------------------------------------------------
 zeppelin-web/package.json                       |  2 +-
 .../paragraph/result/result.controller.js       | 55 +++++++++++---------
 .../builtins/visualization-table.js             |  5 ++
 3 files changed, 35 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0267ecf7/zeppelin-web/package.json
----------------------------------------------------------------------
diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json
index 5e8762c..3ff642b 100644
--- a/zeppelin-web/package.json
+++ b/zeppelin-web/package.json
@@ -25,7 +25,7 @@
     "test": "karma start karma.conf.js"
   },
   "dependencies": {
-    "angular-ui-grid": "^4.0.4",
+    "angular-ui-grid": "^4.2.4",
     "angular-viewport-watch": "github:shahata/angular-viewport-watch",
     "ansi_up": "^2.0.2",
     "github-markdown-css": "2.6.0",

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0267ecf7/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
----------------------------------------------------------------------
diff --git 
a/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js 
b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
index 29465e5..75a80b2 100644
--- a/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
@@ -544,32 +544,35 @@ function ResultCtrl($scope, $rootScope, $route, $window, 
$routeParams, $location
   };
 
   function appendTableOutput(data) {
-    if (!$scope.$parent.result.data) {
-      $scope.$parent.result.data = [];
-      tableData = undefined;
-    }
-    if (!$scope.$parent.result.data[data.index]) {
-      $scope.$parent.result.data[data.index] = '';
-    }
-    if (!tableData) {
-      $scope.$parent.result.data[data.index] = 
$scope.$parent.result.data[data.index].concat(data.data);
-      $rootScope.$broadcast(
-        'updateResult',
-        {'data': $scope.$parent.result.data[data.index], 'type': 'TABLE'},
-        undefined,
-        paragraph,
-        data.index);
-      let elemId = `p${$scope.id}_table`;
-      renderGraph(elemId, 'table', true);
-    } else {
-      let textRows = data.data.split('\n');
-      for (let i = 0; i < textRows.length; i++) {
-        if (textRows[i] !== '') {
-          let row = textRows[i].split('\t');
-          tableData.rows.push(row);
-          let builtInViz = builtInVisualizations['table'];
-          if (builtInViz.instance !== undefined) {
-            builtInViz.instance.append([row], tableData.columns);
+    if (ParagraphStatus.FINISHED !== paragraph.status) {
+      if (!$scope.$parent.result.data) {
+        $scope.$parent.result.data = [];
+        tableData = undefined;
+      }
+      if (!$scope.$parent.result.data[data.index]) {
+        $scope.$parent.result.data[data.index] = '';
+      }
+      if (!tableData) {
+        $scope.$parent.result.data[data.index] = 
$scope.$parent.result.data[data.index].concat(
+          data.data);
+        $rootScope.$broadcast(
+          'updateResult',
+          {'data': $scope.$parent.result.data[data.index], 'type': 'TABLE'},
+          undefined,
+          paragraph,
+          data.index);
+        let elemId = `p${$scope.id}_table`;
+        renderGraph(elemId, 'table', true);
+      } else {
+        let textRows = data.data.split('\n');
+        for (let i = 0; i < textRows.length; i++) {
+          if (textRows[i] !== '') {
+            let row = textRows[i].split('\t');
+            tableData.rows.push(row);
+            let builtInViz = builtInVisualizations['table'];
+            if (builtInViz.instance !== undefined) {
+              builtInViz.instance.append([row], tableData.columns);
+            }
           }
         }
       }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0267ecf7/zeppelin-web/src/app/visualization/builtins/visualization-table.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-table.js 
b/zeppelin-web/src/app/visualization/builtins/visualization-table.js
index 723bb3a..5837575 100644
--- a/zeppelin-web/src/app/visualization/builtins/visualization-table.js
+++ b/zeppelin-web/src/app/visualization/builtins/visualization-table.js
@@ -158,6 +158,11 @@ export default class TableVisualization extends 
Visualization {
 
     if (gridElem) {
       gridElem.css('height', this.targetEl.height() - 10);
+      const gridApiId = this.getGridApiId();
+      const scope = this.getScope();
+      if(scope[gridApiId]!==undefined) {
+        scope[gridApiId].core.handleWindowResize();
+      }
     }
   }
 

Reply via email to