mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +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()) {
|
||||
// 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());
|
||||
}
|
||||
|
||||
|
|
|
@ -1497,6 +1497,7 @@ final class DifferentialChangesetParser {
|
|||
$edit = $user &&
|
||||
($comment->getAuthorPHID() == $user->getPHID()) &&
|
||||
($comment->isDraft());
|
||||
$allow_reply = (bool)$this->user;
|
||||
|
||||
$on_right = $this->isCommentOnRightSideWhenDisplayed($comment);
|
||||
|
||||
|
@ -1506,6 +1507,7 @@ final class DifferentialChangesetParser {
|
|||
->setHandles($this->handles)
|
||||
->setMarkupEngine($this->markupEngine)
|
||||
->setEditable($edit)
|
||||
->setAllowReply($allow_reply)
|
||||
->render();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
private $markupEngine;
|
||||
private $editable;
|
||||
private $preview;
|
||||
private $allowReply;
|
||||
|
||||
public function setInlineComment(PhabricatorInlineCommentInterface $comment) {
|
||||
$this->inlineComment = $comment;
|
||||
|
@ -62,6 +63,11 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setAllowReply($allow_reply) {
|
||||
$this->allowReply = $allow_reply;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
$inline = $this->inlineComment;
|
||||
|
@ -120,21 +126,25 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
),
|
||||
'Next');
|
||||
|
||||
if (!$is_synthetic) {
|
||||
if ($this->allowReply) {
|
||||
|
||||
// NOTE: No product reason why you can't reply to these, but the reply
|
||||
// mechanism currently sends the inline comment ID to the server, not
|
||||
// file/line information, and synthetic comments don't have an inline
|
||||
// comment ID.
|
||||
if (!$is_synthetic) {
|
||||
|
||||
// NOTE: No product reason why you can't reply to these, but the reply
|
||||
// mechanism currently sends the inline comment ID to the server, not
|
||||
// file/line information, and synthetic comments don't have an inline
|
||||
// comment ID.
|
||||
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-reply',
|
||||
),
|
||||
'Reply');
|
||||
}
|
||||
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-reply',
|
||||
),
|
||||
'Reply');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue