mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Apply a TYPE_CREATE transaction when importing events to improve strings in timeline
Summary: Ref T10747. This turns on the newer EditEngine behavior so we get a nice "X created this event." transaction, instead of an "X renamed this from <nothing> to Event Name." Test Plan: Imported an event, saw a nice timeline. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10747 Differential Revision: https://secure.phabricator.com/D16771
This commit is contained in:
parent
96b064b7e9
commit
d9c91f857c
2 changed files with 15 additions and 0 deletions
|
@ -11,6 +11,15 @@ final class PhabricatorCalendarEventEditor
|
|||
return pht('Calendar');
|
||||
}
|
||||
|
||||
public function getCreateObjectTitle($author, $object) {
|
||||
return pht('%s created this event.', $author);
|
||||
}
|
||||
|
||||
public function getCreateObjectTitleForFeed($author, $object) {
|
||||
return pht('%s created %s.', $author, $object);
|
||||
}
|
||||
|
||||
|
||||
protected function shouldApplyInitialEffects(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
|
|
|
@ -471,6 +471,12 @@ abstract class PhabricatorCalendarImportEngine
|
|||
$xactions = array();
|
||||
$uid = $node->getUID();
|
||||
|
||||
if (!$event->getID()) {
|
||||
$xactions[] = id(new PhabricatorCalendarEventTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_CREATE)
|
||||
->setNewValue(true);
|
||||
}
|
||||
|
||||
$name = $node->getName();
|
||||
if (!strlen($name)) {
|
||||
if (strlen($uid)) {
|
||||
|
|
Loading…
Reference in a new issue