@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Allow filtering Bulk Job Query results by status

Summary:
As a sysadmin, I'm much more interested in tasks which have not successfully completed, so allow me to filter Bulk Jobs on status to exclude completed ones.

Closes T16514

Test Plan:
* Go to http://phorge.localhost/applications/view/PhabricatorManiphestApplication/ and allow yourself to "Can Bulk Edit Tasks"
* Create some Bulk Edit Jobs with different statuses (e.g. Completed; or created but not run yet which is called Confirmed)
* Go to http://phorge.localhost/daemon/bulk/query/advanced/, see a new "Status" dropdown
* Set some "Status" values, get filtered results
* Check that this also works on http://phorge.localhost/daemon/bulk/query/authored/ and http://phorge.localhost/daemon/bulk/query/all/
* Click "Save Query", add a name, see new query in the sidebar, click new sidebar entry, get filtered results as expected

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16514

Differential Revision: https://we.phorge.it/D26781

+14
+14
src/infrastructure/daemon/workers/query/PhabricatorWorkerBulkJobSearchEngine.php
··· 26 26 $query->withAuthorPHIDs($map['authorPHIDs']); 27 27 } 28 28 29 + if ($map['status']) { 30 + $query->withStatuses(array($map['status'])); 31 + } 32 + 29 33 return $query; 30 34 } 31 35 ··· 35 39 ->setLabel(pht('Authors')) 36 40 ->setKey('authorPHIDs') 37 41 ->setAliases(array('author', 'authors')), 42 + id(new PhabricatorSearchSelectField()) 43 + ->setKey('status') 44 + ->setLabel(pht('Status')) 45 + ->setOptions(array( 46 + '' => pht('All'), 47 + PhabricatorWorkerBulkJob::STATUS_CONFIRM => pht('Confirming'), 48 + PhabricatorWorkerBulkJob::STATUS_WAITING => pht('Waiting'), 49 + PhabricatorWorkerBulkJob::STATUS_RUNNING => pht('Running'), 50 + PhabricatorWorkerBulkJob::STATUS_COMPLETE => pht('Complete'), 51 + )), 38 52 ); 39 53 } 40 54