You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2017/04/04 19:35:06 UTC

zeppelin git commit: [ZEPPELIN-2336] Fix note reload on another note create/rename/remove

Repository: zeppelin
Updated Branches:
  refs/heads/master c87fa53a3 -> e7882b6db


[ZEPPELIN-2336] Fix note reload on another note create/rename/remove

### What is this PR for?
This is to fix the issue with repeated note reload when some other note is created/renamed/removed

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

### Todos
* [x] - don't initialise controller on note list update

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

### How should this be tested?
Described in [ZEPPELIN-2336](https://issues.apache.org/jira/browse/ZEPPELIN-2336),
also additional test from [ZEPPELIN-1145](https://issues.apache.org/jira/browse/ZEPPELIN-1145) would be nice

### Screenshots (if appropriate)

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

Author: Khalid Huseynov <kh...@gmail.com>

Closes #2216 from khalidhuseynov/fix/ZEPPELIN-2336 and squashes the following commits:

7454336 [Khalid Huseynov] fix js test
e53edc0 [Khalid Huseynov] remove init controller on note_info


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

Branch: refs/heads/master
Commit: e7882b6db4752392329d5c26c5921fe7376f5b20
Parents: c87fa53
Author: Khalid Huseynov <kh...@gmail.com>
Authored: Tue Apr 4 16:09:19 2017 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Wed Apr 5 04:35:01 2017 +0900

----------------------------------------------------------------------
 zeppelin-web/src/app/notebook/notebook.controller.js      | 5 -----
 zeppelin-web/src/app/notebook/notebook.controller.test.js | 8 ++++----
 2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e7882b6d/zeppelin-web/src/app/notebook/notebook.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js
index 7846725..5fde0f4 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -128,11 +128,6 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
 
   initNotebook();
 
-  // force notebook reload on user change
-  $scope.$on('setNoteMenu', function(event, note) {
-    initNotebook();
-  });
-
   $scope.focusParagraphOnClick = function(clickEvent) {
     if (!$scope.note) {
       return;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e7882b6d/zeppelin-web/src/app/notebook/notebook.controller.test.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.test.js b/zeppelin-web/src/app/notebook/notebook.controller.test.js
index df90c81..6df6893 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.test.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.test.js
@@ -126,14 +126,14 @@ describe('Controller: NotebookCtrl', function() {
     spyOn(websocketMsgSrvMock, 'listRevisionHistory');
 
     scope.$broadcast('setNoteMenu');
-    expect(websocketMsgSrvMock.getNote.calls.count()).toEqual(1);
-    expect(websocketMsgSrvMock.listRevisionHistory.calls.count()).toEqual(1);
+    expect(websocketMsgSrvMock.getNote.calls.count()).toEqual(0);
+    expect(websocketMsgSrvMock.listRevisionHistory.calls.count()).toEqual(0);
 
     websocketMsgSrvMock.getNote.calls.reset();
     websocketMsgSrvMock.listRevisionHistory.calls.reset();
 
     scope.$broadcast('setNoteMenu');
-    expect(websocketMsgSrvMock.getNote.calls.count()).toEqual(1);
-    expect(websocketMsgSrvMock.listRevisionHistory.calls.count()).toEqual(1);
+    expect(websocketMsgSrvMock.getNote.calls.count()).toEqual(0);
+    expect(websocketMsgSrvMock.listRevisionHistory.calls.count()).toEqual(0);
   });
 });