mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Address review comments
Signed-off-by: karuppayya <karuppayya1990@gmail.com>
This commit is contained in:
parent
4cd9dcd36a
commit
bbdfc9a70d
3 changed files with 18 additions and 20 deletions
|
|
@ -577,9 +577,9 @@ public class NotebookServer extends WebSocketServlet implements
|
|||
int paraIndex = note.getParagraphs().indexOf(para);
|
||||
broadcast(
|
||||
note.getId(),
|
||||
new Message(OP.UPDATE_NOTE).put("operation", "addParagraph")
|
||||
.put("paragraph", para)
|
||||
.put("index", paraIndex));
|
||||
new Message(OP.PARAGRAPH_ADDED)
|
||||
.put("paragraph", para)
|
||||
.put("index", paraIndex));
|
||||
}
|
||||
|
||||
public void broadcastNoteList(AuthenticationInfo subject, HashSet userAndRoles) {
|
||||
|
|
@ -729,8 +729,7 @@ public class NotebookServer extends WebSocketServlet implements
|
|||
|
||||
AuthenticationInfo subject = new AuthenticationInfo(fromMessage.principal);
|
||||
note.persist(subject);
|
||||
broadcast(note.getId(), new Message(OP.UPDATE_NOTE)
|
||||
.put("operation", "updateNote")
|
||||
broadcast(note.getId(), new Message(OP.NOTE_UPDATED)
|
||||
.put("name", name)
|
||||
.put("config", config)
|
||||
.put("info", note.getInfo()));
|
||||
|
|
@ -951,8 +950,7 @@ public class NotebookServer extends WebSocketServlet implements
|
|||
Paragraph para = note.removeParagraph(subject.getUser(), paragraphId);
|
||||
note.persist(subject);
|
||||
if (para != null) {
|
||||
broadcast(note.getId(), new Message(OP.UPDATE_NOTE).
|
||||
put("operation", "removeParagraph").
|
||||
broadcast(note.getId(), new Message(OP.PARAGRAPH_REMOVED).
|
||||
put("id", para.getId()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1259,8 +1257,7 @@ public class NotebookServer extends WebSocketServlet implements
|
|||
|
||||
note.moveParagraph(paragraphId, newIndex);
|
||||
note.persist(subject);
|
||||
broadcast(note.getId(), new Message(OP.UPDATE_NOTE)
|
||||
.put("operation", "moveParagraph")
|
||||
broadcast(note.getId(), new Message(OP.PARAGRAPH_MOVED)
|
||||
.put("id", paragraphId)
|
||||
.put("index", newIndex));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,16 +140,14 @@
|
|||
$rootScope.$broadcast('configurationsInfo', data);
|
||||
} else if (op === 'INTERPRETER_SETTINGS') {
|
||||
$rootScope.$broadcast('interpreterSettings', data);
|
||||
} else if (op === 'UPDATE_NOTE') {
|
||||
if (data.operation === 'addParagraph') {
|
||||
$rootScope.$broadcast('addParagraph', data.paragraph, data.index);
|
||||
} else if (data.operation === 'removeParagraph') {
|
||||
$rootScope.$broadcast('removeParagraph', data.id);
|
||||
} else if (data.operation === 'moveParagraph') {
|
||||
$rootScope.$broadcast('moveParagraph', data.id, data.index);
|
||||
} else if (data.operation === 'updateNote') {
|
||||
$rootScope.$broadcast('updateNote', data.name, data.config, data.info);
|
||||
}
|
||||
} else if (op === 'PARAGRAPH_ADDED') {
|
||||
$rootScope.$broadcast('addParagraph', data.paragraph, data.index);
|
||||
} else if (op === 'PARAGRAPH_REMOVED') {
|
||||
$rootScope.$broadcast('removeParagraph', data.id);
|
||||
} else if (op === 'PARAGRAPH_MOVED') {
|
||||
$rootScope.$broadcast('moveParagraph', data.id, data.index);
|
||||
} else if (op === 'NOTE_UPDATED') {
|
||||
$rootScope.$broadcast('updateNote', data.name, data.config, data.info);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,10 @@ public class Message {
|
|||
INTERPRETER_SETTINGS, // [s-c] interpreter settings
|
||||
ERROR_INFO, // [s-c] error information to be sent
|
||||
WATCHER, // [s-c] Change websocket to watcher mode.
|
||||
UPDATE_NOTE
|
||||
PARAGRAPH_ADDED, // [s-c] paragraph is added
|
||||
PARAGRAPH_REMOVED, // [s-c] paragraph deleted
|
||||
PARAGRAPH_MOVED, // [s-c] paragraph moved
|
||||
NOTE_UPDATED // [s-c] paragraph updated(name, config)
|
||||
}
|
||||
|
||||
public static final Message EMPTY = new Message(null);
|
||||
|
|
|
|||
Loading…
Reference in a new issue