Skip to content

Commit f801c7a

Browse files
committed
Change PhabricatorPhurlURLViewController to use EditEngine for commenting
Test Plan: Created a phurl, added some comments, confirmed that "Change Subscribers" and "Change Project Tags" are now available in the comment form. Reviewers: epriestley Reviewed By: epriestley Subscribers: chad, Korvin Maniphest Tasks: T11661 Differential Revision: https://secure.phabricator.com/D17686
1 parent b08b4cf commit f801c7a

File tree

4 files changed

+11
-81
lines changed

4 files changed

+11
-81
lines changed

src/__phutil_library_map__.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,6 @@
34453445
'PhabricatorPhurlURL' => 'applications/phurl/storage/PhabricatorPhurlURL.php',
34463446
'PhabricatorPhurlURLAccessController' => 'applications/phurl/controller/PhabricatorPhurlURLAccessController.php',
34473447
'PhabricatorPhurlURLAliasTransaction' => 'applications/phurl/xaction/PhabricatorPhurlURLAliasTransaction.php',
3448-
'PhabricatorPhurlURLCommentController' => 'applications/phurl/controller/PhabricatorPhurlURLCommentController.php',
34493448
'PhabricatorPhurlURLCreateCapability' => 'applications/phurl/capability/PhabricatorPhurlURLCreateCapability.php',
34503449
'PhabricatorPhurlURLDatasource' => 'applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php',
34513450
'PhabricatorPhurlURLDescriptionTransaction' => 'applications/phurl/xaction/PhabricatorPhurlURLDescriptionTransaction.php',
@@ -8711,7 +8710,6 @@
87118710
),
87128711
'PhabricatorPhurlURLAccessController' => 'PhabricatorPhurlController',
87138712
'PhabricatorPhurlURLAliasTransaction' => 'PhabricatorPhurlURLTransactionType',
8714-
'PhabricatorPhurlURLCommentController' => 'PhabricatorPhurlController',
87158713
'PhabricatorPhurlURLCreateCapability' => 'PhabricatorPolicyCapability',
87168714
'PhabricatorPhurlURLDatasource' => 'PhabricatorTypeaheadDatasource',
87178715
'PhabricatorPhurlURLDescriptionTransaction' => 'PhabricatorPhurlURLTransactionType',

src/applications/phurl/application/PhabricatorPhurlApplication.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public function getRoutes() {
4848
'url/' => array(
4949
$this->getEditRoutePattern('edit/')
5050
=> 'PhabricatorPhurlURLEditController',
51-
'comment/(?P<id>[1-9]\d*)/'
52-
=> 'PhabricatorPhurlURLCommentController',
5351
),
5452
),
5553
);

src/applications/phurl/controller/PhabricatorPhurlURLCommentController.php

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/applications/phurl/controller/PhabricatorPhurlURLViewController.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function handleRequest(AphrontRequest $request) {
3030
$timeline = $this->buildTransactionTimeline(
3131
$url,
3232
new PhabricatorPhurlURLTransactionQuery());
33+
$timeline->setQuoteRef($url->getMonogram());
3334

3435
$header = $this->buildHeaderView($url);
3536
$curtain = $this->buildCurtain($url);
@@ -39,20 +40,7 @@ public function handleRequest(AphrontRequest $request) {
3940
->setErrors(array(pht('This URL is invalid due to a bad protocol.')))
4041
->setIsHidden($url->isValid());
4142

42-
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
43-
$add_comment_header = $is_serious
44-
? pht('Add Comment')
45-
: pht('More Cowbell');
46-
$draft = PhabricatorDraft::newFromUserAndKey($viewer, $url->getPHID());
47-
$comment_uri = $this->getApplicationURI(
48-
'/url/comment/'.$url->getID().'/');
49-
$add_comment_form = id(new PhabricatorApplicationTransactionCommentView())
50-
->setUser($viewer)
51-
->setObjectPHID($url->getPHID())
52-
->setDraft($draft)
53-
->setHeaderText($add_comment_header)
54-
->setAction($comment_uri)
55-
->setSubmitButtonName(pht('Add Comment'));
43+
$add_comment_form = $this->buildCommentForm($url, $timeline);
5644

5745
$view = id(new PHUITwoColumnView())
5846
->setHeader($header)
@@ -72,7 +60,16 @@ public function handleRequest(AphrontRequest $request) {
7260
array(
7361
$view,
7462
));
63+
}
64+
65+
private function buildCommentForm(PhabricatorPhurlURL $url, $timeline) {
66+
$viewer = $this->getViewer();
67+
$box = id(new PhabricatorPhurlURLEditEngine())
68+
->setViewer($viewer)
69+
->buildEditEngineCommentView($url)
70+
->setTransactionTimeline($timeline);
7571

72+
return $box;
7673
}
7774

7875
private function buildHeaderView(PhabricatorPhurlURL $url) {

0 commit comments

Comments
 (0)