Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13958991
D8223.id19565.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D8223.id19565.diff
View Options
Index: src/applications/differential/storage/DifferentialTransaction.php
===================================================================
--- src/applications/differential/storage/DifferentialTransaction.php
+++ src/applications/differential/storage/DifferentialTransaction.php
@@ -20,6 +20,7 @@
public function getTitle() {
$author_phid = $this->getAuthorPHID();
+ $author_handle = $this->renderHandleLink($author_phid);
$old = $this->getOldValue();
$new = $this->getNewValue();
@@ -28,10 +29,90 @@
case self::TYPE_INLINE:
return pht(
'%s added inline comments.',
- $this->renderHandleLink($author_phid));
+ $author_handle);
+ case self::TYPE_UPDATE:
+ if ($new) {
+ // TODO: Migrate to PHIDs and use handles here?
+ // TODO: Link this?
+ return pht(
+ '%s updated this revision to Diff #%d.',
+ $author_handle,
+ $new);
+ } else {
+ return pht(
+ '%s updated this revision.',
+ $author_handle);
+ }
+ case self::TYPE_ACTION:
+ return DifferentialAction::getBasicStoryText($new, $author_handle);
}
return parent::getTitle();
}
+ public function getIcon() {
+ switch ($this->getTransactionType()) {
+ case self::TYPE_INLINE:
+ return 'comment';
+ case self::TYPE_UPDATE:
+ return 'refresh';
+ case self::TYPE_ACTION:
+ switch ($this->getNewValue()) {
+ case DifferentialAction::ACTION_CLOSE:
+ return 'ok';
+ case DifferentialAction::ACTION_ACCEPT:
+ return 'enable';
+ case DifferentialAction::ACTION_REJECT:
+ case DifferentialAction::ACTION_ABANDON:
+ return 'delete';
+ case DifferentialAction::ACTION_RETHINK:
+ return 'disable';
+ case DifferentialAction::ACTION_REQUEST:
+ return 'refresh';
+ case DifferentialAction::ACTION_RECLAIM:
+ case DifferentialAction::ACTION_REOPEN:
+ return 'new';
+ case DifferentialAction::ACTION_RESIGN:
+ return 'undo';
+ case DifferentialAction::ACTION_CLAIM:
+ return 'user';
+ }
+ }
+
+ return parent::getIcon();
+ }
+
+ public function getColor() {
+ switch ($this->getTransactionType()) {
+ case self::TYPE_UPDATE:
+ return PhabricatorTransactions::COLOR_SKY;
+ case self::TYPE_ACTION:
+ switch ($this->getNewValue()) {
+ case DifferentialAction::ACTION_CLOSE:
+ return PhabricatorTransactions::COLOR_BLUE;
+ case DifferentialAction::ACTION_ACCEPT:
+ return PhabricatorTransactions::COLOR_GREEN;
+ case DifferentialAction::ACTION_REJECT:
+ return PhabricatorTransactions::COLOR_RED;
+ case DifferentialAction::ACTION_ABANDON:
+ return PhabricatorTransactions::COLOR_BLACK;
+ case DifferentialAction::ACTION_RETHINK:
+ return PhabricatorTransactions::COLOR_RED;
+ case DifferentialAction::ACTION_REQUEST:
+ return PhabricatorTransactions::COLOR_SKY;
+ case DifferentialAction::ACTION_RECLAIM:
+ return PhabricatorTransactions::COLOR_SKY;
+ case DifferentialAction::ACTION_REOPEN:
+ return PhabricatorTransactions::COLOR_SKY;
+ case DifferentialAction::ACTION_RESIGN:
+ return PhabricatorTransactions::COLOR_ORANGE;
+ case DifferentialAction::ACTION_CLAIM:
+ return PhabricatorTransactions::COLOR_YELLOW;
+ }
+ }
+
+
+ return parent::getColor();
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 15 2024, 5:16 PM (5 w, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6713677
Default Alt Text
D8223.id19565.diff (3 KB)
Attached To
Mode
D8223: Provide transaction strings, icons and colors for Differential
Attached
Detach File
Event Timeline
Log In to Comment