Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.7 9e6e65c4e -> ac3c5f40c


[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 <khalid...@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

(cherry picked from commit e7882b6db4752392329d5c26c5921fe7376f5b20)
Signed-off-by: Lee moon soo <m...@apache.org>


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

Branch: refs/heads/branch-0.7
Commit: ac3c5f40cd201ac2e93ccd4d7ce25f6be1e693d0
Parents: 9e6e65c
Author: Khalid Huseynov <khalid...@gmail.com>
Authored: Tue Apr 4 16:09:19 2017 +0900
Committer: Lee moon soo <m...@apache.org>
Committed: Wed Apr 5 04:35:13 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/ac3c5f40/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 9f27d7d..97d8335 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -141,11 +141,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/ac3c5f40/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);
   });
 });

Reply via email to