Skip to content

Commit 983d778

Browse files
author
epriestley
committed
Move the "Inline List" view to "DiffInlineCommentQuery"
Summary: Ref T13513. Continue removing usage sites for the obsolete "DifferentialInlineCommentQuery". Test Plan: Viewed the inline list in Differential, saw sensible inlines. Maniphest Tasks: T13513 Differential Revision: https://secure.phabricator.com/D21232
1 parent af5b94b commit 983d778

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

src/applications/differential/controller/DifferentialRevisionInlinesController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ public function handleRequest(AphrontRequest $request) {
2424
$revision_uri = $revision->getURI();
2525
$revision_title = $revision->getTitle();
2626

27-
$query = id(new DifferentialInlineCommentQuery())
27+
$inlines = id(new DifferentialDiffInlineCommentQuery())
2828
->setViewer($viewer)
29-
->needHidden(true)
30-
->withRevisionPHIDs(array($revision->getPHID()));
31-
$inlines = $query->execute();
29+
->withRevisionPHIDs(array($revision->getPHID()))
30+
->withPublishedComments(true)
31+
->execute();
32+
$inlines = mpull($inlines, 'newInlineCommentObject');
3233

3334
$crumbs = $this->buildApplicationCrumbs();
3435
$crumbs->addTextCrumb($revision_monogram, $revision_uri);

src/applications/diffusion/controller/DiffusionCommitController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ public function handleRequest(AphrontRequest $request) {
418418
$inlines = id(new DiffusionDiffInlineCommentQuery())
419419
->setViewer($viewer)
420420
->withCommitPHIDs(array($commit->getPHID()))
421-
->withVisibleComments(true)
421+
->withPublishedComments(true)
422+
->withPublishableComments(true)
422423
->execute();
423424
$inlines = mpull($inlines, 'newInlineCommentObject');
424425

src/applications/diffusion/controller/DiffusionDiffController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public function handleRequest(AphrontRequest $request) {
103103
->setViewer($viewer)
104104
->withCommitPHIDs(array($commit->getPHID()))
105105
->withPathIDs(array($path_id))
106-
->withVisibleComments(true)
106+
->withPublishedComments(true)
107+
->withPublishableComments(true)
107108
->execute();
108109
$inlines = mpull($inlines, 'newInlineCommentObject');
109110

src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abstract class PhabricatorDiffInlineCommentQuery
55

66
private $fixedStates;
77
private $needReplyToComments;
8-
private $visibleComments;
8+
private $publishedComments;
99
private $publishableComments;
1010

1111
abstract protected function buildInlineCommentWhereClauseParts(
@@ -22,13 +22,13 @@ public function needReplyToComments($need_reply_to) {
2222
return $this;
2323
}
2424

25-
public function withVisibleComments($with_visible) {
26-
$this->visibleComments = $with_visible;
25+
public function withPublishableComments($with_publishable) {
26+
$this->publishableComments = $with_publishable;
2727
return $this;
2828
}
2929

30-
public function withPublishableComments($with_publishable) {
31-
$this->publishableComments = $with_publishable;
30+
public function withPublishedComments($with_published) {
31+
$this->publishedComments = $with_published;
3232
return $this;
3333
}
3434

@@ -51,32 +51,30 @@ protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
5151
$show_published = false;
5252
$show_publishable = false;
5353

54-
if ($this->visibleComments !== null) {
55-
if (!$this->visibleComments) {
54+
if ($this->publishableComments !== null) {
55+
if (!$this->publishableComments) {
5656
throw new Exception(
5757
pht(
58-
'Querying for comments that are not visible is '.
58+
'Querying for comments that are "not publishable" is '.
5959
'not supported.'));
6060
}
61-
$show_published = true;
6261
$show_publishable = true;
6362
}
6463

65-
if ($this->publishableComments !== null) {
66-
if (!$this->publishableComments) {
64+
if ($this->publishedComments !== null) {
65+
if (!$this->publishedComments) {
6766
throw new Exception(
6867
pht(
69-
'Querying for comments that are not publishable is '.
68+
'Querying for comments that are "not published" is '.
7069
'not supported.'));
7170
}
72-
$show_publishable = true;
71+
$show_published = true;
7372
}
7473

7574
if ($show_publishable || $show_published) {
7675
$clauses = array();
7776

7877
if ($show_published) {
79-
// Published comments are always visible.
8078
$clauses[] = qsprintf(
8179
$conn,
8280
'%T.transactionPHID IS NOT NULL',

0 commit comments

Comments
 (0)