mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 15:22:41 +01:00
Support object mentions in Calendar Event descriptions
Summary: Ref T7924. This: - Adds support for remarkup block changes to Modular Transactions. - Exposes remarkup changes from the Calendar event "Description" transaction. This makes stuff like mentions and file embeds work properly. Test Plan: Mentioned a task in an event description, saw a mention appear on the task. Uploaded a file to an event description, saw the file become "Attached" to the event. (Neither of these worked properly before.) Reviewers: chad Reviewed By: chad Maniphest Tasks: T7924 Differential Revision: https://secure.phabricator.com/D16481
This commit is contained in:
parent
25a7266d15
commit
27cfd8d19e
3 changed files with 24 additions and 0 deletions
|
@ -39,4 +39,15 @@ final class PhabricatorCalendarEventDescriptionTransaction
|
|||
->setNewText($this->getNewValue());
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
$changes = array();
|
||||
|
||||
$changes[] = $this->newRemarkupChange()
|
||||
->setOldValue($this->getOldValue())
|
||||
->setNewValue($this->getNewValue());
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -149,4 +149,8 @@ abstract class PhabricatorModularTransaction
|
|||
return parent::renderChangeDetails($viewer);
|
||||
}
|
||||
|
||||
final protected function newRemarkupChanges() {
|
||||
return $this->getTransactionImplementation()->newRemarkupChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -67,6 +67,10 @@ abstract class PhabricatorModularTransactionType
|
|||
throw new PhutilMethodNotImplementedException();
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
return array();
|
||||
}
|
||||
|
||||
final public function setStorage(
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
$this->storage = $xaction;
|
||||
|
@ -253,4 +257,9 @@ abstract class PhabricatorModularTransactionType
|
|||
return ($target == PhabricatorApplicationTransaction::TARGET_TEXT);
|
||||
}
|
||||
|
||||
final protected function newRemarkupChange() {
|
||||
return id(new PhabricatorTransactionRemarkupChange())
|
||||
->setTransaction($this->getStorage());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue