From: dklawren Date: Fri, 11 Jan 2019 15:28:49 +0000 (-0500) Subject: Bug 1510996 - Abandoned phabricator revisions should be hidden by default X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82e9e5e2974b06096601ff1b010cd99ec50bceba;p=thirdparty%2Fbugzilla.git Bug 1510996 - Abandoned phabricator revisions should be hidden by default --- diff --git a/extensions/PhabBugz/template/en/default/phabricator/table.html.tmpl b/extensions/PhabBugz/template/en/default/phabricator/table.html.tmpl index 3331c1991..c55a039f1 100644 --- a/extensions/PhabBugz/template/en/default/phabricator/table.html.tmpl +++ b/extensions/PhabBugz/template/en/default/phabricator/table.html.tmpl @@ -26,4 +26,12 @@ + + + + + + + + diff --git a/extensions/PhabBugz/web/js/phabricator.js b/extensions/PhabBugz/web/js/phabricator.js index a64229b36..087889f28 100644 --- a/extensions/PhabBugz/web/js/phabricator.js +++ b/extensions/PhabBugz/web/js/phabricator.js @@ -63,6 +63,12 @@ Phabricator.getBugRevisions = function() { tableReviews.addClass('phabricator-reviewers'); tdReviewers.append(tableReviews); + trRevision.attr('data-status', revision.status); + if (revision.status === 'abandoned') { + trRevision.addClass('bz_default_hidden'); + $('tbody.phabricator-show-abandoned').removeClass('bz_default_hidden'); + } + trRevision.append( tdId, tdTitle, @@ -112,4 +118,18 @@ Phabricator.getBugRevisions = function() { $().ready(function() { Phabricator.getBugRevisions(); + + $('#phabricator-show-abandoned').on('click', function (event) { + $('tbody.phabricator-revision > tr').each(function() { + var row = $(this); + if (row.attr('data-status') === 'abandoned') { + if ($('#phabricator-show-abandoned').prop('checked') == true) { + row.removeClass('bz_default_hidden'); + } + else { + row.addClass('bz_default_hidden'); + } + } + }); + }); });