-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1564] Enable note deletion and paragraph output clear from main page #1565
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
khalidhuseynov
left a comment
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.
@minahlee thanks for the improvement. as i can see from screenshot, clearing all paragraph output done on the list view. what do you think is more user friendly: doing it on list or inside of a note. any reasons for choice maybe.
| Note note = notebook.getNote(noteId); | ||
| if (note == null) { | ||
| return new JsonResponse(Status.NOT_FOUND, "note not found.").build(); | ||
| } |
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 wonder how we enforce note authorization values here, for example someone without owner/write privileges does a call via rest api.
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.
yeah, i think @khalidhuseynov is right here.
But after checking the code of notebookRestApi, there are no check here. we need to fix this...
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 checked notebookRestApi class and there are a lot of method which doesn't take care of privileges like getNote, getParagraph. I think it is better to create another PR to refactor notebookRestApi.
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.
@minahlee thats right, i created the issue ZEPPELIN-1586 i will create the PR soon
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.
@anthonycorbacho Thank you! @khalidhuseynov Let me update this PR to handle permission issue once ZEPPELIN-1586 is ready
|
@khalidhuseynov Thank you for review. I made "clear paragraph output" in main page for the case that note's output data is too big so it causes Zeppelin fail to load note and hang. The more optimal solution would be improving data loading and rendering itself. We might not need "clear paragraph output" button once we improve this performance issue. I believe having delete button on the main page is beneficial in terms of UX in case user wants to delete multiple notes. They won't need to navigate into each note to delete them. I am planning to implement remove folder & edit folder name in main page after this PR is merged. |
|
Hi @minahlee :) This is a cool feature! I have an experience that deleted output through editing note.json because of huge output stopping Zeppelin web. By the way, I've wanted a renaming folder feature. So as soon as I saw this PR, I implemented renaming note, and I am almost done with implementing renaming folder! (I saw you are planning this after coding, sorry 😢) This is a really good example for implementing it! So, the question is this: |
70eb294 to
7eb3521
Compare
|
Hi @tae-jun, thank you for your interest. I had to rebase this branch to resolve conflict so you will need too since it is based on mine. I am planning to finish this PR once #1567 merged so that I can handle permission issue. It will speed up merging process if you can review it (I am also going to review it as soon as all the tasks are done). About the jira, there is nothing stops you from creating one so feel free to create a ticket on Jira. And make sure that you assign your self on that task, and put |
|
Thanks @minahlee! I appreciate your kind comment 😄 I created a ticket on JIRA: ZEPPELIN-1598 But, I don't know how to set myself to assignee, and change status to I will check #1567. Thanks again! |
|
@tae-jun I just added your name to contributor list so you will be able to set yourself as assignee from now. |
|
@minahlee Awesome! I just changed status to |
|
Tested and LGTM |
|
@khalidhuseynov I updated rest api to do privilege check. Could you help review? |
|
@minahlee looks much better now! thanks for addressing the issue and LGTM |
|
@khalidhuseynov Thank you for quick response! |
docs/rest-api/rest-notebook.md
Outdated
| </tr> | ||
| <tr> | ||
| <td> Fail code</td> | ||
| <td> 500 </td> |
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.
shall we also add 404 (not found) and 401(unauthorised)? as a possible response
|
@minahlee I have a question about REST API style. Is there any purpose that you used In my opinion, And also maybe we can implement one paragraph output deletion in the future like: |
|
@tae-jun the reason I use What do you think? |
Update clear output rest api doc response code
56a6c44 to
1393ee9
Compare
|
@minahlee Oh, in that context, it makes sense. LGTM. But, after looking all around Notebook REST API, it works well now but it doesn't seem RESTful. I summarized current list of REST API:
A good REST API is API that doesn't need a documentation, which means users can understands only with HTTP method and URL. So, it should be simple. However, I think some of current API may need to be changed. REST API is UI for developers, so should be well designed. There are problems I can see now:
Zeppelin needs more REST API, so eventually, it will be getting bigger. I think it's time to organize REST APIs. After all of this, the REST API documentation should also be updated. Not by listing actions what you can, just by listing APIs. This is easier to read since users can know what they can do with resources. Would you mind if I open an issue for this? |
|
@tae-jun This is a great sum of the status of the rest api in zeppelin, and i think we all agree that currently zeppelin doenst follow rest standard (just by looking at the endpoint + response (mostly 500 ...)). But you have to consider that going on the path of refacto this logic will be a huge task, not only in backend but you need to understand that a lot of users are using this api already changing the hole api will brings a lot of breaking change in they current workflow. So we need to be careful here. |
|
@tae-jun thanks for summarizing and giving feedback on REST API. Although we can't address all at once as @anthonycorbacho mentioned, but I think it deserves an issue with above content and feedback logged in there |
|
@anthonycorbacho @khalidhuseynov Thanks for the comment! I agree with you guys. This is a breaking change, so yeah we must be careful. So, if we proceed this, new API URL's prefix will be I think we should design REST API together. I will create a proposal on JIRA soon, please review it when the time comes! It will be harder to fix later. So, let's start now! 😄 |
What is this PR for?
Next possible improvement can be removing notes in folder level and rename folder.
What type of PR is it?
Improvement
Todos
clearAllParagraphOutputrest api methodWhat is the Jira issue?
ZEPPELIN-1564
Screenshots (if appropriate)
Questions: