Skip to content

Commit 212260b

Browse files
authored
Merge pull request #27 from mcornella/mixed-improvements
Mixed improvements on server and client
2 parents bdb0b48 + c5a04f3 commit 212260b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"homepage": "https://github.com/debugger22/github-audio#readme",
2424
"dependencies": {
2525
"chalk": "^1.1.3",
26+
"cross-env": "^3.1.2",
2627
"express": "^4.14.0",
2728
"helmet": "^2.2.0",
2829
"ip": "^1.1.3",

server/index.js

Lines changed: 9 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,9 +131,11 @@ 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'){
138+
if (data.payload.pull_request.merged) data.payload.action = 'merged';
136139
stripedData.push({
137140
'id': data.id,
138141
'type': data.type,
@@ -142,7 +145,8 @@ function stripData(data){
142145
'repo_name': data.repo.name,
143146
'action': data.payload.action, // opened, reopened, closed, merged
144147
'message': data.payload.pull_request.title,
145-
'created': data.created_at
148+
'created': data.created_at,
149+
'url': data.payload.pull_request.html_url
146150
});
147151
}else if(data.type == 'IssuesEvent'){
148152
stripedData.push({
@@ -154,7 +158,8 @@ function stripData(data){
154158
'repo_name': data.repo.name,
155159
'action': data.payload.action, // opened, reopened, closed
156160
'message': data.payload.issue.title,
157-
'created': data.created_at
161+
'created': data.created_at,
162+
'url': data.payload.issue.html_url
158163
});
159164
}
160165
});

0 commit comments

Comments
 (0)