Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: infra/tools/antibody/static/tbr_by_user.js

Issue 1235373004: Added script to generate stats on a git checkout (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@new_antibody_db_schema
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 $(document).ready(function(){ 1 $(document).ready(function(){
2 $(".username").keypress(function(e){ 2 $(".username").keypress(function(e){
3 if (e.keyCode == 13) { 3 if (e.keyCode == 13) {
4 var user = $(".username").val(); 4 var user = $(".username").val();
5 $('.tbr').empty(); 5 $('.tbr').empty();
6 get_commits_tbred_to_user(user); 6 get_commits_tbred_to_user(user);
7 } 7 }
8 }); 8 });
9 9
10 function get_commits_tbred_to_user(user) { 10 function get_commits_tbred_to_user(user) {
11 $.getJSON("./tbr_by_user.json", function(data) { 11 $.getJSON("./tbr_by_user.json", function(data) {
12 console.log(data);
13 console.log('hello');
12 var commits_tbred_to_user = data["by_user"][user]; 14 var commits_tbred_to_user = data["by_user"][user];
13 if (commits_tbred_to_user === undefined) { 15 if (commits_tbred_to_user === undefined) {
14 $('.tbr').append($('<h3>').text( 16 $('.tbr').append($('<h3>').text(
15 `No commits to be reviewed by ${user}`)); 17 `No commits to be reviewed by ${user}`));
16 } else { 18 } else {
17 gitiles_prefix = data["gitiles_prefix"]; 19 gitiles_prefix = data["gitiles_prefix"];
18 $('.tbr').append($('<h3>').text(`Commits to be reviewed by ${user}`)); 20 $('.tbr').append($('<h3>').text(`Commits to be reviewed by ${user}`));
19 $('.tbr').append(document.createElement('br')); 21 $('.tbr').append(document.createElement('br'));
20 var table = $('<table>').attr('data-toggle', 'table').attr( 22 var table = $('<table>').attr('data-toggle', 'table').attr(
21 'data-cache', 'false'); 23 'data-cache', 'false');
22 table.append($('<thead>').append($('<tr>').append( 24 table.append($('<thead>').append($('<tr>').append(
23 $('<th>').attr('data-field', 'git_hash label').text('git_hash'), 25 $('<th>').attr('data-field', 'subject label').text('Git Commit Subje ct'),
24 $('<th>').attr('data-field', 'rietveld_url label').text( 26 $('<th>').attr('data-field', 'rietveld_url label').text(
25 'rietveld_url'), 27 'Review URL'),
26 $('<th>').attr('data-field', 'request_timestamp').text( 28 $('<th>').attr('data-field', 'request_timestamp').text(
27 'request_timestamp') 29 'Request Timestamp')
28 ))); 30 )));
29 var tbody = $('<tbody>'); 31 var tbody = $('<tbody>');
30 for (var i = 0; i < commits_tbred_to_user.length; i++) { 32 for (var i = 0; i < commits_tbred_to_user.length; i++) {
31 data_item = commits_tbred_to_user[i]; 33 data_item = commits_tbred_to_user[i];
34 console.log(data_item);
32 tbody.append($('<tr>').addClass('data_item').append( 35 tbody.append($('<tr>').addClass('data_item').append(
33 $('<td>').addClass('git_hash hyperlink').append( 36 $('<td>').addClass('subject hyperlink').append(
34 $('<a>').attr('href', `${gitiles_prefix}${data_item[0]}`).text( 37 $('<a>').attr('href', `${gitiles_prefix}${data_item[3]}`).text(
35 `${data_item[0]}`)), 38 `${data_item[0]}`)),
36 $('<td>').addClass('rietveld_url hyperlink').append( 39 $('<td>').addClass('rietveld_url hyperlink').append(
37 $('<a>').attr('href', `${data_item[1]}`).text( 40 $('<a>').attr('href', `${data_item[1]}`).text(
38 `${data_item[1]}`)), 41 `${data_item[1]}`)),
39 $('<td>').addClass('request_timestamp').text(`${data_item[2]}`) 42 $('<td>').addClass('request_timestamp').text(`${data_item[2]}`)
40 )); 43 ));
41 } 44 }
42 table.append(tbody); 45 table.append(tbody);
43 $('.tbr').append(table); 46 $('.tbr').append(table);
44 } 47 }
45 }); 48 });
46 } 49 }
47 }); 50 });
OLDNEW
« no previous file with comments | « infra/tools/antibody/static/tbr_by_user.css ('k') | infra/tools/antibody/templates/antibody_ui_all.jinja » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698