GitHub user FRosner reopened a pull request:

    https://github.com/apache/zeppelin/pull/2120

    [ZEPPELIN-1492] fixing the issue where updating a paragraph was not 
propagated correctly

    ### What is this PR for?
    
    This pull request fixes two issues regarding paragraphs not being updated 
and therefore overwritten unintentionally. The first issue yields to local 
changes being overwritten when remote changes are made. The second issue yields 
to changes being overwritten when, e.g., the notebook is renamed.
    
    The first change happens in the `updateParagraph` broadcast event handler 
function. This function has the purpose to update the local state of the 
paragraph in the paragraph controller scope when there is an update from the 
web socket.
    
    However, it did not update the state if the only thing that has changed was 
the text. Now it will, which fixes the original issue in the issue description. 
This was one of the issues identified by 
https://issues.apache.org/jira/browse/ZEPPELIN-1492?focusedCommentId=15744928&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15744928
    
    The second issue is fixed by saving the paragraph when the editor loses 
focus.
    
    ### What type of PR is it?
    
    Bug Fix
    
    ### What is the Jira issue?
    
    - https://issues.apache.org/jira/browse/ZEPPELIN-1492
    
    ### How should this be tested?
    
    The first issue can be reproduced with the following two browser-windows 
and a single notebook.
    
    Browser A:
    
    ```
    %pyspark
    print "Original Zeppelin Notebook"
    ```
    
    In Browser B, edit the notebook and the above command to:
    
    ```
    %pyspark
    print "Notebook is updated...."
    ```
    
    If I run the notebook via browser A followed by Browser B, everything is 
updated nicely. Now also if I you add the following line to the Notebook though 
Browser B:
    
    ```
    print "....once again"
    ```
    
    and run the notebook through Browser B again, the content in Browser A will 
be updated.
    
    The second issue can be reproduced by editing a cell without executing it 
and renaming the notebook right afterwards. The rename will reset your cell to 
the previous state. With the fix, your state is saved.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/FRosner/zeppelin ZEPPELIN-1492

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2120.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2120
    
----
commit f9ca8c4fe77f0f43de62e10d42912d50a8542009
Author: Frank Rosner <fr...@fam-rosner.de>
Date:   2017-03-10T12:38:06Z

    ZEPPELIN-1492 also update paragraph if the text has changed

commit 88125e3401c0b90d049f6ac224aec12bef29d85d
Author: Frank Rosner <fr...@fam-rosner.de>
Date:   2017-03-10T14:22:12Z

    ZEPPELIN-1492 newPara is already a paragraph I guess :S

commit 62f032259505bacfb23c949f33829bdfa7caa945
Author: Frank Rosner <fr...@fam-rosner.de>
Date:   2017-03-10T15:33:08Z

    empty commit to trigger build

commit 34c8174725b694bd06390e1a8e4b55af7fc2e762
Author: Frank Rosner <fr...@fam-rosner.de>
Date:   2017-03-13T10:32:08Z

    ZEPPELIN-1492 save paragraph on editor blur

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to