mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 09:58:24 +01:00
Add a "View Task" button to HTML mail from Maniphest
Summary: See downstream <https://phabricator.wikimedia.org/T1050>. Some time ago, we added a "View Revision" button to Differential mail. This hasn't created any problems and generally seems good / desirable. It isn't trivial to just add everywhere since we need a translation string in each case, but at least add it to Maniphest for now. Going forward, we can fill in more applications as they come up. Test Plan: Used `bin/mail show-outbound --id <x> --dump-html`: {F6470461} Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D20561
This commit is contained in:
parent
fb5dec4c03
commit
9a32a563f0
4 changed files with 19 additions and 2 deletions
|
@ -485,6 +485,10 @@ final class PhabricatorAuditEditor
|
|||
return $phids;
|
||||
}
|
||||
|
||||
protected function getObjectLinkButtonLabelForMail() {
|
||||
return pht('View Commit');
|
||||
}
|
||||
|
||||
protected function buildMailBody(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
|
|
@ -601,6 +601,10 @@ final class DifferentialTransactionEditor
|
|||
return $xactions;
|
||||
}
|
||||
|
||||
protected function getObjectLinkButtonLabelForMail() {
|
||||
return pht('View Revision');
|
||||
}
|
||||
|
||||
protected function buildMailBody(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
@ -617,7 +621,7 @@ final class DifferentialTransactionEditor
|
|||
$this->addHeadersAndCommentsToMailBody(
|
||||
$body,
|
||||
$xactions,
|
||||
pht('View Revision'),
|
||||
$this->getObjectLinkButtonLabelForMail($object),
|
||||
$revision_uri);
|
||||
|
||||
$type_inline = DifferentialTransaction::TYPE_INLINE;
|
||||
|
|
|
@ -206,6 +206,10 @@ final class ManiphestTransactionEditor
|
|||
->setSubject("T{$id}: {$title}");
|
||||
}
|
||||
|
||||
protected function getObjectLinkButtonLabelForMail() {
|
||||
return pht('View Task');
|
||||
}
|
||||
|
||||
protected function buildMailBody(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
|
|
@ -3417,12 +3417,17 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
->setViewer($this->requireActor())
|
||||
->setContextObject($object);
|
||||
|
||||
$this->addHeadersAndCommentsToMailBody($body, $xactions);
|
||||
$button_label = $this->getObjectLinkButtonLabelForMail($object);
|
||||
|
||||
$this->addHeadersAndCommentsToMailBody($body, $xactions, $button_label);
|
||||
$this->addCustomFieldsToMailBody($body, $object, $xactions);
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
protected function getObjectLinkButtonLabelForMail() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @task mail
|
||||
|
|
Loading…
Add table
Reference in a new issue