From c84943f1f566bcda7556c16cf664feb8215b1a14 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Fri, 29 Mar 2013 15:50:34 -0400 Subject: Bug 856110 - Add a review link to the dashboard for review attachment flags --- extensions/MyDashboard/lib/Queries.pm | 2 +- .../en/default/pages/mydashboard.html.tmpl | 6 ++++ extensions/MyDashboard/web/js/flags.js | 33 ++++++++++++++++++---- extensions/MyDashboard/web/js/query.js | 4 +++ 4 files changed, 38 insertions(+), 7 deletions(-) (limited to 'extensions/MyDashboard') diff --git a/extensions/MyDashboard/lib/Queries.pm b/extensions/MyDashboard/lib/Queries.pm index 7703a29c2..9f4935c9d 100644 --- a/extensions/MyDashboard/lib/Queries.pm +++ b/extensions/MyDashboard/lib/Queries.pm @@ -185,7 +185,7 @@ sub query_flags { bugs.bug_status AS bug_status, bugs.short_desc AS bug_summary, flags.attach_id AS attach_id, - attachments.description AS attach_summary, + attachments.ispatch AS is_patch, requesters.login_name AS requester, requestees.login_name AS requestee, " . $dbh->sql_date_format('flags.modification_date', '%Y-%m-%d %H:%i') . " AS updated diff --git a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl index 1549b0dc2..404a86a1a 100644 --- a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl +++ b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl @@ -67,6 +67,12 @@ + +
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({ : 'anyone'; }; + var flagNameFormatter = function (o) { + if (o.data.attach_id && o.data.is_patch) { + return '' + + Y.Escape.html(o.value) + ''; + } + 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/', -- cgit v1.2.3-24-g4f1b