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,19 +3,30 @@
|
||||
final class DiffusionInlineCommentPreviewController
|
||||
extends PhabricatorInlineCommentPreviewController {
|
||||
|
||||
private $commitPHID;
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->commitPHID = $data['phid'];
|
||||
}
|
||||
|
||||
protected function loadInlineComments() {
|
||||
$user = $this->getRequest()->getUser();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$inlines = PhabricatorAuditInlineComment::loadDraftComments(
|
||||
$user,
|
||||
$this->commitPHID);
|
||||
|
||||
return $inlines;
|
||||
return PhabricatorAuditInlineComment::loadDraftComments(
|
||||
$viewer,
|
||||
$this->getCommitPHID());
|
||||
}
|
||||
|
||||
protected function loadObjectOwnerPHID() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$commit = id(new DiffusionCommitQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($this->getCommitPHID()))
|
||||
->executeOne();
|
||||
if (!$commit) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $commit->getAuthorPHID();
|
||||
}
|
||||
|
||||
private function getCommitPHID() {
|
||||
return $this->getRequest()->getURIData('phid');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user