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:
epriestley
2012-02-27 13:00:23 -08:00
parent 3289059452
commit c7094d2def
11 changed files with 228 additions and 24 deletions

View File

@@ -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);
}