1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Remove the obsolete "DiffusionInlineCommentPreviewController"

Summary: Ref T13513. This controller was obsoleted by EditEngine and appears unreachable without explicitly typing the URL.

Test Plan:
  - Grepped for the route, didn't find any hits.
  - Deleted the controller, successfully previewed comments in Diffusion.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21224
This commit is contained in:
epriestley 2020-05-04 16:24:53 -07:00
parent a590db28b2
commit 0067f1a521
4 changed files with 0 additions and 85 deletions

View file

@ -877,7 +877,6 @@ phutil_register_library_map(array(
'DiffusionIdentityUnassignedDatasource' => 'applications/diffusion/typeahead/DiffusionIdentityUnassignedDatasource.php', 'DiffusionIdentityUnassignedDatasource' => 'applications/diffusion/typeahead/DiffusionIdentityUnassignedDatasource.php',
'DiffusionIdentityViewController' => 'applications/diffusion/controller/DiffusionIdentityViewController.php', 'DiffusionIdentityViewController' => 'applications/diffusion/controller/DiffusionIdentityViewController.php',
'DiffusionInlineCommentController' => 'applications/diffusion/controller/DiffusionInlineCommentController.php', 'DiffusionInlineCommentController' => 'applications/diffusion/controller/DiffusionInlineCommentController.php',
'DiffusionInlineCommentPreviewController' => 'applications/diffusion/controller/DiffusionInlineCommentPreviewController.php',
'DiffusionInternalAncestorsConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalAncestorsConduitAPIMethod.php', 'DiffusionInternalAncestorsConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalAncestorsConduitAPIMethod.php',
'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalGitRawDiffQueryConduitAPIMethod.php', 'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalGitRawDiffQueryConduitAPIMethod.php',
'DiffusionLastModifiedController' => 'applications/diffusion/controller/DiffusionLastModifiedController.php', 'DiffusionLastModifiedController' => 'applications/diffusion/controller/DiffusionLastModifiedController.php',
@ -3594,7 +3593,6 @@ phutil_register_library_map(array(
'PhabricatorInfrastructureTestCase' => '__tests__/PhabricatorInfrastructureTestCase.php', 'PhabricatorInfrastructureTestCase' => '__tests__/PhabricatorInfrastructureTestCase.php',
'PhabricatorInlineComment' => 'infrastructure/diff/interface/PhabricatorInlineComment.php', 'PhabricatorInlineComment' => 'infrastructure/diff/interface/PhabricatorInlineComment.php',
'PhabricatorInlineCommentController' => 'infrastructure/diff/PhabricatorInlineCommentController.php', 'PhabricatorInlineCommentController' => 'infrastructure/diff/PhabricatorInlineCommentController.php',
'PhabricatorInlineCommentPreviewController' => 'infrastructure/diff/PhabricatorInlineCommentPreviewController.php',
'PhabricatorInlineSummaryView' => 'infrastructure/diff/view/PhabricatorInlineSummaryView.php', 'PhabricatorInlineSummaryView' => 'infrastructure/diff/view/PhabricatorInlineSummaryView.php',
'PhabricatorInstructionsEditField' => 'applications/transactions/editfield/PhabricatorInstructionsEditField.php', 'PhabricatorInstructionsEditField' => 'applications/transactions/editfield/PhabricatorInstructionsEditField.php',
'PhabricatorIntConfigType' => 'applications/config/type/PhabricatorIntConfigType.php', 'PhabricatorIntConfigType' => 'applications/config/type/PhabricatorIntConfigType.php',
@ -6968,7 +6966,6 @@ phutil_register_library_map(array(
'DiffusionIdentityUnassignedDatasource' => 'PhabricatorTypeaheadDatasource', 'DiffusionIdentityUnassignedDatasource' => 'PhabricatorTypeaheadDatasource',
'DiffusionIdentityViewController' => 'DiffusionController', 'DiffusionIdentityViewController' => 'DiffusionController',
'DiffusionInlineCommentController' => 'PhabricatorInlineCommentController', 'DiffusionInlineCommentController' => 'PhabricatorInlineCommentController',
'DiffusionInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController',
'DiffusionInternalAncestorsConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 'DiffusionInternalAncestorsConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
'DiffusionLastModifiedController' => 'DiffusionController', 'DiffusionLastModifiedController' => 'DiffusionController',
@ -10115,7 +10112,6 @@ phutil_register_library_map(array(
'PhabricatorMarkupInterface', 'PhabricatorMarkupInterface',
), ),
'PhabricatorInlineCommentController' => 'PhabricatorController', 'PhabricatorInlineCommentController' => 'PhabricatorController',
'PhabricatorInlineCommentPreviewController' => 'PhabricatorController',
'PhabricatorInlineSummaryView' => 'AphrontView', 'PhabricatorInlineSummaryView' => 'AphrontView',
'PhabricatorInstructionsEditField' => 'PhabricatorEditField', 'PhabricatorInstructionsEditField' => 'PhabricatorEditField',
'PhabricatorIntConfigType' => 'PhabricatorTextConfigType', 'PhabricatorIntConfigType' => 'PhabricatorTextConfigType',

View file

@ -140,8 +140,6 @@ final class PhabricatorDiffusionApplication extends PhabricatorApplication {
'inline/' => array( 'inline/' => array(
'edit/(?P<phid>[^/]+)/' => 'DiffusionInlineCommentController', 'edit/(?P<phid>[^/]+)/' => 'DiffusionInlineCommentController',
'preview/(?P<phid>[^/]+)/'
=> 'DiffusionInlineCommentPreviewController',
), ),
'services/' => array( 'services/' => array(
'path/' => array( 'path/' => array(

View file

@ -1,32 +0,0 @@
<?php
final class DiffusionInlineCommentPreviewController
extends PhabricatorInlineCommentPreviewController {
protected function loadInlineComments() {
$viewer = $this->getViewer();
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');
}
}

View file

@ -1,47 +0,0 @@
<?php
abstract class PhabricatorInlineCommentPreviewController
extends PhabricatorController {
abstract protected function loadInlineComments();
abstract protected function loadObjectOwnerPHID();
public function processRequest() {
$request = $this->getRequest();
$viewer = $request->getUser();
$inlines = $this->loadInlineComments();
assert_instances_of($inlines, 'PhabricatorInlineComment');
$engine = new PhabricatorMarkupEngine();
$engine->setViewer($viewer);
foreach ($inlines as $inline) {
$engine->addObject(
$inline,
PhabricatorInlineComment::MARKUP_FIELD_BODY);
}
$engine->process();
$phids = array($viewer->getPHID());
$handles = $this->loadViewerHandles($phids);
$object_owner_phid = $this->loadObjectOwnerPHID();
$views = array();
foreach ($inlines as $inline) {
$view = id(new PHUIDiffInlineCommentDetailView())
->setUser($viewer)
->setInlineComment($inline)
->setMarkupEngine($engine)
->setHandles($handles)
->setEditable(false)
->setPreview(true)
->setCanMarkDone(false)
->setObjectOwnerPHID($object_owner_phid);
$views[] = $view->render();
}
$views = phutil_implode_html("\n", $views);
return id(new AphrontAjaxResponse())
->setContent($views);
}
}