Skip to content

ZEPPELIN-385 Read-only mode for zeppelin notebooks, for analysis sharing - #389

Closed
babokim wants to merge 1 commit into
apache:masterfrom
babokim:readonly
Closed

ZEPPELIN-385 Read-only mode for zeppelin notebooks, for analysis sharing#389
babokim wants to merge 1 commit into
apache:masterfrom
babokim:readonly

Conversation

@babokim

Copy link
Copy Markdown

This PR is for read-only mode.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning?

@babokim
babokimforce-pushed the readonly branch 2 times, most recently from 7024ee2 to b3fd8d7CompareNovember 6, 2015 01:53
@r-kamath

Copy link
Copy Markdown
Member

@babokim Thanks for the update. Looks good to me.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this condition should be in runParagraph(...) too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xrixcis I think it is intended to make Zeppelin readonly(blocks notebook/paragraph CRUD), but let user still able to run.

@Xrixcis

Copy link
Copy Markdown

Hi, great feature, thanks!
One little bug I came across, isReadOnly function seems to be missing in paragraph.controller.js.

@babokim
babokimforce-pushed the readonly branch 3 times, most recently from 5e5f0b1 to 5c779c5CompareNovember 12, 2015 09:57

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting button in 'disabled' class doesn't look different much.
image

I think it's better hide the button.

@Leemoonsoo

Copy link
Copy Markdown
Member

Tested and working nicely.
Thanks @babokim for contributing really useful feature.

Looks good to me

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we avoid this style kind of *. Could you please change this to separate libraries?

@Leemoonsoo

Copy link
Copy Markdown
Member

Merging if there're no more discussions.

@jongyoul

Copy link
Copy Markdown
Member

@Leemoonsoo I think we should take a care of a style of import *. What do you think of it? This looks minor for now but it needs to keep it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate with Line 33

@corneadoug

Copy link
Copy Markdown
Contributor

I'm a bit late for the party,
However I would prefer the isReadOnly() part in zeppelin-web to be handled as a DataFactory instead of storing it in the $rootScope and copy pasting the same function in every controllers.

There is a good example here:
https://github.com/apache/incubator-zeppelin/blob/master/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js

And you can see it in action here:
https://github.com/apache/incubator-zeppelin/blob/master/zeppelin-web/src/components/navbar/navbar.controller.js

@babokim

Copy link
Copy Markdown
Author

@corneadoug Thank you for your advise. I tried storing system config values in a DataFactory. That way also has similar duplication. To set the data in that DataFactory after receiving from the Websocket, each controller should have receiver function like the following code. That function code also is duplicated in every controllers.

angular.module('zeppelinWebApp').factory('websocketEvents', function ( ... ) {
websocketCalls.ws.onMessage(function(event) {
...
} else if (op === 'GET_SYSTEM_CONF') {
$rootScope.$broadcast('setSystemConf', data.conf);
}
}
}
angular.module('zeppelinWebApp').controller('NotebookCtrl'..., function(...) {
$scope.$on('setSystemConf', function(event, systemConf {
systemConfigDataFactory.setSystemConf(systemConf);
});

If there is another way to set system config data, please let me know. Thanks.

@corneadoug

Copy link
Copy Markdown
Contributor

@babokim
That's not exactly how it should be used, the goal is to use it as a data storage.
Let's say you have a similar DataFactory as the one I gave in example:

angular.module('zeppelinWebApp').factory('systemConfDataFactory', function() {
var vm = {};
vm.conf = {};
vm.setSystemConf = function(systemConf) {
vm.conf = angular.copy(systemConf);
};
return vm;
});

Then you just have to call setSystemConf in your websocketEvents like this:

angular.module('zeppelinWebApp').factory('websocketEvents', function ( ..., systemConfDataFactory) {
websocketCalls.ws.onMessage(function(event) {
...
} else if (op === 'GET_SYSTEM_CONF') {
systemConfDataFactory.setSystemConf(data.conf);
}
}
}

And when you need to do some ng-if or ng-hide, you can do like this:
home.controller

 angular.module('zeppelinWebApp').controller('HomeCtrl', function(..., systemConfDataFactory) {
vm.systemConfDataFactory = systemConfDataFactory;

home.html


<h5 ng-hide="home.systemConfDataFactory.conf.readonly">
<a href="" data-toggle="modal" data-target="#noteNameModal" style="text-decoration: none;">
<i style="font-size: 15px;" class="icon-notebook"></i> Create new note</a>
</h5>

@babokim

Copy link
Copy Markdown
Author

@corneadoug Thank you for your kindness. I will try as your way.

@babokim
babokimforce-pushed the readonly branch 5 times, most recently from a5dd56e to 0037f80CompareNovember 26, 2015 00:38
@Leemoonsoo

Copy link
Copy Markdown
Member

@babokim Do you mind rebase or merge master to resolve the conflicts?

@rishitesh

Copy link
Copy Markdown

@babokim , Can you please merge this feature ?

@rishitesh

Copy link
Copy Markdown

Its really a useful feature for demo , where multiple users might try their hands.

@felixcheung

Copy link
Copy Markdown
Member

@babokim - would you be able to update this PR? It looks like the community would appreciate your contributor to make this possible ;)

@corneadoug

Copy link
Copy Markdown
Contributor

I can also make a PR to this one to fix the zeppelin-web part if you don't have the time

@dusenberrymw

Copy link
Copy Markdown

Agree with @rishitesh that this would be really great for live demos!

@felixcheung

Copy link
Copy Markdown
Member

@babokim haven't heard from you - would you be able to continue this work?

@FRosner

Copy link
Copy Markdown
Contributor

Thumbs up also from my side if we can resolve conflicts, finish discussions and merge if appropriate 👍

@nolangrace

Copy link
Copy Markdown

I would love to take advantage of this feature is there anything I can do help move this pull request forward?

@meniluca

Copy link
Copy Markdown
Contributor

Ditto! :) 👍

@corneadoug

Copy link
Copy Markdown
Contributor

@babokim
Going around old PRs,
Is it still needed considering the efforts for user authentication, and notebook acl restrictions?

@asfgitasfgit closed this in c38a0a0May 9, 2018
asfgit pushed a commit that referenced this pull request May 9, 2018
close#83close#86close#125close#133close#139close#146close#193close#203close#246close#262close#264close#273close#291close#299close#320close#347close#389close#413close#423close#543close#560close#658close#670close#728close#765close#777close#782close#783close#812close#822close#841close#843close#878close#884close#918close#989close#1076close#1135close#1187close#1231close#1304close#1316close#1361close#1385close#1390close#1414close#1422close#1425close#1447close#1458close#1466close#1485close#1492close#1495close#1497close#1536close#1545close#1561close#1577close#1600close#1603close#1678close#1695close#1739close#1748close#1765close#1767close#1776close#1783close#1799
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

12 participants

@babokim@r-kamath@Xrixcis@Leemoonsoo@jongyoul@corneadoug@rishitesh@felixcheung@dusenberrymw@FRosner@nolangrace@meniluca