mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 03:02:43 +01:00
ffe0765b50
Summary: Ref T6237. This sets us up for some future work like T6152, T6200 and generally cleaning up this workflow a bit. Tried to do as little as possible so not exposing transaction view yet. (Though that timeline is going to be a little funky in the common case of just the lone create transaction.) Test Plan: made a diff from web ui and it worked. made a herald rule to block certain diffs then tried to make such a diff and saw UI letting me know i was blocked Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6237 Differential Revision: https://secure.phabricator.com/D10869
64 lines
1.4 KiB
PHP
64 lines
1.4 KiB
PHP
<?php
|
|
|
|
final class DifferentialDiffTransaction
|
|
extends PhabricatorApplicationTransaction {
|
|
|
|
const TYPE_DIFF_CREATE = 'differential:diff:create';
|
|
|
|
public function getApplicationName() {
|
|
return 'differential';
|
|
}
|
|
|
|
public function getApplicationTransactionType() {
|
|
return DifferentialDiffPHIDType::TYPECONST;
|
|
}
|
|
|
|
public function shouldHideForMail(array $xactions) {
|
|
return true;
|
|
}
|
|
|
|
public function getActionName() {
|
|
switch ($this->getTransactionType()) {
|
|
case self::TYPE_DIFF_CREATE;
|
|
return pht('Created');
|
|
}
|
|
|
|
return parent::getActionName();
|
|
}
|
|
|
|
public function getTitle() {
|
|
$author_phid = $this->getAuthorPHID();
|
|
$author_handle = $this->renderHandleLink($author_phid);
|
|
|
|
$old = $this->getOldValue();
|
|
$new = $this->getNewValue();
|
|
|
|
switch ($this->getTransactionType()) {
|
|
case self::TYPE_DIFF_CREATE;
|
|
return pht(
|
|
'%s created this diff.',
|
|
$author_handle);
|
|
}
|
|
|
|
return parent::getTitle();
|
|
}
|
|
|
|
public function getIcon() {
|
|
switch ($this->getTransactionType()) {
|
|
case self::TYPE_DIFF_CREATE:
|
|
return 'fa-refresh';
|
|
}
|
|
|
|
return parent::getIcon();
|
|
}
|
|
|
|
public function getColor() {
|
|
switch ($this->getTransactionType()) {
|
|
case self::TYPE_DIFF_CREATE:
|
|
return PhabricatorTransactions::COLOR_SKY;
|
|
}
|
|
|
|
return parent::getColor();
|
|
}
|
|
|
|
}
|