@@ -148,15 +148,13 @@ function allIncluded(outputTarget = 'email') {
148
148
}
149
149
// fetch github data
150
150
function fetchGithubData ( ) {
151
- console . log ( "Starting GitHub data fetch..." ) ;
152
151
var issueUrl = 'https://api.github.com/search/issues?q=author%3A' +
153
152
githubUsername +
154
153
'+org%3Afossasia+created%3A' +
155
154
startingDate +
156
155
'..' +
157
156
endingDate +
158
157
'&per_page=100' ;
159
- console . log ( "Fetching issues from:" , issueUrl ) ;
160
158
161
159
$ . ajax ( {
162
160
dataType : 'json' ,
@@ -170,7 +168,6 @@ function allIncluded(outputTarget = 'email') {
170
168
} ) ;
171
169
} ,
172
170
success : ( data ) => {
173
- console . log ( "Received GitHub issues data:" , data ) ;
174
171
githubIssuesData = data ;
175
172
writeGithubIssuesPrs ( ) ;
176
173
} ,
@@ -184,7 +181,6 @@ function allIncluded(outputTarget = 'email') {
184
181
'..' +
185
182
endingDate +
186
183
'&per_page=100' ;
187
- console . log ( "Fetching PR reviews from:" , prUrl ) ;
188
184
189
185
$ . ajax ( {
190
186
dataType : 'json' ,
@@ -198,7 +194,6 @@ function allIncluded(outputTarget = 'email') {
198
194
} ) ;
199
195
} ,
200
196
success : ( data ) => {
201
- console . log ( "Received PR reviews data:" , data ) ;
202
197
githubPrsReviewData = data ;
203
198
writeGithubPrsReviews ( ) ;
204
199
} ,
@@ -226,11 +221,9 @@ function allIncluded(outputTarget = 'email') {
226
221
227
222
//load initial text in scrum body
228
223
function writeScrumBody ( ) {
229
- console . log ( "writeScrumBody called" ) ;
230
224
if ( ! enableToggle ) return ;
231
225
232
226
setTimeout ( ( ) => {
233
- console . log ( "generating content" ) ;
234
227
// Generate content first
235
228
var lastWeekUl = '<ul>' ;
236
229
var i ;
@@ -264,7 +257,6 @@ ${userReason}`;
264
257
}
265
258
266
259
if ( outputTarget === 'popup' ) {
267
- console . log ( "trying to update popup textarea" ) ;
268
260
const scrumReport = document . getElementById ( 'scrumReport' ) ;
269
261
if ( scrumReport ) {
270
262
console . log ( "found div, updating content" ) ;
@@ -279,7 +271,6 @@ ${userReason}`;
279
271
}
280
272
} else {
281
273
282
- // Use the adapter to inject content
283
274
const elements = window . emailClientAdapter . getEditorElements ( ) ;
284
275
if ( ! elements || ! elements . body ) {
285
276
console . error ( 'Email client editor not found' ) ;
@@ -300,11 +291,9 @@ ${userReason}`;
300
291
else if ( projectUrl === 'open-event' ) project = 'Open Event' ;
301
292
return project ;
302
293
}
303
- //load initial scrum subject
304
294
function scrumSubjectLoaded ( ) {
305
295
if ( ! enableToggle ) return ;
306
296
setTimeout ( ( ) => {
307
- //to apply this after google has autofilled
308
297
var name = githubUserData . name || githubUsername ;
309
298
var project = getProject ( ) ;
310
299
var curDate = new Date ( ) ;
@@ -320,18 +309,17 @@ ${userReason}`;
320
309
} ) ;
321
310
}
322
311
323
- // write PRs Reviewed
324
312
function writeGithubPrsReviews ( ) {
325
- console . log ( "Starting to process PR reviews" ) ;
326
313
var items = githubPrsReviewData . items ;
327
314
328
315
reviewedPrsArray = [ ] ;
329
316
githubPrsReviewDataProcessed = { } ;
330
317
331
318
for ( var i = 0 ; i < items . length ; i ++ ) {
332
319
var item = items [ i ] ;
333
- //skip if its your own pr
320
+
334
321
if ( item . user . login === githubUsername ) {
322
+ // skips own pr from review
335
323
continue ;
336
324
}
337
325
@@ -393,18 +381,14 @@ ${userReason}`;
393
381
}
394
382
repoLi += '</li>' ;
395
383
reviewedPrsArray . push ( repoLi ) ;
396
- console . log ( `Added repo ${ repo } to reviewedPrsArray` ) ;
397
384
}
398
385
399
386
writeScrumBody ( ) ;
400
387
}
401
388
function writeGithubIssuesPrs ( ) {
402
- console . log ( "Starting to process issues/PRs" ) ;
403
389
var data = githubIssuesData ;
404
- console . log ( "Total items to process:" , data . items . length ) ;
405
390
var items = data . items ;
406
391
407
- // Reset arrays at the start
408
392
lastWeekArray = [ ] ;
409
393
nextWeekArray = [ ] ;
410
394
@@ -427,7 +411,6 @@ ${userReason}`;
427
411
if ( item . state === 'open' && item . body && item . body . toUpperCase ( ) . indexOf ( 'YES' ) > 0 ) {
428
412
var li2 = `<li><i>(${ project } )</i> - Work on Issue(#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ issue_opened_button } </li>` ;
429
413
nextWeekArray . push ( li2 ) ;
430
- console . log ( "Added to nextWeekArray (contains YES)" ) ;
431
414
}
432
415
if ( item . state === 'open' ) {
433
416
li = `<li><i>(${ project } )</i> - Opened Issue(#${ number } ) - <a href='${ html_url } '>${ title } </a> ${ issue_opened_button } </li>` ;
@@ -440,15 +423,8 @@ ${userReason}`;
440
423
} else {
441
424
}
442
425
}
443
- console . log ( "Final arrays:" , {
444
- lastWeekItems : lastWeekArray . length ,
445
- nextWeekItems : nextWeekArray . length ,
446
- lastWeekContents : lastWeekArray ,
447
- nextWeekContents : nextWeekArray
448
- } ) ;
449
426
writeScrumBody ( ) ;
450
427
}
451
-
452
428
var intervalBody = setInterval ( ( ) => {
453
429
if ( ! window . emailClientAdapter ) return ;
454
430
@@ -480,13 +456,12 @@ ${userReason}`;
480
456
}
481
457
} , 500 ) ;
482
458
}
483
- allIncluded ( 'email' ) ; // Auto-trigger on page load
459
+ allIncluded ( 'email' ) ;
484
460
$ ( 'button>span:contains(New conversation)' ) . parent ( 'button' ) . click ( ( ) => {
485
- allIncluded ( ) ; // Auto-trigger on new conversation
461
+ allIncluded ( ) ;
486
462
} ) ;
487
463
488
464
window . generateScrumReport = function ( ) {
489
- console . log ( 'generateScrumReport called' ) ;
490
465
allIncluded ( 'popup' ) ;
491
466
} ;
492
467
0 commit comments