Commit 7d3d0224 authored by epriestley's avatar epriestley
Browse files

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
parent 69d63746
......@@ -26,6 +26,10 @@ final class DifferentialRevisionAbandonTransaction
return 500;
}
public function getActionName() {
return pht('Abandoned');
}
public function getCommandKeyword() {
return 'abandon';
}
......
......@@ -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);
......
......@@ -35,6 +35,10 @@ abstract class DifferentialRevisionActionTransaction
return 1000;
}
public function getActionStrength() {
return 3;
}
public function getRevisionActionOrderVector() {
return id(new PhutilSortVector())
->addInt($this->getRevisionActionOrder());
......
......@@ -26,6 +26,10 @@ final class DifferentialRevisionCloseTransaction
return 300;
}
public function getActionName() {
return pht('Closed');
}
public function generateOldValue($object) {
return $object->isClosed();
}
......
......@@ -26,6 +26,10 @@ final class DifferentialRevisionCommandeerTransaction
return 700;
}
public function getActionName() {
return pht('Commandeered');
}
public function getCommandKeyword() {
return 'commandeer';
}
......
......@@ -27,6 +27,10 @@ final class DifferentialRevisionPlanChangesTransaction
return 200;
}
public function getActionName() {
return pht('Planned Changes');
}
public function getCommandKeyword() {
return 'planchanges';
}
......
......@@ -26,6 +26,10 @@ final class DifferentialRevisionReclaimTransaction
return 600;
}
public function getActionName() {
return pht('Reclaimed');
}
public function getCommandKeyword() {
return 'reclaim';
}
......
......@@ -26,6 +26,10 @@ final class DifferentialRevisionRejectTransaction
return 600;
}
public function getActionName() {
return pht('Requested Changes');
}
public function getCommandKeyword() {
return 'request';
}
......
......@@ -26,6 +26,10 @@ final class DifferentialRevisionReopenTransaction
return 400;
}
public function getActionName() {
return pht('Reopened');
}
public function generateOldValue($object) {
return !$object->isClosed();
}
......
......@@ -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);
......
......@@ -30,6 +30,10 @@ final class DifferentialRevisionResignTransaction
return 'resign';
}
public function getActionName() {
return pht('Resigned');
}
public function getCommandAliases() {
return array();
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -59,6 +59,14 @@ abstract class PhabricatorModularTransactionType
return null;
}
public function getActionName() {
return null;
}
public function getActionStrength() {
return null;
}
public function getColor() {
return null;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment