mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 09:20:58 +01:00
Respect subject prefix configuration for Asana sync and include line count
Summary: Ref T2852. - Respect the existing setting for `"[Differential]"`. - Show `[Request, X lines]` to make this more similar to the email. Test Plan: Sync'd to asana and got a task with the right subject: {F49950} Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2852 Differential Revision: https://secure.phabricator.com/D6439
This commit is contained in:
parent
2b37911097
commit
7d3b19922c
1 changed files with 13 additions and 3 deletions
|
@ -89,8 +89,13 @@ final class DoorkeeperFeedWorkerAsana extends FeedPushWorker {
|
|||
|
||||
private function getAsanaTaskData($object) {
|
||||
$revision = $object;
|
||||
$prefix = $this->getTitlePrefix($object);
|
||||
$title = $revision->getTitle();
|
||||
$lines = pht(
|
||||
'[Request, %d lines]',
|
||||
new PhutilNumber($object->getLineCount()));
|
||||
|
||||
$name = '[Differential] D'.$revision->getID().': '.$revision->getTitle();
|
||||
$name = $prefix.' '.$lines.' D'.$revision->getID().': '.$title;
|
||||
$uri = PhabricatorEnv::getProductionURI('/D'.$revision->getID());
|
||||
|
||||
$notes = array(
|
||||
|
@ -120,8 +125,9 @@ final class DoorkeeperFeedWorkerAsana extends FeedPushWorker {
|
|||
|
||||
private function getAsanaSubtaskData($object) {
|
||||
$revision = $object;
|
||||
$prefix = $this->getTitlePrefix($object);
|
||||
|
||||
$name = '[Differential] Review Request';
|
||||
$name = $prefix.' Review Request';
|
||||
$uri = PhabricatorEnv::getProductionURI('/D'.$revision->getID());
|
||||
|
||||
$notes = array(
|
||||
|
@ -133,7 +139,7 @@ final class DoorkeeperFeedWorkerAsana extends FeedPushWorker {
|
|||
$notes = implode("\n\n", $notes);
|
||||
|
||||
return array(
|
||||
'name' => '[Differential] Review Request',
|
||||
'name' => $prefix.' Review Request',
|
||||
'notes' => $notes,
|
||||
);
|
||||
}
|
||||
|
@ -611,4 +617,8 @@ final class DoorkeeperFeedWorkerAsana extends FeedPushWorker {
|
|||
return (5 * 60) * pow(8, $count);
|
||||
}
|
||||
|
||||
public function getTitlePrefix($object) {
|
||||
return PhabricatorEnv::getEnvConfig('metamta.differential.subject-prefix');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue