summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMark Côté <mcote@mozilla.com>2015-07-13 16:07:33 +0200
committerMark Côté <mcote@alumni.uwaterloo.ca>2015-07-13 16:10:48 +0200
commite4c6417871fc9e29073429abe5d0c32b556d87a2 (patch)
treee41e9e998e1429fb5f34eead62b4b6320ae0bfd8 /extensions
parentde34aedc30cce1d9dcbe45394e795467b3502018 (diff)
downloadbugzilla-e4c6417871fc9e29073429abe5d0c32b556d87a2.tar.gz
bugzilla-e4c6417871fc9e29073429abe5d0c32b556d87a2.tar.xz
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.
Diffstat (limited to 'extensions')
-rw-r--r--extensions/MozReview/web/js/mozreview.js18
-rw-r--r--extensions/MozReview/web/style/mozreview.css4
2 files changed, 18 insertions, 4 deletions
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 = $('<a/>');
+ 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(' ');
}
- 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($('<span/>').text(' (' + rr.submitter + ')'));
diff --git a/extensions/MozReview/web/style/mozreview.css b/extensions/MozReview/web/style/mozreview.css
index 8efea8950..70d088539 100644
--- a/extensions/MozReview/web/style/mozreview.css
+++ b/extensions/MozReview/web/style/mozreview.css
@@ -53,6 +53,10 @@
text-indent: 1em;
}
+.mozreview-diff-link {
+ font-family: monospace;
+}
+
/* bug-modal specific */
#module-mozreview-requests .module-content {