Permalink
Browse files

Add URL field for each event

With this commit each event has a proper link directing to the actual
event, except PushEvents which direct to the repo since there isn't
any available link to the commits.
  • Loading branch information...
1 parent 5301419 commit c5a04f34de368dcfd4e881d11cd7c397721d457f @mcornella mcornella committed Oct 9, 2016
Showing with 9 additions and 5 deletions.
  1. +1 −1 app/public/js/main.js
  2. +8 −4 server/index.js
@@ -338,7 +338,7 @@ function drawEvent(data, svg_area) {
.remove();
var circle_container = circle_group.append('a');
- circle_container.attr('xlink:href', 'https://github.com/' + data.repo_name);
+ circle_container.attr('xlink:href', data.url);
circle_container.attr('target', '_blank');
circle_container.attr('fill', svg_text_color);
View
@@ -116,7 +116,8 @@ function stripData(data){
'repo_name': data.repo.name,
'payload_size': data.payload.size,
'message': data.payload.commits[0].message,
- 'created': data.created_at
+ 'created': data.created_at,
+ 'url': data.repo.url
});
pushEventCounter++;
}
@@ -130,7 +131,8 @@ function stripData(data){
'repo_name': data.repo.name,
'payload_size': 0,
'message': data.body,
- 'created': data.created_at
+ 'created': data.created_at,
+ 'url': data.payload.comment.html_url
});
}else if(data.type == 'PullRequestEvent'){
if (data.payload.pull_request.merged) data.payload.action = 'merged';
@@ -143,7 +145,8 @@ function stripData(data){
'repo_name': data.repo.name,
'action': data.payload.action, // opened, reopened, closed, merged
'message': data.payload.pull_request.title,
- 'created': data.created_at
+ 'created': data.created_at,
+ 'url': data.payload.pull_request.html_url
});
}else if(data.type == 'IssuesEvent'){
stripedData.push({
@@ -155,7 +158,8 @@ function stripData(data){
'repo_name': data.repo.name,
'action': data.payload.action, // opened, reopened, closed
'message': data.payload.issue.title,
- 'created': data.created_at
+ 'created': data.created_at,
+ 'url': data.payload.issue.html_url
});
}
});

0 comments on commit c5a04f3

Please sign in to comment.