Touch up PHP/JS interactions for inline comments
Summary: Ref T1460. Overall: - Pass `objectOwnerPHID` consistently. - Pass viewer consistently. - Set the correct draft state for checkboxes on the client. Test Plan: - Made inline comments in Differential. - Made inline comments in Diffusion. Reviewers: chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T1460 Differential Revision: https://secure.phabricator.com/D12186
This commit is contained in:
@@ -3,20 +3,30 @@
|
||||
final class DifferentialInlineCommentPreviewController
|
||||
extends PhabricatorInlineCommentPreviewController {
|
||||
|
||||
private $revisionID;
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->revisionID = $data['id'];
|
||||
}
|
||||
|
||||
protected function loadInlineComments() {
|
||||
$user = $this->getRequest()->getUser();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$inlines = id(new DifferentialInlineCommentQuery())
|
||||
->withDraftComments($user->getPHID(), $this->revisionID)
|
||||
return id(new DifferentialInlineCommentQuery())
|
||||
->withDraftComments($viewer->getPHID(), $this->getRevisionID())
|
||||
->execute();
|
||||
|
||||
return $inlines;
|
||||
}
|
||||
|
||||
protected function loadObjectOwnerPHID() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$revision = id(new DifferentialRevisionQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($this->getRevisionID()))
|
||||
->executeOne();
|
||||
if (!$revision) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $revision->getAuthorPHID();
|
||||
}
|
||||
|
||||
|
||||
private function getRevisionID() {
|
||||
return $this->getRequest()->getURIData('id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user