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:
parent
a590db28b2
commit
0067f1a521
4 changed files with 0 additions and 85 deletions
|
@ -877,7 +877,6 @@ phutil_register_library_map(array(
|
|||
'DiffusionIdentityUnassignedDatasource' => 'applications/diffusion/typeahead/DiffusionIdentityUnassignedDatasource.php',
|
||||
'DiffusionIdentityViewController' => 'applications/diffusion/controller/DiffusionIdentityViewController.php',
|
||||
'DiffusionInlineCommentController' => 'applications/diffusion/controller/DiffusionInlineCommentController.php',
|
||||
'DiffusionInlineCommentPreviewController' => 'applications/diffusion/controller/DiffusionInlineCommentPreviewController.php',
|
||||
'DiffusionInternalAncestorsConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalAncestorsConduitAPIMethod.php',
|
||||
'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionInternalGitRawDiffQueryConduitAPIMethod.php',
|
||||
'DiffusionLastModifiedController' => 'applications/diffusion/controller/DiffusionLastModifiedController.php',
|
||||
|
@ -3594,7 +3593,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorInfrastructureTestCase' => '__tests__/PhabricatorInfrastructureTestCase.php',
|
||||
'PhabricatorInlineComment' => 'infrastructure/diff/interface/PhabricatorInlineComment.php',
|
||||
'PhabricatorInlineCommentController' => 'infrastructure/diff/PhabricatorInlineCommentController.php',
|
||||
'PhabricatorInlineCommentPreviewController' => 'infrastructure/diff/PhabricatorInlineCommentPreviewController.php',
|
||||
'PhabricatorInlineSummaryView' => 'infrastructure/diff/view/PhabricatorInlineSummaryView.php',
|
||||
'PhabricatorInstructionsEditField' => 'applications/transactions/editfield/PhabricatorInstructionsEditField.php',
|
||||
'PhabricatorIntConfigType' => 'applications/config/type/PhabricatorIntConfigType.php',
|
||||
|
@ -6968,7 +6966,6 @@ phutil_register_library_map(array(
|
|||
'DiffusionIdentityUnassignedDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'DiffusionIdentityViewController' => 'DiffusionController',
|
||||
'DiffusionInlineCommentController' => 'PhabricatorInlineCommentController',
|
||||
'DiffusionInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController',
|
||||
'DiffusionInternalAncestorsConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
||||
'DiffusionInternalGitRawDiffQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
||||
'DiffusionLastModifiedController' => 'DiffusionController',
|
||||
|
@ -10115,7 +10112,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorMarkupInterface',
|
||||
),
|
||||
'PhabricatorInlineCommentController' => 'PhabricatorController',
|
||||
'PhabricatorInlineCommentPreviewController' => 'PhabricatorController',
|
||||
'PhabricatorInlineSummaryView' => 'AphrontView',
|
||||
'PhabricatorInstructionsEditField' => 'PhabricatorEditField',
|
||||
'PhabricatorIntConfigType' => 'PhabricatorTextConfigType',
|
||||
|
|
|
@ -140,8 +140,6 @@ final class PhabricatorDiffusionApplication extends PhabricatorApplication {
|
|||
|
||||
'inline/' => array(
|
||||
'edit/(?P<phid>[^/]+)/' => 'DiffusionInlineCommentController',
|
||||
'preview/(?P<phid>[^/]+)/'
|
||||
=> 'DiffusionInlineCommentPreviewController',
|
||||
),
|
||||
'services/' => array(
|
||||
'path/' => array(
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue