mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-26 22:48:19 +01:00
Don't display inline comment's Reply in standalone view
Summary: NOTE: This is starting to be too hacky. Test Plan: View revision with inline diffs, verify that Reply is there. View standalone - no Reply. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2263
This commit is contained in:
parent
dec8acd803
commit
7e571994bc
3 changed files with 26 additions and 14 deletions
|
@ -202,7 +202,7 @@ final class DifferentialChangesetViewController extends DifferentialController {
|
||||||
|
|
||||||
if ($request->isAjax()) {
|
if ($request->isAjax()) {
|
||||||
// TODO: This is sort of lazy, the effect is just to not render "Edit"
|
// TODO: This is sort of lazy, the effect is just to not render "Edit"
|
||||||
// links on the "standalone view".
|
// and "Reply" links on the "standalone view".
|
||||||
$parser->setUser($request->getUser());
|
$parser->setUser($request->getUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1497,6 +1497,7 @@ final class DifferentialChangesetParser {
|
||||||
$edit = $user &&
|
$edit = $user &&
|
||||||
($comment->getAuthorPHID() == $user->getPHID()) &&
|
($comment->getAuthorPHID() == $user->getPHID()) &&
|
||||||
($comment->isDraft());
|
($comment->isDraft());
|
||||||
|
$allow_reply = (bool)$this->user;
|
||||||
|
|
||||||
$on_right = $this->isCommentOnRightSideWhenDisplayed($comment);
|
$on_right = $this->isCommentOnRightSideWhenDisplayed($comment);
|
||||||
|
|
||||||
|
@ -1506,6 +1507,7 @@ final class DifferentialChangesetParser {
|
||||||
->setHandles($this->handles)
|
->setHandles($this->handles)
|
||||||
->setMarkupEngine($this->markupEngine)
|
->setMarkupEngine($this->markupEngine)
|
||||||
->setEditable($edit)
|
->setEditable($edit)
|
||||||
|
->setAllowReply($allow_reply)
|
||||||
->render();
|
->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
private $markupEngine;
|
private $markupEngine;
|
||||||
private $editable;
|
private $editable;
|
||||||
private $preview;
|
private $preview;
|
||||||
|
private $allowReply;
|
||||||
|
|
||||||
public function setInlineComment(PhabricatorInlineCommentInterface $comment) {
|
public function setInlineComment(PhabricatorInlineCommentInterface $comment) {
|
||||||
$this->inlineComment = $comment;
|
$this->inlineComment = $comment;
|
||||||
|
@ -62,6 +63,11 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setAllowReply($allow_reply) {
|
||||||
|
$this->allowReply = $allow_reply;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function render() {
|
public function render() {
|
||||||
|
|
||||||
$inline = $this->inlineComment;
|
$inline = $this->inlineComment;
|
||||||
|
@ -120,6 +126,8 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
),
|
),
|
||||||
'Next');
|
'Next');
|
||||||
|
|
||||||
|
if ($this->allowReply) {
|
||||||
|
|
||||||
if (!$is_synthetic) {
|
if (!$is_synthetic) {
|
||||||
|
|
||||||
// NOTE: No product reason why you can't reply to these, but the reply
|
// NOTE: No product reason why you can't reply to these, but the reply
|
||||||
|
@ -136,6 +144,8 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
),
|
),
|
||||||
'Reply');
|
'Reply');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$anchor_name = 'inline-'.$inline->getID();
|
$anchor_name = 'inline-'.$inline->getID();
|
||||||
|
|
Loading…
Add table
Reference in a new issue