Move Subversion repository information to the new interface
Summary: Ref T2231. Moves "UUID" and "Subpath/Import Only" to Diffusion. Test Plan: See screenshots. Reviewers: btrahan, chad Reviewed By: btrahan CC: aran Maniphest Tasks: T2231 Differential Revision: https://secure.phabricator.com/D7400
This commit is contained in:
@@ -61,6 +61,13 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
$this->buildBranchesActions($repository));
|
||||
}
|
||||
|
||||
$subversion_properties = null;
|
||||
if ($is_svn) {
|
||||
$subversion_properties = $this->buildSubversionProperties(
|
||||
$repository,
|
||||
$this->buildSubversionActions($repository));
|
||||
}
|
||||
|
||||
$xactions = id(new PhabricatorRepositoryTransactionQuery())
|
||||
->setViewer($user)
|
||||
->withObjectPHIDs(array($repository->getPHID()))
|
||||
@@ -93,6 +100,10 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
$obj_box->addPropertyList($branches_properties);
|
||||
}
|
||||
|
||||
if ($subversion_properties) {
|
||||
$obj_box->addPropertyList($subversion_properties);
|
||||
}
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
@@ -330,5 +341,52 @@ final class DiffusionRepositoryEditController extends DiffusionController {
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildSubversionActions(PhabricatorRepository $repository) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setObjectURI($this->getRequest()->getRequestURI())
|
||||
->setUser($viewer);
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$repository,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$edit = id(new PhabricatorActionView())
|
||||
->setIcon('edit')
|
||||
->setName(pht('Edit Subversion Info'))
|
||||
->setHref(
|
||||
$this->getRepositoryControllerURI($repository, 'edit/subversion/'))
|
||||
->setWorkflow(!$can_edit)
|
||||
->setDisabled(!$can_edit);
|
||||
$view->addAction($edit);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
private function buildSubversionProperties(
|
||||
PhabricatorRepository $repository,
|
||||
PhabricatorActionListView $actions) {
|
||||
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$view = id(new PHUIPropertyListView())
|
||||
->setUser($viewer)
|
||||
->setActionList($actions)
|
||||
->addSectionHeader(pht('Subversion'));
|
||||
|
||||
$svn_uuid = nonempty(
|
||||
$repository->getUUID(),
|
||||
phutil_tag('em', array(), pht('Not Configured')));
|
||||
$view->addProperty(pht('Subversion UUID'), $svn_uuid);
|
||||
|
||||
$svn_subpath = nonempty(
|
||||
$repository->getHumanReadableDetail('svn-subpath'),
|
||||
phutil_tag('em', array(), pht('Import Entire Repository')));
|
||||
$view->addProperty(pht('Import Only'), $svn_subpath);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user