Repository: zeppelin
Updated Branches:
  refs/heads/master 9ce24e24b -> b1e6e2c20


[ZEPPELIN-1150] Table contents disappear 2nd run onwards

### What is this PR for?
Fix for [ZEPPELIN-1150](https://issues.apache.org/jira/browse/ZEPPELIN-1150).

### What type of PR is it?
Bug Fix

### Todos
* [x] - Recreate table on data refresh
* [x] - Better solution for 
[ZEPPELIN-1078](https://issues.apache.org/jira/browse/ZEPPELIN-1078) without 
performance degrade

### What is the Jira issue?
[ZEPPELIN-1150](https://issues.apache.org/jira/browse/ZEPPELIN-1150)

### How should this be tested?
Reproduce procedure described in the issue

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <m...@apache.org>

Closes #1171 from Leemoonsoo/ZEPPELIN-1150 and squashes the following commits:

7978f47 [Lee moon soo] remove multiple newlines
b3406b7 [Lee moon soo] Recreate table when (data) is refreshed


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

Branch: refs/heads/master
Commit: b1e6e2c20d708f3a2bbecda7a571795d543b8905
Parents: 9ce24e2
Author: Lee moon soo <m...@apache.org>
Authored: Tue Jul 12 20:37:57 2016 -0700
Committer: Lee moon soo <m...@apache.org>
Committed: Wed Jul 13 11:14:48 2016 -0700

----------------------------------------------------------------------
 .../src/app/notebook/paragraph/paragraph.controller.js    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b1e6e2c2/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js 
b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 1febeb1..da4004f 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -406,13 +406,13 @@ 
angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
       var oldActiveApp = _.get($scope.paragraph.config, 'helium.activeApp');
       var newActiveApp = _.get(data.paragraph.config, 'helium.activeApp');
 
+      var statusChanged = (data.paragraph.status !== $scope.paragraph.status);
+
       var resultRefreshed = (data.paragraph.dateFinished !== 
$scope.paragraph.dateFinished) ||
         isEmpty(data.paragraph.result) !== isEmpty($scope.paragraph.result) ||
-        data.paragraph.status === 'ERROR' ||
+        data.paragraph.status === 'ERROR' || (data.paragraph.status === 
'FINISHED' && statusChanged) ||
         (!newActiveApp && oldActiveApp !== newActiveApp);
 
-      var statusChanged = (data.paragraph.status !== $scope.paragraph.status);
-
       //console.log("updateParagraph oldData %o, newData %o. type %o -> %o, 
mode %o -> %o", $scope.paragraph, data, oldType, newType, oldGraphMode, 
newGraphMode);
 
       if ($scope.paragraph.text !== data.paragraph.text) {
@@ -470,7 +470,7 @@ 
angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
         $scope.renderHtml();
       } else if (newType === 'ANGULAR' && resultRefreshed) {
         $scope.renderAngular();
-      } else if (newType === 'TEXT') {
+      } else if (newType === 'TEXT' && resultRefreshed) {
         $scope.renderText();
       }
 
@@ -1283,7 +1283,7 @@ 
angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
       var columnNames = _.pluck(data.columnNames, 'name');
 
       // on chart type change, destroy table to force reinitialization.
-      if ($scope.hot && !refresh) {
+      if ($scope.hot) {
         $scope.hot.destroy();
         $scope.hot = null;
       }

Reply via email to