From 897f58ced15e63ca63e870a40991eaf97de84f2f Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 21 Mar 2013 15:57:53 -0400 Subject: Bug 853432 - "Flags requested of you" doesn't show flags that are requested on Resolved bugs --- extensions/MyDashboard/web/js/flags.js | 39 ++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'extensions/MyDashboard/web/js') diff --git a/extensions/MyDashboard/web/js/flags.js b/extensions/MyDashboard/web/js/flags.js index 8ea54539b..c0ebc63ec 100644 --- a/extensions/MyDashboard/web/js/flags.js +++ b/extensions/MyDashboard/web/js/flags.js @@ -26,6 +26,8 @@ YUI({ var updateFlagTable = function (type) { if (!type) return; + var include_resolved = Y.one('#' + type + '_resolved').get('checked') ? 1 : 0; + counter = counter + 1; var callback = { @@ -47,13 +49,13 @@ YUI({ version: "1.1", method: "MyDashboard.run_flag_query", id: counter, - params: { type : type } + params: { type : type, include_resolved: include_resolved } }; var stringified = Y.JSON.stringify(json_object); Y.one('#' + type + '_count_refresh').addClass('bz_default_hidden'); - + dataTable[type].set('data', []); dataTable[type].render("#" + type + "_table"); dataTable[type].showMessage('loadingMessage'); @@ -69,14 +71,19 @@ YUI({ }; var bugLinkFormatter = function (o) { + var bug_closed = ""; + if (o.data.bug_status == 'RESOLVED' || o.data.bug_status == 'VERIFIED') { + bug_closed = "bz_closed"; + } return '' + o.value + ''; + '" target="_blank" ' + 'title="' + Y.Escape.html(o.data.bug_status) + ' - ' + + Y.Escape.html(o.data.bug_summary) + '" class="' + Y.Escape.html(bug_closed) + + '">' + o.value + ''; }; - var createdFormatter = function (o) { + var updatedFormatter = function (o) { return '' + - Y.Escape.html(o.data.created_fancy) + ''; + Y.Escape.html(o.data.updated_fancy) + ''; }; var requesteeFormatter = function (o) { @@ -91,10 +98,10 @@ YUI({ columns: [ { key: "requester", label: "Requester", sortable: true }, { key: "type", label: "Flag", sortable: true }, - { key: "bug_id", label: "Bug", sortable: true, + { key: "bug_id", label: "Bug", sortable: true, formatter: bugLinkFormatter, allowHTML: true }, - { key: "created", label: "Created", sortable: true, - formatter: createdFormatter, allowHTML: true } + { key: "updated", label: "Updated", sortable: true, + formatter: updatedFormatter, allowHTML: true } ], strings: { emptyMessage: 'No flag data found.', @@ -112,7 +119,7 @@ YUI({ schema: { resultListLocator: "result.result.requestee", resultFields: ["requester", "type", "bug_id", "bug_status", - "bug_summary", "created", "created_fancy"] + "bug_summary", "updated", "updated_fancy"] } }); @@ -121,6 +128,9 @@ YUI({ Y.one('#requestee_refresh').on('click', function(e) { updateFlagTable('requestee'); }); + Y.one('#requestee_resolved').on('change', function(e) { + updateFlagTable('requestee'); + }); // Requester dataSource.requester = new Y.DataSource.IO({ source: 'jsonrpc.cgi' }); @@ -131,8 +141,8 @@ YUI({ { key:"type", label:"Flag", sortable:true }, { key:"bug_id", label:"Bug", sortable:true, formatter: bugLinkFormatter, allowHTML: true }, - { key: "created", label: "Created", sortable: true, - formatter: createdFormatter, allowHTML: true } + { key: "updated", label: "Updated", sortable: true, + formatter: updatedFormatter, allowHTML: true } ], strings: { emptyMessage: 'No flag data found.', @@ -150,11 +160,14 @@ YUI({ schema: { resultListLocator: "result.result.requester", resultFields: ["requestee", "type", "bug_id", "bug_status", - "bug_summary", "created", "created_fancy"] + "bug_summary", "updated", "updated_fancy"] } }); Y.one('#requester_refresh').on('click', function(e) { updateFlagTable('requester'); }); + Y.one('#requester_resolved').on('change', function(e) { + updateFlagTable('requester'); + }); }); -- cgit v1.2.3-24-g4f1b