Add preview and drafts to audits
Summary: Add comment previews and saved drafts to audits, like Maniphest / Differential. Test Plan: Typed stuff into the box. Got a preview. Reloaded page. Stuff was still there. Submitted comment. Stuff is gone. Reviewers: btrahan, jungejason Reviewed By: btrahan CC: aran, epriestley Maniphest Tasks: T904 Differential Revision: https://secure.phabricator.com/D1699
This commit is contained in:
@@ -40,6 +40,7 @@ final class PhabricatorAuditAddCommentController
|
||||
->setAction($request->getStr('action'))
|
||||
->setContent($request->getStr('content'));
|
||||
|
||||
|
||||
id(new PhabricatorAuditCommentEditor($commit))
|
||||
->setUser($user)
|
||||
->addComment($comment);
|
||||
@@ -48,6 +49,14 @@ final class PhabricatorAuditAddCommentController
|
||||
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
||||
$uri = $handles[$commit_phid]->getURI();
|
||||
|
||||
$draft = id(new PhabricatorDraft())->loadOneWhere(
|
||||
'authorPHID = %s AND draftKey = %s',
|
||||
$user->getPHID(),
|
||||
'diffusion-audit-'.$commit->getID());
|
||||
if ($draft) {
|
||||
$draft->delete();
|
||||
}
|
||||
|
||||
return id(new AphrontRedirectResponse())->setURI($uri);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user