1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02: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:
epriestley 2016-10-30 08:21:12 -07:00
parent 96b064b7e9
commit d9c91f857c
2 changed files with 15 additions and 0 deletions

View file

@ -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) {

View file

@ -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)) {