Add draft support to ApplicationTransactions
Summary: When previewing, save drafts. When loading objects, restore drafts if they are available. Depends on: D665 Test Plan: - Viewed a Mock. - Typed text into the comment box. - Reloaded the page. - Text still there. - Hit submit, got my comment. - Reloaded the page. - Draft correctly deleted. - Repeated for Macros. Reviewers: btrahan, chad, vrana Reviewed By: btrahan CC: aran Maniphest Tasks: T2104 Differential Revision: https://secure.phabricator.com/D4252
This commit is contained in:
@@ -23,6 +23,7 @@ final class PhabricatorMacroCommentController
|
||||
}
|
||||
|
||||
$is_preview = $request->isPreviewRequest();
|
||||
$draft = PhabricatorDraft::buildFromRequest($request);
|
||||
|
||||
$view_uri = $this->getApplicationURI('/view/'.$macro->getID().'/');
|
||||
|
||||
@@ -52,6 +53,10 @@ final class PhabricatorMacroCommentController
|
||||
->setException($ex);
|
||||
}
|
||||
|
||||
if ($draft) {
|
||||
$draft->replaceOrDelete();
|
||||
}
|
||||
|
||||
if ($request->isAjax()) {
|
||||
return id(new PhabricatorApplicationTransactionResponse())
|
||||
->setViewer($user)
|
||||
|
||||
Reference in New Issue
Block a user