Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Leave comments on someone elses pages #47 #261
These page contains details for the implementation of the comments section for BookStack. Issue is here.
Functionality to implement
The database schema will be a simple tree based schema.
Reviewed various tree based schema's structure for SQL described here http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
After analyzing the various schema structures, I've finally decided to go ahead with the Adjacency List based on its simplicity. Following will be the schema structure -
Breaking down the whole thing into smaller tasks,
@ssddanbrown - Please do not merge this, I'll let you know when this is ready to be merged.
When the page loads, we'll make an AJAX call to load the 30 most recent parent comments.
Fetching the child comments
On page load the child comments will not be fetched, click on Show replies at the bottom of the parent comment will make another AJAX call to load the replies, which will also be loaded 30 at a time.
Only single levels of depth are allowed in the commenting architecture.
A enabled delete icon will be presented to the user to delete the comment. A user can only delete comments if he is the owner or an administrator. Deleting will not wipe out the entire comment, but will simply empty the content in the database.
Editing will transform the comment being editing into a simple markdown editor that can then be used to update the comment.
Replying to a comment will open a editor right below the comment to which you are replying.
A new thread can be started by adding a comment to a editor at the bottom of the comment section.
@ssddanbrown - Sorry for the lack of update on this. I've started working on this again recently.
For the comment box, I'm using https://simplemde.com/
Its a basic markdown editor, that looks and functions a lot like the Github markdown editor. Its MIT Licensed
Do you have any concerns? Would you like me to use a different editor?
Hi @Abijeet, Thanks for your continued work on this.
My concerns with SimpleMDE are that it's fairly chunky in the amount of code it brings in for a fairly simple use case such as this. I was thinking that a normal old textarea would be fine for something like this, At least initially until we get a feel for how it's used. Keeping the input simple prevents people getting to fancy in the comments and keeps them secondary to page content.
Let me know if you disagree with this though or if there's any technical reasons a more featureful editor would be better.
There shouldn't be any technical issues with using a simple textarea since this is simply a directive that I'll be replacing. I don't have strong opinions about the type of editor. I'm fairly pro-efficient with Markdown and a simple text area with Markdown support is sufficient for me. People will either pick up Markdown or write simple comments. I'll enable spellchecker for this as well. Thanks.…
On Fri, Apr 28, 2017 at 3:33 AM, Dan Brown ***@***.***> wrote: Hi @Abijeet <https://github.com/Abijeet>, Thanks for your continued work on this. My concerns with SimpleMDE are that it's fairly chunky in the amount of code it brings in for a fairly simple use case such as this. I was thinking that a normal old textarea would be fine for something like this, At least initially until we get a feel for how it's used. Keeping the input simple prevents people getting to fancy in the comments and keeps them secondary to page content. Let me know if you disagree with this though or if there's any technical reasons a more featureful editor would be better. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#261 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABm4DZTO-dK_hrR0lo_lvxE0iI7aE0ugks5r0RC9gaJpZM4LYr-x> .
@ssddanbrown - Can you please review the code and merge it when you get a chance?
I've completed everything mentioned in the checklist above other than the test data generator. I'll need some help with that as I'm unable to find that code. Basically I'd like to add comments on the demo website.
After the merge I'll also update any documentation that needs updating.
changed the title from
[WIP] Leave comments on someone elses pages #47
Leave comments on someone elses pages #47
Jun 12, 2017
Hi @Abijeet, Thanks again for the above work, For an initial quick look over the code it looks great. Unfortunately I've had limited time recently, Due to moving home and some health issues, so I haven't had a deeper dive into this yet.
The next BookStack release, V0.17, is going to be a cleanup of code display/inputs, which is what I've been slowly working on recently but I've marked this commenting system as being the main feature of the release after that (v0.18). Once v0.17 is out I'll put all my focus on reviewing and merging your work here.
I'll merge this into master now. Before merging I'm going to combine the two required database migrations into one and rename it to be the latest to ensure a smooth upgrade for all users. This may break any instances you've developed this comments system on.
I've only lightly skimmed the rest of the code but I'll go through it in detail soon. Before v0.18 is released I'll probably rewrite any angular components here in Vue as I plan to migrate everything else to Vue soon. I also plan on doing some design changes across BookStack for v0.18 so some styling of this system may change.
In regards to setting up the demo data for demo.bookstackapp.com, That's simply done by me manually before taking a database dump so don't worry about having to code that in at all.
Once again, Thank you for your work here.
@ssddanbrown - There is a lot of AngularJS code here that'll have to be migrated to VueJS. I'll see if I can help you with that. I've wanted to work with VueJS for some time now, this will give me the opportunity to do so.
Other than the code there are a couple of things I think we should do, please feel free to add your thoughts,
Yeah, That's fine, Once this is in release I'll go through a few of the pages and add comments before snapshotting demo data.
Yeah, I agree. In general the features info needs an update as I have not touched that in over a year.
In regards to vue, All vue-based js can be found in the vue folder. Vue logic is put in it's own file then registered in the vues.js file. This system looks for elements of ID's based on that registration then, If a matching element is found, a new Vue instance is created.