New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZEPPELIN-1745] View revisions in non-editable mode #1775
Conversation
@khalidhuseynov Is it WIP? Then please feel free to add WIP in PR title and ping back, when it's ready for reviews. Otherwise, as for any GUI changes, it would be nice to have screenshots and some docs. |
@bzz it's ready now, also /cc @cloverhearts @1ambda to help review |
Glad to help reviewing this PR :) |
good feature! |
For other reviewers
|
@1ambda actually i've tried to reproduce ZEPPELIN-1737 and even with git 2.11.0 wasn't able to do it. also from documentation here only from 2.11.0 |
FYI - you can install 2.11.0 using brew. @khalidhuseynov is right, that should be handled in the separate issue. Let's talk about it on ZEPPELIN-1737. |
Works well as described. Here are few things to consider.
Thanks for implementing great feature. |
@1ambda thanks for review. answers in order:
yeah that's good point, do you have something in mind regarding it? i was thinking whether it should be more of a mode switch (say different mode added in addition to report mode, etc) or just represent visually (say gray out editor background like when running note), or something else.
thanks for testing, addressed under 50e1472. please check it out.
actually we have issue regarding this one to have |
50e1472
to
e9d3ceb
Compare
normally it should be done on change of .revisionView however at that time editor isn't loaded yet
@@ -23,17 +23,17 @@ | |||
</span> | |||
|
|||
<!-- Run / Cancel button --> | |||
<span class="icon-control-play" style="cursor:pointer;color:#3071A9" tooltip-placement="top" tooltip="Run this paragraph (Shift+Enter)" | |||
<span ng-if="!revisionView" class="icon-control-play" style="cursor:pointer;color:#3071A9" tooltip-placement="top" tooltip="Run this paragraph (Shift+Enter)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think iterate condition case to group is better.
<span ng-if="!revisionView" class="icon-control-play" style="cursor:pointer;color:#3071A9" tooltip-placement="top" tooltip="Run this paragraph (Shift+Enter)"
ng-click="runParagraph(getEditorValue())"
ng-show="paragraph.status!='RUNNING' && paragraph.status!='PENDING' && paragraph.config.enabled"></span>
<span ng-if="!revisionView" class="icon-control-pause" style="cursor:pointer;color:#CD5C5C" tooltip-placement="top" tooltip="Cancel"
ng-click="cancelParagraph(paragraph)"
ng-show="paragraph.status=='RUNNING' || paragraph.status=='PENDING'"></span>
<span ng-if="!revisionView" class="{{paragraph.config.editorHide ? 'icon-size-fullscreen' : 'icon-size-actual'}}" style="cursor:pointer;" tooltip-placement="top" tooltip="{{(paragraph.config.editorHide ? 'Show' : 'Hide') + ' editor'}}"
ng-click="toggleEditor(paragraph)"></span>
<span ng-if="!revisionView" class="{{paragraph.config.tableHide ? 'icon-notebook' : 'icon-book-open'}}" style="cursor:pointer;" tooltip-placement="top" tooltip="{{(paragraph.config.tableHide ? 'Show' : 'Hide') + ' output'}}"
ng-click="toggleOutput(paragraph)"></span>
<span ng-if="!revisionView" class="dropdown navbar-right">
better
<span ng-if="!revisionView">
<span class="icon-control-play" style="cursor:pointer;color:#3071A9" tooltip-placement="top" tooltip="Run this paragraph (Shift+Enter)"
ng-click="runParagraph(getEditorValue())"
ng-show="paragraph.status!='RUNNING' && paragraph.status!='PENDING' && paragraph.config.enabled"></span>
<span class="icon-control-pause" style="cursor:pointer;color:#CD5C5C" tooltip-placement="top" tooltip="Cancel"
ng-click="cancelParagraph(paragraph)"
ng-show="paragraph.status=='RUNNING' || paragraph.status=='PENDING'"></span>
<span class="{{paragraph.config.editorHide ? 'icon-size-fullscreen' : 'icon-size-actual'}}" style="cursor:pointer;" tooltip-placement="top" tooltip="{{(paragraph.config.editorHide ? 'Show' : 'Hide') + ' editor'}}"
ng-click="toggleEditor(paragraph)"></span>
<span class="{{paragraph.config.tableHide ? 'icon-notebook' : 'icon-book-open'}}" style="cursor:pointer;" tooltip-placement="top" tooltip="{{(paragraph.config.tableHide ? 'Show' : 'Hide') + ' output'}}"
ng-click="toggleOutput(paragraph)"></span>
<span class="dropdown navbar-right">
}; | ||
|
||
$scope.$watch($scope.getEditor, function(newValue, oldValue) { | ||
if (newValue === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newvalue
Sometimes value is undefined.
In js, both undefined and null should be checked.
So I think this is better.
` If (newvalue) // check to undefined and null
`
d3fface
to
06e2977
Compare
was failing to build, problem with removing console messages for prod
@Leemoonsoo @cloverhearts @1ambda thanks for the review! I addressed all your comments and updated the screenshot above. Please check it out and let me know what you think. Also CI logs seems to be failing only in selenium profile with flaky test from ZEPPELIN-1836. |
@khalidhuseynov How about disable "Interpreter binding" & "Note permission" buttons as well? Currently I can change the bound interpreters and note permission for the readonly-mode note. |
@AhyoungRyu actually i thought about it and couldn't find a reason why not let user change "Interpreter bindings" and "Note permissions" even in read-only mode, since they're still not able to run or edit. Do you think it's not common sense and confusing? Let me know what you think and we can change that easily. I wasn't also sure about it |
Yes you're right. I just thought it's not common sense as you told. Even though the user can't run or edit anyway, but he can do sth in interpreter binding page and note permission setting page. That's why I suggested to block those features by disabling the icon buttons. |
@AhyoungRyu I think it makes sense and addressed your feedback. please check it out and let me know if it's fine. |
@khalidhuseynov Thanks for your consideration! Tested again and it works well as we said :)
|
@AhyoungRyu thanks for review, it wasn't intended behaviour actually, fixed in bbaf286 |
Tested again and now I can see the text in the looknfeel dropdown menu of non-editable mode note. LGTM |
2672162
to
1439da3
Compare
6b8e1f6
to
59a92ea
Compare
merged master and finally CI is green. @Leemoonsoo ready for final check |
Tested and LGTM. Thanks @khalidhuseynov for the improvement. |
What is this PR for?
This is to make view of revisions non-editable
What type of PR is it?
Improvement
Todos
What is the Jira issue?
ZEPPELIN-1745
How should this be tested?
GitNotebookRepo
by addingin your
conf/zeppelin-env.sh
2. go to any note and create few revisions using commit menu
3. then switch between revisions, during which you shouldn't be able to modify note
Screenshots (if appropriate)
Questions: