1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-02 01:48:23 +01:00

Show related objects on daemon worker task queue detail pages

Summary:
See PHI287. Currently, you can't get very much information about a task in the worker queue from the web UI.

This is largely intentional (e.g., it's bad if we let you inspect the content of a "send an administrator's password reset email" task), and a lot of the data is task-class specific so it would be a lot of work to expose it, but we can add one useful piece of information pretty easily: for tasks with an `objectPHID` that points at a valid object that's visible to the user, tell the user which object the task is associated with.

Test Plan: {F5386562}

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18890
This commit is contained in:
epriestley 2018-01-19 16:02:53 -08:00
parent 3b7547e726
commit c637680445

View file

@ -79,13 +79,20 @@ final class PhabricatorWorkerTaskDetailController
->appendChild($view); ->appendChild($view);
} }
private function buildPropertyListView( private function buildPropertyListView(PhabricatorWorkerTask $task) {
PhabricatorWorkerTask $task) { $viewer = $this->getViewer();
$viewer = $this->getRequest()->getUser();
$view = new PHUIPropertyListView(); $view = new PHUIPropertyListView();
$object_phid = $task->getObjectPHID();
if ($object_phid) {
$handles = $viewer->loadHandles(array($object_phid));
$handle = $handles[$object_phid];
if ($handle->isComplete()) {
$view->addProperty(pht('Object'), $handle->renderLink());
}
}
if ($task->isArchived()) { if ($task->isArchived()) {
switch ($task->getResult()) { switch ($task->getResult()) {
case PhabricatorWorkerArchiveTask::RESULT_SUCCESS: case PhabricatorWorkerArchiveTask::RESULT_SUCCESS: