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
[website] Add GitHub contributor activity page #24
Conversation
If XYZ comments on a PR, is it possible to directly jump to that comment or issue/pull request ? |
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.
Great work! 👍
I like it. I really want to improve it so we can use it, there's some work that needs to be done before we get there.
See my comments and questions below.
- move the JS logic to a separate file
- try to have a single function that can be called to create the feed
PullRequestReviewCommentEvent
is missing but those kind of events are important- it's important to show convert the markdown formatting otherwise comments are not readable, use a markdown tool, maybe this one can work: https://github.com/showdownjs/showdown
- we should convert URLs to links with regular expression, we can do this as a last step, try to google existing solutions to this problem (it's a common problem)
activity.html
Outdated
<script src="js/scripts.js"></script> | ||
<script> | ||
function createEvent(avatar, name, event, repo, header, content, date) { | ||
if (!event) |
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.
in which case event
is falsy?
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.
Event
can be false because I am passing it to the function as a parameter, and it's the string representation of that event. For example, event
could be "created a new issue in". It's there because unhandled events would be empty strings and I didn't want to create a new message in the feed for it.
Thanks for reviewing, will work on it now. |
@atb00ker Just added it, the title in the message box is a link to the corresponding comment or PR. @nemesisdesign
|
Is the github script used on all pages? I think it's better to separate it from |
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.
definitely do not add it to scripts.js
but to a new file please
Moved the logic over to |
Demo is also updated with the current changes: http://openwisp-website.surge.sh/activity.html |
Simple URLs are currently being matched based on the protocol (http:// and https://) and they get converted to clickable links. If needed, I can change it to match based on TLD or other aspects of the URL. |
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.
@dwang ok let's not worry too much about so many details now, you did great work. Please resolve the outstanding issues, I will create another GCI task for improving this feature.
@nemesisdesign My editor has been updated and the issues have been resolved. Anything else I should take care of? Thanks! |
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.
Please fix the errors in the travis build regarding jshint.
I had to make some changes, please check the changes I made and let me know if you have any questions, keep in mind to:
- avoid duplicating code from
scripts.js
- don't use javascript ES6 syntax unless a transpiler is used (here we don't use it)
PS: you can squash the commits when ready |
Got it, working on it right now. |
A new page is added to display the events that each contributor triggers (stars, pull requests, comments, etc). The page is populated using data from the GitHub API and jQuery to parse the JSON. The feed uses Semantic UI to visualize the data.
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.
Great work Daniel 👍
Some more work is needed to refine it before we can publish it, but I will create a new issue for that, the first step is done 😊
🎉
A new page is added to display the events that each contributor triggers (stars, pull requests, comments, etc).
The page is populated using data from the GitHub API and jQuery to parse the JSON.
Preview can be seen at: openwisp-website.surge.sh/activity.html
Alternatively, here is an image: