1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Restore "[Action]" mail subject lines to Differential/Diffusion

Summary: Ref T11114. Ref T10978. These hadn't made it over to EditEngine yet.

Test Plan:
  - Took various actions on revisions and commits.
  - Used `bin/mail show-outbound --id ...` to examine the "Vary Subject", saw it properly generate "[Accepted]", "[Resigned]", etc.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114, T10978

Differential Revision: https://secure.phabricator.com/D17191
This commit is contained in:
epriestley 2017-01-12 07:40:48 -08:00
parent 69d6374646
commit 7d3d022407
16 changed files with 82 additions and 0 deletions

View file

@ -26,6 +26,10 @@ final class DifferentialRevisionAbandonTransaction
return 500;
}
public function getActionName() {
return pht('Abandoned');
}
public function getCommandKeyword() {
return 'abandon';
}

View file

@ -26,6 +26,10 @@ final class DifferentialRevisionAcceptTransaction
return 500;
}
public function getActionName() {
return pht('Accepted');
}
public function getCommandKeyword() {
$accept_key = 'differential.enable-email-accept';
$allow_email_accept = PhabricatorEnv::getEnvConfig($accept_key);

View file

@ -35,6 +35,10 @@ abstract class DifferentialRevisionActionTransaction
return 1000;
}
public function getActionStrength() {
return 3;
}
public function getRevisionActionOrderVector() {
return id(new PhutilSortVector())
->addInt($this->getRevisionActionOrder());

View file

@ -26,6 +26,10 @@ final class DifferentialRevisionCloseTransaction
return 300;
}
public function getActionName() {
return pht('Closed');
}
public function generateOldValue($object) {
return $object->isClosed();
}

View file

@ -26,6 +26,10 @@ final class DifferentialRevisionCommandeerTransaction
return 700;
}
public function getActionName() {
return pht('Commandeered');
}
public function getCommandKeyword() {
return 'commandeer';
}

View file

@ -27,6 +27,10 @@ final class DifferentialRevisionPlanChangesTransaction
return 200;
}
public function getActionName() {
return pht('Planned Changes');
}
public function getCommandKeyword() {
return 'planchanges';
}

View file

@ -26,6 +26,10 @@ final class DifferentialRevisionReclaimTransaction
return 600;
}
public function getActionName() {
return pht('Reclaimed');
}
public function getCommandKeyword() {
return 'reclaim';
}

View file

@ -26,6 +26,10 @@ final class DifferentialRevisionRejectTransaction
return 600;
}
public function getActionName() {
return pht('Requested Changes');
}
public function getCommandKeyword() {
return 'request';
}

View file

@ -26,6 +26,10 @@ final class DifferentialRevisionReopenTransaction
return 400;
}
public function getActionName() {
return pht('Reopened');
}
public function generateOldValue($object) {
return !$object->isClosed();
}

View file

@ -22,6 +22,10 @@ final class DifferentialRevisionRequestReviewTransaction
return 200;
}
public function getActionName() {
return pht('Requested Review');
}
public function generateOldValue($object) {
$status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW;
return ($object->getStatus() == $status_review);

View file

@ -30,6 +30,10 @@ final class DifferentialRevisionResignTransaction
return 'resign';
}
public function getActionName() {
return pht('Resigned');
}
public function getCommandAliases() {
return array();
}

View file

@ -26,6 +26,10 @@ final class DiffusionCommitAcceptTransaction
return 500;
}
public function getActionName() {
return pht('Accepted');
}
public function generateOldValue($object) {
$actor = $this->getActor();
return $this->isViewerAcceptingAuditor($object, $actor);

View file

@ -26,6 +26,10 @@ final class DiffusionCommitConcernTransaction
return 600;
}
public function getActionName() {
return pht('Raised Concern');
}
public function generateOldValue($object) {
$actor = $this->getActor();
return $this->isViewerRejectingAuditor($object, $actor);

View file

@ -26,6 +26,10 @@ final class DiffusionCommitResignTransaction
return 700;
}
public function getActionName() {
return pht('Resigned');
}
public function generateOldValue($object) {
$actor = $this->getActor();
return !$this->isViewerAnyActiveAuditor($object, $actor);

View file

@ -110,6 +110,24 @@ abstract class PhabricatorModularTransaction
return parent::getTitle();
}
/* final */ public function getActionName() {
$action = $this->getTransactionImplementation()->getActionName();
if ($action !== null) {
return $action;
}
return parent::getActionName();
}
/* final */ public function getActionStrength() {
$strength = $this->getTransactionImplementation()->getActionStrength();
if ($strength !== null) {
return $strength;
}
return parent::getActionStrength();
}
public function getTitleForMail() {
$old_target = $this->getRenderingTarget();
$new_target = self::TARGET_TEXT;

View file

@ -59,6 +59,14 @@ abstract class PhabricatorModularTransactionType
return null;
}
public function getActionName() {
return null;
}
public function getActionStrength() {
return null;
}
public function getColor() {
return null;
}