Return-Path: X-Original-To: apmail-zeppelin-commits-archive@minotaur.apache.org Delivered-To: apmail-zeppelin-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 44DE518548 for ; Wed, 11 Nov 2015 13:03:23 +0000 (UTC) Received: (qmail 10260 invoked by uid 500); 11 Nov 2015 13:03:23 -0000 Delivered-To: apmail-zeppelin-commits-archive@zeppelin.apache.org Received: (qmail 10210 invoked by uid 500); 11 Nov 2015 13:03:23 -0000 Mailing-List: contact commits-help@zeppelin.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zeppelin.incubator.apache.org Delivered-To: mailing list commits@zeppelin.incubator.apache.org Received: (qmail 10201 invoked by uid 99); 11 Nov 2015 13:03:23 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2015 13:03:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A4338C0473 for ; Wed, 11 Nov 2015 13:03:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.771 X-Spam-Level: X-Spam-Status: No, score=0.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 9zMzhdprGSbZ for ; Wed, 11 Nov 2015 13:03:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id B7D3F439DA for ; Wed, 11 Nov 2015 13:03:11 +0000 (UTC) Received: (qmail 9761 invoked by uid 99); 11 Nov 2015 13:03:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2015 13:03:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0DEA1E0A23; Wed, 11 Nov 2015 13:03:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: moon@apache.org To: commits@zeppelin.incubator.apache.org Message-Id: <9b6f698e2d1c4e4782164746deb5fe06@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: =?utf-8?q?incubator-zeppelin_git_commit=3A_=5BZEPPELIN-309=5D_Redi?= =?utf-8?q?rect_to_created/cloned_notebook_page_on_notebook_c=E2=80=A6?= Date: Wed, 11 Nov 2015 13:03:10 +0000 (UTC) Repository: incubator-zeppelin Updated Branches: refs/heads/master fa40d567f -> 6aaafe1b4 [ZEPPELIN-309] Redirect to created/cloned notebook page on notebook c… …reation/clone This PR enables redirecting to new/cloned notebook pages when create/clone notebook event occurs. Author: Mina Lee Closes #309 from minahlee/ZEPPELIN-309 and squashes the following commits: 8611343 [Mina Lee] Update selenium test for opening new created notebook and fix indentation b307483 [Mina Lee] [ZEPPELIN-309] Redirect to created/cloned notebook page on notebook creation/clone Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/6aaafe1b Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/6aaafe1b Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/6aaafe1b Branch: refs/heads/master Commit: 6aaafe1b46296e85d1210bf14fc239eb4cdb1d2f Parents: fa40d56 Author: Mina Lee Authored: Mon Nov 9 20:00:51 2015 +0900 Committer: Lee moon soo Committed: Wed Nov 11 22:03:06 2015 +0900 ---------------------------------------------------------------------- .../apache/zeppelin/socket/NotebookServer.java | 2 + .../java/org/apache/zeppelin/ZeppelinIT.java | 39 ++++++-------------- .../noteName-create/notename.controller.js | 8 ++++ 3 files changed, 21 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/6aaafe1b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java index 644639f..a7a0f4d 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java @@ -397,6 +397,7 @@ public class NotebookServer extends WebSocketServlet implements } note.persist(); + addConnectionToNote(note.id(), (NotebookSocket) conn); broadcastNote(note); broadcastNoteList(); } @@ -440,6 +441,7 @@ public class NotebookServer extends WebSocketServlet implements String noteId = getOpenNoteId(conn); String name = (String) fromMessage.get("name"); Note newNote = notebook.cloneNote(noteId, name); + addConnectionToNote(newNote.id(), (NotebookSocket) conn); broadcastNote(newNote); broadcastNoteList(); } http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/6aaafe1b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java index 215d3de..dc188f8 100644 --- a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java @@ -165,17 +165,15 @@ public class ZeppelinIT { } } - @Test + @Test public void testAngularDisplay() throws InterruptedException{ if (!endToEndTestEnabled()) { return; } + createNewNote(); - String noteName = createNewNoteAndGetName(); - driver.findElement(By.partialLinkText(noteName)).click(); - - // wait for first paragraph's " READY " status text - waitForParagraph(1, "READY"); + // wait for first paragraph's " READY " status text + waitForParagraph(1, "READY"); /* * print angular template @@ -293,7 +291,7 @@ public class ZeppelinIT { System.out.println("testCreateNotebook Test executed"); } - private String createNewNoteAndGetName() { + private void createNewNote() { List notebookLinks = driver.findElements(By .xpath("//div[contains(@class, \"col-md-4\")]/div/ul/li")); List notebookTitles = new LinkedList(); @@ -301,32 +299,17 @@ public class ZeppelinIT { notebookTitles.add(el.getText()); } - WebElement createNoteLink = driver.findElement(By.xpath("//div[contains(@class, \"col-md-4\")]/div/h5/a")); - createNoteLink.click(); + WebElement createNoteLink = driver.findElement(By.xpath("//div[contains(@class, \"col-md-4\")]/div/h5/a")); + createNoteLink.click(); - WebDriverWait block = new WebDriverWait(driver, 10); - WebElement modal = block.until(ExpectedConditions.visibilityOfElementLocated(By.id("noteNameModal"))); - WebElement createNoteButton = modal.findElement(By.id("createNoteButton")); - createNoteButton.click(); + WebDriverWait block = new WebDriverWait(driver, 10); + WebElement modal = block.until(ExpectedConditions.visibilityOfElementLocated(By.id("noteNameModal"))); + WebElement createNoteButton = modal.findElement(By.id("createNoteButton")); + createNoteButton.click(); try { Thread.sleep(500); // wait for notebook list updated } catch (InterruptedException e) { } - - List notebookLinksAfterCreate = driver.findElements(By - .xpath("//div[contains(@class, \"col-md-4\")]/div/ul/li")); - - Iterator it = notebookLinksAfterCreate.iterator(); - while (it.hasNext()) { - WebElement newEl = it.next(); - if (notebookTitles.contains(newEl.getText())) { - - it.remove(); - } - } - - assertEquals(1, notebookLinksAfterCreate.size()); - return notebookLinksAfterCreate.get(0).getText(); } } http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/6aaafe1b/zeppelin-web/src/components/noteName-create/notename.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/components/noteName-create/notename.controller.js b/zeppelin-web/src/components/noteName-create/notename.controller.js index 342cad7..a81ffba 100644 --- a/zeppelin-web/src/components/noteName-create/notename.controller.js +++ b/zeppelin-web/src/components/noteName-create/notename.controller.js @@ -26,6 +26,14 @@ angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, $ro vm.websocketMsgSrv.cloneNotebook(noteId, $scope.note.notename); } }; + + $scope.$on('setNoteContent', function(event, note) { + if(note !== undefined) { + window.location = '#/notebook/' + note.id; + console.log(note); + } + }); + vm.preVisible = function(clone){ var generatedName = vm.generateName(); $scope.note.notename = 'Note ' + generatedName;