From 441357c042ed557c63f18bb15b2833293431bd06 Mon Sep 17 00:00:00 2001 From: astroshim Date: Wed, 29 Jun 2016 09:28:41 +0900 Subject: [PATCH 1/3] remove resultRefreshed value. --- .../app/notebook/paragraph/paragraph.controller.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index 398191c8e42..33ada35858c 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -365,10 +365,6 @@ angular.module('zeppelinWebApp') var newType = $scope.getResultType(data.paragraph); var oldGraphMode = $scope.getGraphMode(); var newGraphMode = $scope.getGraphMode(data.paragraph); - var resultRefreshed = (data.paragraph.dateFinished !== $scope.paragraph.dateFinished) || - isEmpty(data.paragraph.result) !== isEmpty($scope.paragraph.result) || - data.paragraph.status === 'ERROR'; - 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); @@ -414,7 +410,7 @@ angular.module('zeppelinWebApp') if (newType === 'TABLE') { $scope.loadTableData($scope.paragraph.result); - if (oldType !== 'TABLE' || resultRefreshed) { + if (oldType !== 'TABLE') { clearUnknownColsFromGraphOption(); selectDefaultColsForGraphOption(); } @@ -424,15 +420,15 @@ angular.module('zeppelinWebApp') } else { $scope.setGraphMode(newGraphMode, false, true); } - } else if (newType === 'HTML' && resultRefreshed) { + } else if (newType === 'HTML') { $scope.renderHtml(); - } else if (newType === 'ANGULAR' && resultRefreshed) { + } else if (newType === 'ANGULAR') { $scope.renderAngular(); - } else if (newType === 'TEXT' && resultRefreshed) { + } else if (newType === 'TEXT') { $scope.renderText(); } - if (statusChanged || resultRefreshed) { + if (statusChanged) { // when last paragraph runs, zeppelin automatically appends new paragraph. // this broadcast will focus to the newly inserted paragraph var paragraphs = angular.element('div[id$="_paragraphColumn_main"]'); From ec44166ab416d85e9ab5ee614ed816c9d099d44a Mon Sep 17 00:00:00 2001 From: astroshim Date: Sun, 3 Jul 2016 00:22:17 +0900 Subject: [PATCH 2/3] remove resultRefreshed from TEXT type only --- .../app/notebook/paragraph/paragraph.controller.js | 11 +++++++---- 1 file changed, 7 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 33ada35858c..ecb88be7a1e 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -365,6 +365,9 @@ angular.module('zeppelinWebApp') var newType = $scope.getResultType(data.paragraph); var oldGraphMode = $scope.getGraphMode(); var newGraphMode = $scope.getGraphMode(data.paragraph); + var resultRefreshed = (data.paragraph.dateFinished !== $scope.paragraph.dateFinished) || + isEmpty(data.paragraph.result) !== isEmpty($scope.paragraph.result) || + data.paragraph.status === 'ERROR'; 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); @@ -410,7 +413,7 @@ angular.module('zeppelinWebApp') if (newType === 'TABLE') { $scope.loadTableData($scope.paragraph.result); - if (oldType !== 'TABLE') { + if (oldType !== 'TABLE' || resultRefreshed) { clearUnknownColsFromGraphOption(); selectDefaultColsForGraphOption(); } @@ -420,15 +423,15 @@ angular.module('zeppelinWebApp') } else { $scope.setGraphMode(newGraphMode, false, true); } - } else if (newType === 'HTML') { + } else if (newType === 'HTML' || resultRefreshed) { $scope.renderHtml(); - } else if (newType === 'ANGULAR') { + } else if (newType === 'ANGULAR' || resultRefreshed) { $scope.renderAngular(); } else if (newType === 'TEXT') { $scope.renderText(); } - if (statusChanged) { + if (statusChanged || resultRefreshed) { // when last paragraph runs, zeppelin automatically appends new paragraph. // this broadcast will focus to the newly inserted paragraph var paragraphs = angular.element('div[id$="_paragraphColumn_main"]'); From 189c5eb432fd0997cf7fd2e53b4fc1fa66b7291a Mon Sep 17 00:00:00 2001 From: astroshim Date: Sun, 3 Jul 2016 00:23:41 +0900 Subject: [PATCH 3/3] remove resultRefreshed from TEXT type only --- .../src/app/notebook/paragraph/paragraph.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 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 ecb88be7a1e..5dca1808fd4 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -423,9 +423,9 @@ angular.module('zeppelinWebApp') } else { $scope.setGraphMode(newGraphMode, false, true); } - } else if (newType === 'HTML' || resultRefreshed) { + } else if (newType === 'HTML' && resultRefreshed) { $scope.renderHtml(); - } else if (newType === 'ANGULAR' || resultRefreshed) { + } else if (newType === 'ANGULAR' && resultRefreshed) { $scope.renderAngular(); } else if (newType === 'TEXT') { $scope.renderText();