summaryrefslogtreecommitdiffstats
path: root/extensions/MyDashboard/web
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-03-29 20:50:34 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-03-29 20:50:34 +0100
commitc84943f1f566bcda7556c16cf664feb8215b1a14 (patch)
tree9a3f0064c8baade11c827c2a4d0ebe4cb5f6efa9 /extensions/MyDashboard/web
parent64ed562d5775252c75207d2e97d985115b6200f5 (diff)
downloadbugzilla-c84943f1f566bcda7556c16cf664feb8215b1a14.tar.gz
bugzilla-c84943f1f566bcda7556c16cf664feb8215b1a14.tar.xz
Bug 856110 - Add a review link to the dashboard for review attachment flags
Diffstat (limited to 'extensions/MyDashboard/web')
-rw-r--r--extensions/MyDashboard/web/js/flags.js33
-rw-r--r--extensions/MyDashboard/web/js/query.js4
2 files changed, 31 insertions, 6 deletions
diff --git a/extensions/MyDashboard/web/js/flags.js b/extensions/MyDashboard/web/js/flags.js
index c0ebc63ec..fa06a00d4 100644
--- a/extensions/MyDashboard/web/js/flags.js
+++ b/extensions/MyDashboard/web/js/flags.js
@@ -6,6 +6,12 @@
* defined by the Mozilla Public License, v. 2.0.
*/
+if (typeof(MyDashboard) == 'undefined') {
+ var MyDashboard = {};
+}
+
+MyDashboard.splinter_base = 'page.cgi?id=splinter.html';
+
// Flag tables
YUI({
base: 'js/yui3/',
@@ -92,12 +98,26 @@ YUI({
: '<i>anyone</i>';
};
+ var flagNameFormatter = function (o) {
+ if (o.data.attach_id && o.data.is_patch) {
+ return '<a href="' + MyDashboard.splinter_base +
+ '&bug=' + encodeURIComponent(o.data.bug_id) +
+ '&attachment=' + encodeURIComponent(o.data.attach_id) +
+ '" title="Click flag name to go to patch review page">' +
+ Y.Escape.html(o.value) + '</a>';
+ }
+ else {
+ return Y.Escape.html(o.value);
+ }
+ };
+
// Requestee
dataSource.requestee = new Y.DataSource.IO({ source: 'jsonrpc.cgi' });
dataTable.requestee = new Y.DataTable({
columns: [
{ key: "requester", label: "Requester", sortable: true },
- { key: "type", label: "Flag", sortable: true },
+ { key: "type", label: "Flag", sortable: true,
+ formatter: flagNameFormatter, allowHTML: true },
{ key: "bug_id", label: "Bug", sortable: true,
formatter: bugLinkFormatter, allowHTML: true },
{ key: "updated", label: "Updated", sortable: true,
@@ -118,8 +138,8 @@ YUI({
dataSource.requestee.plug(Y.Plugin.DataSourceJSONSchema, {
schema: {
resultListLocator: "result.result.requestee",
- resultFields: ["requester", "type", "bug_id", "bug_status",
- "bug_summary", "updated", "updated_fancy"]
+ resultFields: ["requester", "type", "attach_id", "is_patch", "bug_id",
+ "bug_status", "bug_summary", "updated", "updated_fancy"]
}
});
@@ -138,7 +158,8 @@ YUI({
columns: [
{ key:"requestee", label:"Requestee", sortable:true,
formatter: requesteeFormatter, allowHTML: true },
- { key:"type", label:"Flag", sortable:true },
+ { key:"type", label:"Flag", sortable:true,
+ formatter: flagNameFormatter, allowHTML: true },
{ key:"bug_id", label:"Bug", sortable:true,
formatter: bugLinkFormatter, allowHTML: true },
{ key: "updated", label: "Updated", sortable: true,
@@ -159,8 +180,8 @@ YUI({
dataSource.requester.plug(Y.Plugin.DataSourceJSONSchema, {
schema: {
resultListLocator: "result.result.requester",
- resultFields: ["requestee", "type", "bug_id", "bug_status",
- "bug_summary", "updated", "updated_fancy"]
+ resultFields: ["requestee", "type", "attach_id", "is_patch", "bug_id",
+ "bug_status", "bug_summary", "updated", "updated_fancy"]
}
});
diff --git a/extensions/MyDashboard/web/js/query.js b/extensions/MyDashboard/web/js/query.js
index 4590bb603..7d25cc33e 100644
--- a/extensions/MyDashboard/web/js/query.js
+++ b/extensions/MyDashboard/web/js/query.js
@@ -6,6 +6,10 @@
* defined by the Mozilla Public License, v. 2.0.
*/
+if (typeof(MyDashboard) == 'undefined') {
+ var MyDashboard = {};
+}
+
// Main query code
YUI({
base: 'js/yui3/',