From b6fa009cf00a6bbd894a49d519e6c1d03a999790 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 24 Aug 2018 10:00:37 -0700 Subject: [PATCH] Enrich "priority" transactions in Maniphest for "transaction.search" Summary: Ref T13187. See . 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 --- .../ManiphestTaskPriorityTransaction.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php index 83f38fc659..398808e006 100644 --- a/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php +++ b/src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php @@ -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, + ), + ); + } + }