From e4c6417871fc9e29073429abe5d0c32b556d87a2 Mon Sep 17 00:00:00 2001 From: Mark Côté Date: Mon, 13 Jul 2015 10:07:33 -0400 Subject: Bug 1123143 - Add links to MozReview diffs to MozReview table. r=glob Each child review-request summary is prefaced with the abbreviated commit hash, which is also a link to the diff. This looks similar to the summary table in MozReview itself. --- extensions/MozReview/web/js/mozreview.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'extensions/MozReview/web/js') diff --git a/extensions/MozReview/web/js/mozreview.js b/extensions/MozReview/web/js/mozreview.js index e927d366c..272f7a61b 100644 --- a/extensions/MozReview/web/js/mozreview.js +++ b/extensions/MozReview/web/js/mozreview.js @@ -22,18 +22,28 @@ MozReview.getReviewRequest = function() { return rrUiBaseUrl + rrId + '/'; } + function rrDiffUrl(rrId) { + return rrUrl(rrId) + 'diff/#index_header'; + } + function rrRow(rr, isParent) { var tdSummary = td.clone(); var trCommit = tr.clone(); - var a = $(''); + var reviewLink = $(''); + 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(' '); } - a.attr('href', rrUrl(rr.id)); - a.text(rr.summary); - tdSummary.append(a); + reviewLink.attr('href', rrUrl(rr.id)); + reviewLink.text(rr.summary); + tdSummary.append(reviewLink); if (isParent) { tdSummary.append($('').text(' (' + rr.submitter + ')')); -- cgit v1.2.3-24-g4f1b