Differential D14945 Diff 36121 src/applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php
<?php | <?php | ||||
final class DiffusionRepositoryTestAutomationController | final class DiffusionRepositoryTestAutomationController | ||||
extends DiffusionRepositoryEditController { | extends DiffusionRepositoryEditController { | ||||
public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
$response = $this->loadDiffusionContext(); | $response = $this->loadDiffusionContextForEdit(); | ||||
if ($response) { | if ($response) { | ||||
return $response; | return $response; | ||||
} | } | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$drequest = $this->getDiffusionRequest(); | $drequest = $this->getDiffusionRequest(); | ||||
$repository = $drequest->getRepository(); | $repository = $drequest->getRepository(); | ||||
$repository = id(new PhabricatorRepositoryQuery()) | |||||
->setViewer($viewer) | |||||
->requireCapabilities( | |||||
array( | |||||
PhabricatorPolicyCapability::CAN_VIEW, | |||||
PhabricatorPolicyCapability::CAN_EDIT, | |||||
)) | |||||
->withIDs(array($repository->getID())) | |||||
->executeOne(); | |||||
if (!$repository) { | |||||
return new Aphront404Response(); | |||||
} | |||||
$edit_uri = $this->getRepositoryControllerURI($repository, 'edit/'); | $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/'); | ||||
if (!$repository->canPerformAutomation()) { | if (!$repository->canPerformAutomation()) { | ||||
return $this->newDialog() | return $this->newDialog() | ||||
->setTitle(pht('Automation Not Configured')) | ->setTitle(pht('Automation Not Configured')) | ||||
->appendParagraph( | ->appendParagraph( | ||||
pht( | pht( | ||||
'You can not run a configuration test for this repository '. | 'You can not run a configuration test for this repository '. | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |