diff options
author | Mark Côté <mcote@mozilla.com> | 2015-10-05 06:40:24 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-10-05 06:40:24 +0200 |
commit | 468157347418c9e46ab21331635d9b6dc71997b6 (patch) | |
tree | 00d7bbbd801a7680a94f4c6d448e735f6a617559 /extensions/MozReview/web/js | |
parent | 6cbec76bcb35a51442ccbf35ecfceb57da90afc8 (diff) | |
download | bugzilla-468157347418c9e46ab21331635d9b6dc71997b6.tar.gz bugzilla-468157347418c9e46ab21331635d9b6dc71997b6.tar.xz |
Bug 1210690 - Display only commits and only relevant data
Diffstat (limited to 'extensions/MozReview/web/js')
-rw-r--r-- | extensions/MozReview/web/js/mozreview.js | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/extensions/MozReview/web/js/mozreview.js b/extensions/MozReview/web/js/mozreview.js index 272f7a61b..70d99aaf6 100644 --- a/extensions/MozReview/web/js/mozreview.js +++ b/extensions/MozReview/web/js/mozreview.js @@ -12,6 +12,7 @@ MozReview.getReviewRequest = function() { var hostUrl = $('.mozreview-requests').data('mozreviewUrl'); var tr = $('<tr/>'); var td = $('<td/>'); + var link = $('<a/>'); var rrSummaryApiUrl = hostUrl + 'api/extensions/mozreview.extension.MozReviewExtension/summary/?bug=' + @@ -26,34 +27,32 @@ MozReview.getReviewRequest = function() { return rrUrl(rrId) + 'diff/#index_header'; } - function rrRow(rr, isParent) { - var tdSummary = td.clone(); + function rrCommitRow(rr, firstCommit) { var trCommit = tr.clone(); - var reviewLink = $('<a/>'); - var diffLink = reviewLink.clone(); - - if (!isParent) { - tdSummary.addClass('mozreview-child-request-summary'); - diffLink.attr('href', rrDiffUrl(rr.id)); - diffLink.text(rr.commit.substr(0, 12)); - diffLink.addClass('mozreview-diff-link'); - tdSummary.append(diffLink); - tdSummary.append(' '); + var tdSubmitter = td.clone(); + var tdRev = td.clone(); + var tdSummary = td.clone(); + var diffLink = link.clone(); + var reviewLink = link.clone(); + + if (firstCommit) { + tdSubmitter.text(rr.submitter); } + diffLink.attr('href', rrDiffUrl(rr.id)); + diffLink.text(rr.commit.substr(0, 12)); + diffLink.addClass('mozreview-diff-link'); + tdRev.append(diffLink); + + tdSummary.addClass('mozreview-summary'); reviewLink.attr('href', rrUrl(rr.id)); reviewLink.text(rr.summary); tdSummary.append(reviewLink); - if (isParent) { - tdSummary.append($('<span/>').text(' (' + rr.submitter + ')')); - } - - tdSummary.addClass('mozreview-summary'); - trCommit.append( + tdSubmitter, + tdRev, tdSummary, - td.clone().text(rr.status), td.clone().text(rr.issue_open_count) .addClass('mozreview-open-issues'), td.clone().text(timeAgo(new Date(rr.last_updated))) @@ -94,10 +93,8 @@ MozReview.getReviewRequest = function() { } else { for (i = 0; i < data.review_request_summaries.length; i++) { family = data.review_request_summaries[i]; - parent = family.parent; - tbody.append(rrRow(parent, true)); for (j = 0; j < family.children.length; j++) { - tbody.append(rrRow(family.children[j], false)); + tbody.append(rrCommitRow(family.children[j], j==0)); } } } |