Skip to content

Commit

Permalink
Add URL field for each event
Browse files Browse the repository at this point in the history
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
mcornella committed Oct 21, 2016
1 parent 5301419 commit c5a04f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 8 additions & 4 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand All @@ -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';
Expand All @@ -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({
Expand All @@ -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
});
}
});
Expand Down

0 comments on commit c5a04f3

Please sign in to comment.