-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-209] Folder structure for notebook (based on pr-190) #767
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
Conversation
|
@corneadoug I've created a new pr here. Thanks for your review! |
|
@zhongneu thank you for taking a stab at bringing that feature to life again! 👍 for screenshots, but could you please also updated PR description a bit, explaining how exactly the hierarchy is formed? Like how to create a nested structure of notebooks, and if there are any changes in how notes are persisted. This, as well as screenshots, usually helps communicating the value of the feature and gauge people's the interest. Also please feel free to assign ZEPPELIN-209 to yourself, so it's not get lost on the release. |
|
\cc @felizbear for a reivew |
|
I didn't test it yet, but I also think it could be nice to have feedbacks from people who worked on some Notebook storages. (Git, S3 etc..) @vgmartinez @khalidhuseynov |
|
I think way it implements is just treating '/' in the notebook name as a directory separator in a front end side as described in ZEPPELIN-209. and it is not really related to the notebook storage. |
| }; | ||
|
|
||
| $scope.toggleFolderNode = function(node) { | ||
| node.hidden = node.hidden ? false : true; |
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.
node.hidden = !node.hidden
improves readability / understandability :)
|
Any thoughts about; showing folders first and then files ? |
|
|
||
| notes.setNotes = function(notesList) { | ||
| notes.list = angular.copy(notesList); | ||
| notes.flatList = angular.copy(notesList); // a flat list to boost searching |
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'm not convinced that representing a hierarchy with lists is such a good idea. Why not use objects instead? Then we can rely on lodash's set and get, like this:
// set notes
var notes = notesList.reduce(function(acc, note) {
var noteName = note.name || note.id;
var dirs = noteName.match(/([^\\\][^\/]|\\\/)+/g);
return _.set(
acc,
dirs.join("."),
{id: note.id}
)
}, {})
// get a note at "/C/CB/CBA"
_.get(notes, "C.CB.CBA")What do you think?
What is this PR for?
This PR is based on #190
What type of PR is it?
Feature
Todos
What is the Jira issue?
ZEPPELIN-209
How should this be tested?
Screenshots (if appropriate)
Questions:
NO
NO
NO?