Skip to content

Commit c5a04f3

Browse files
committed
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.
1 parent 5301419 commit c5a04f3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

app/public/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function drawEvent(data, svg_area) {
338338
.remove();
339339

340340
var circle_container = circle_group.append('a');
341-
circle_container.attr('xlink:href', 'https://github.com/' + data.repo_name);
341+
circle_container.attr('xlink:href', data.url);
342342
circle_container.attr('target', '_blank');
343343
circle_container.attr('fill', svg_text_color);
344344

server/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ function stripData(data){
116116
'repo_name': data.repo.name,
117117
'payload_size': data.payload.size,
118118
'message': data.payload.commits[0].message,
119-
'created': data.created_at
119+
'created': data.created_at,
120+
'url': data.repo.url
120121
});
121122
pushEventCounter++;
122123
}
@@ -130,7 +131,8 @@ function stripData(data){
130131
'repo_name': data.repo.name,
131132
'payload_size': 0,
132133
'message': data.body,
133-
'created': data.created_at
134+
'created': data.created_at,
135+
'url': data.payload.comment.html_url
134136
});
135137
}else if(data.type == 'PullRequestEvent'){
136138
if (data.payload.pull_request.merged) data.payload.action = 'merged';
@@ -143,7 +145,8 @@ function stripData(data){
143145
'repo_name': data.repo.name,
144146
'action': data.payload.action, // opened, reopened, closed, merged
145147
'message': data.payload.pull_request.title,
146-
'created': data.created_at
148+
'created': data.created_at,
149+
'url': data.payload.pull_request.html_url
147150
});
148151
}else if(data.type == 'IssuesEvent'){
149152
stripedData.push({
@@ -155,7 +158,8 @@ function stripData(data){
155158
'repo_name': data.repo.name,
156159
'action': data.payload.action, // opened, reopened, closed
157160
'message': data.payload.issue.title,
158-
'created': data.created_at
161+
'created': data.created_at,
162+
'url': data.payload.issue.html_url
159163
});
160164
}
161165
});

0 commit comments

Comments
 (0)