From b3406b70aaa6337c3f442793fa289f91bd401790 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Tue, 12 Jul 2016 19:00:51 -0700 Subject: [PATCH 1/2] Recreate table when (data) is refreshed --- .../src/app/notebook/paragraph/paragraph.controller.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index 1febeb1cca4..ccf8199ef7c 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -406,12 +406,14 @@ 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); @@ -470,7 +472,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 +1285,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; } From 7978f473e0e0c4a6df2ac42d3748049d6495a9c0 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Tue, 12 Jul 2016 20:37:57 -0700 Subject: [PATCH 2/2] remove multiple newlines --- zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index ccf8199ef7c..da4004f2e07 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -413,8 +413,6 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r data.paragraph.status === 'ERROR' || (data.paragraph.status === 'FINISHED' && statusChanged) || (!newActiveApp && oldActiveApp !== newActiveApp); - - //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) {