mirror of
https://we.phorge.it/source/phorge.git
synced 2025-04-07 01:48:30 +02:00
Hide irrelevant panels in Mercurial/Subversion, fix Subversion URIs
Summary: Ref T10923. - Hide "Automation", "Staging" and "Branches" in repositories where they do nothing. - Fix SVN SSH URIs to read "svn+ssh://" and have proper paths. Test Plan: - Verified irrelevant sections did not appear in Subversion in Manage UI. - Checked out a new hosted SVN repository. Reviewers: chad, avivey Reviewed By: avivey Maniphest Tasks: T10923 Differential Revision: https://secure.phabricator.com/D15874
This commit is contained in:
parent
e2bbde9675
commit
0b5ab2330d
6 changed files with 35 additions and 2 deletions
|
@ -27,11 +27,16 @@ final class DiffusionRepositoryManagePanelsController
|
||||||
|
|
||||||
$panels = DiffusionRepositoryManagementPanel::getAllPanels();
|
$panels = DiffusionRepositoryManagementPanel::getAllPanels();
|
||||||
|
|
||||||
foreach ($panels as $panel) {
|
foreach ($panels as $key => $panel) {
|
||||||
$panel
|
$panel
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->setRepository($repository)
|
->setRepository($repository)
|
||||||
->setController($this);
|
->setController($this);
|
||||||
|
|
||||||
|
if (!$panel->shouldEnableForRepository($repository)) {
|
||||||
|
unset($panels[$key]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$selected = $request->getURIData('panel');
|
$selected = $request->getURIData('panel');
|
||||||
|
|
|
@ -13,6 +13,11 @@ final class DiffusionRepositoryAutomationManagementPanel
|
||||||
return 800;
|
return 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shouldEnableForRepository(
|
||||||
|
PhabricatorRepository $repository) {
|
||||||
|
return $repository->isGit();
|
||||||
|
}
|
||||||
|
|
||||||
protected function getEditEngineFieldKeys() {
|
protected function getEditEngineFieldKeys() {
|
||||||
return array(
|
return array(
|
||||||
'automationBlueprintPHIDs',
|
'automationBlueprintPHIDs',
|
||||||
|
|
|
@ -13,6 +13,11 @@ final class DiffusionRepositoryBranchesManagementPanel
|
||||||
return 1000;
|
return 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shouldEnableForRepository(
|
||||||
|
PhabricatorRepository $repository) {
|
||||||
|
return ($repository->isGit() || $repository->isHg());
|
||||||
|
}
|
||||||
|
|
||||||
public function getManagementPanelIcon() {
|
public function getManagementPanelIcon() {
|
||||||
$repository = $this->getRepository();
|
$repository = $this->getRepository();
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,11 @@ abstract class DiffusionRepositoryManagementPanel
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shouldEnableForRepository(
|
||||||
|
PhabricatorRepository $repository) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
final protected function newActions() {
|
final protected function newActions() {
|
||||||
$actions = $this->buildManagementPanelActions();
|
$actions = $this->buildManagementPanelActions();
|
||||||
if (!$actions) {
|
if (!$actions) {
|
||||||
|
|
|
@ -13,6 +13,12 @@ final class DiffusionRepositoryStagingManagementPanel
|
||||||
return 700;
|
return 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shouldEnableForRepository(
|
||||||
|
PhabricatorRepository $repository) {
|
||||||
|
return $repository->isGit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getManagementPanelIcon() {
|
public function getManagementPanelIcon() {
|
||||||
$repository = $this->getRepository();
|
$repository = $this->getRepository();
|
||||||
|
|
||||||
|
|
|
@ -310,9 +310,15 @@ final class PhabricatorRepositoryURI
|
||||||
|
|
||||||
|
|
||||||
private function getForcedProtocol() {
|
private function getForcedProtocol() {
|
||||||
|
$repository = $this->getRepository();
|
||||||
|
|
||||||
switch ($this->getBuiltinProtocol()) {
|
switch ($this->getBuiltinProtocol()) {
|
||||||
case self::BUILTIN_PROTOCOL_SSH:
|
case self::BUILTIN_PROTOCOL_SSH:
|
||||||
|
if ($repository->isSVN()) {
|
||||||
|
return 'svn+ssh';
|
||||||
|
} else {
|
||||||
return 'ssh';
|
return 'ssh';
|
||||||
|
}
|
||||||
case self::BUILTIN_PROTOCOL_HTTP:
|
case self::BUILTIN_PROTOCOL_HTTP:
|
||||||
return 'http';
|
return 'http';
|
||||||
case self::BUILTIN_PROTOCOL_HTTPS:
|
case self::BUILTIN_PROTOCOL_HTTPS:
|
||||||
|
@ -382,6 +388,7 @@ final class PhabricatorRepositoryURI
|
||||||
$suffix = '/';
|
$suffix = '/';
|
||||||
} else {
|
} else {
|
||||||
$suffix = '';
|
$suffix = '';
|
||||||
|
$clone_name = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($this->getBuiltinIdentifier()) {
|
switch ($this->getBuiltinIdentifier()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue