mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-09 16:32:39 +01:00
Enrich "priority" transactions in Maniphest for "transaction.search"
Summary: Ref T13187. See <https://discourse.phabricator-community.org/t/task-priority-change-info-missing-in-firehose-webhook/1832/2>. We can reasonably enrich these transactions. Since priorities don't have unique authorative string identifiers, I've mostly mimicked the `maniphest.search` structure. Test Plan: Called `transaction.search` on tasks which were: created normally, created with a priority change, saw a priority change after creation. All the output looked useful and sensible. Reviewers: amckinley Maniphest Tasks: T13187 Differential Revision: https://secure.phabricator.com/D19599
This commit is contained in:
parent
5e4d9dfa92
commit
b6fa009cf0
1 changed files with 29 additions and 0 deletions
|
@ -172,4 +172,33 @@ final class ManiphestTaskPriorityTransaction
|
|||
return $errors;
|
||||
}
|
||||
|
||||
public function getTransactionTypeForConduit($xaction) {
|
||||
return 'priority';
|
||||
}
|
||||
|
||||
public function getFieldValuesForConduit($xaction, $data) {
|
||||
$old = $xaction->getOldValue();
|
||||
if ($old !== null) {
|
||||
$old = (int)$old;
|
||||
$old_name = ManiphestTaskPriority::getTaskPriorityName($old);
|
||||
} else {
|
||||
$old_name = null;
|
||||
}
|
||||
|
||||
$new = $xaction->getNewValue();
|
||||
$new = (int)$new;
|
||||
$new_name = ManiphestTaskPriority::getTaskPriorityName($new);
|
||||
|
||||
return array(
|
||||
'old' => array(
|
||||
'value' => $old,
|
||||
'name' => $old_name,
|
||||
),
|
||||
'new' => array(
|
||||
'value' => $new,
|
||||
'name' => $new_name,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue