1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +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:
epriestley 2013-07-12 15:05:28 -07:00
parent 2b37911097
commit 7d3b19922c

View file

@ -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');
}
}