Page MenuHomePhabricator

D15867.diff
No OneTemporary

D15867.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -774,7 +774,6 @@
'DiffusionRepositoryStagingManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php',
'DiffusionRepositoryStatusManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStatusManagementPanel.php',
'DiffusionRepositoryStorageManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php',
- 'DiffusionRepositorySymbolsController' => 'applications/diffusion/controller/DiffusionRepositorySymbolsController.php',
'DiffusionRepositorySymbolsManagementPanel' => 'applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php',
'DiffusionRepositoryTag' => 'applications/diffusion/data/DiffusionRepositoryTag.php',
'DiffusionRepositoryTestAutomationController' => 'applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php',
@@ -4994,7 +4993,6 @@
'DiffusionRepositoryStagingManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositoryStatusManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositoryStorageManagementPanel' => 'DiffusionRepositoryManagementPanel',
- 'DiffusionRepositorySymbolsController' => 'DiffusionRepositoryEditController',
'DiffusionRepositorySymbolsManagementPanel' => 'DiffusionRepositoryManagementPanel',
'DiffusionRepositoryTag' => 'Phobject',
'DiffusionRepositoryTestAutomationController' => 'DiffusionRepositoryEditController',
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php
@@ -13,7 +13,9 @@
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
+ $panel_uri = id(new DiffusionRepositoryBasicsManagementPanel())
+ ->setRepository($repository)
+ ->getPanelURI();
if ($request->isFormPost()) {
if (!$repository->isTracked()) {
@@ -33,24 +35,24 @@
->setActor($viewer)
->applyTransactions($repository, array($xaction));
- return id(new AphrontReloadResponse())->setURI($edit_uri);
+ return id(new AphrontReloadResponse())->setURI($panel_uri);
}
if ($repository->isTracked()) {
- return $this->newDialog()
- ->setTitle(pht('Deactivate Repository?'))
- ->appendChild(
- pht('Deactivate this repository?'))
- ->addSubmitButton(pht('Deactivate Repository'))
- ->addCancelButton($edit_uri);
+ $title = pht('Deactivate Repository');
+ $body = pht('Deactivate this repository?');
+ $submit = pht('Deactivate Repository');
} else {
- return $this->newDialog()
- ->setTitle(pht('Activate Repository?'))
- ->appendChild(
- pht('Activate this repository?'))
- ->addSubmitButton(pht('Activate Repository'))
- ->addCancelButton($edit_uri);
+ $title = pht('Activate Repository');
+ $body = pht('Activate this repository?');
+ $submit = pht('Activate Repository');
}
+
+ return $this->newDialog()
+ ->setTitle($title)
+ ->appendChild($body)
+ ->addSubmitButton($submit)
+ ->addCancelButton($panel_uri);
}
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditDangerousController.php
@@ -13,7 +13,9 @@
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
+ $panel_uri = id(new DiffusionRepositoryBasicsManagementPanel())
+ ->setRepository($repository)
+ ->getPanelURI();
if (!$repository->canAllowDangerousChanges()) {
if ($repository->isSVN()) {
@@ -24,7 +26,7 @@
'It is not possible for users to push any dangerous changes '.
'to a Subversion repository. Pushes to a Subversion repository '.
'can always be reverted and never destroy data.'))
- ->addCancelButton($edit_uri);
+ ->addCancelButton($panel_uri);
} else {
return $this->newDialog()
->setTitle(pht('Unprotectable Repository'))
@@ -33,7 +35,7 @@
'This repository can not be protected from dangerous changes '.
'because Phabricator does not control what users are allowed '.
'to push to it.'))
- ->addCancelButton($edit_uri);
+ ->addCancelButton($panel_uri);
}
}
@@ -48,33 +50,33 @@
->setActor($viewer)
->applyTransactions($repository, array($xaction));
- return id(new AphrontReloadResponse())->setURI($edit_uri);
+ return id(new AphrontReloadResponse())->setURI($panel_uri);
}
$force = phutil_tag('tt', array(), '--force');
if ($repository->shouldAllowDangerousChanges()) {
- return $this->newDialog()
- ->setTitle(pht('Prevent Dangerous changes?'))
- ->appendChild(
- pht(
- 'It will no longer be possible to delete branches from this '.
- 'repository, or %s push to this repository.',
- $force))
- ->addSubmitButton(pht('Prevent Dangerous Changes'))
- ->addCancelButton($edit_uri);
+ $title = pht('Prevent Dangerous Changes');
+ $body = pht(
+ 'It will no longer be possible to delete branches from this '.
+ 'repository, or %s push to this repository.',
+ $force);
+ $submit = pht('Prevent Dangerous Changes');
} else {
- return $this->newDialog()
- ->setTitle(pht('Allow Dangerous Changes?'))
- ->appendChild(
- pht(
- 'If you allow dangerous changes, it will be possible to delete '.
- 'branches and %s push this repository. These operations can '.
- 'alter a repository in a way that is difficult to recover from.',
- $force))
- ->addSubmitButton(pht('Allow Dangerous Changes'))
- ->addCancelButton($edit_uri);
+ $title = pht('Allow Dangerous Changes');
+ $body = pht(
+ 'If you allow dangerous changes, it will be possible to delete '.
+ 'branches and %s push this repository. These operations can '.
+ 'alter a repository in a way that is difficult to recover from.',
+ $force);
+ $submit = pht('Allow Dangerous Changes');
}
+
+ return $this->newDialog()
+ ->setTitle($title)
+ ->appendParagraph($body)
+ ->addSubmitButton($submit)
+ ->addCancelButton($panel_uri);
}
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
@@ -13,7 +13,9 @@
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
+ $panel_uri = id(new DiffusionRepositoryBasicsManagementPanel())
+ ->setRepository($repository)
+ ->getPanelURI();
$dialog = new AphrontDialogView();
$text_1 = pht(
@@ -40,7 +42,7 @@
return $this->newDialog()
->setTitle(pht('Really want to delete the repository?'))
->appendChild($body)
- ->addCancelButton($edit_uri, pht('Okay'));
+ ->addCancelButton($panel_uri, pht('Okay'));
}
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditUpdateController.php
@@ -13,7 +13,9 @@
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
+ $panel_uri = id(new DiffusionRepositoryStatusManagementPanel())
+ ->setRepository($repository)
+ ->getPanelURI();
if ($request->isFormPost()) {
$params = array(
@@ -26,7 +28,7 @@
->setUser($viewer)
->execute();
- return id(new AphrontRedirectResponse())->setURI($edit_uri);
+ return id(new AphrontRedirectResponse())->setURI($panel_uri);
}
$doc_name = 'Diffusion User Guide: Repository Updates';
@@ -58,7 +60,7 @@
'To learn more about how Phabricator updates repositories, '.
'read %s in the documentation.',
$doc_link))
- ->addCancelButton($edit_uri)
+ ->addCancelButton($panel_uri)
->addSubmitButton(pht('Schedule Update'));
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php b/src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
deleted file mode 100644
--- a/src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
+++ /dev/null
@@ -1,120 +0,0 @@
-<?php
-
-final class DiffusionRepositorySymbolsController
- extends DiffusionRepositoryEditController {
-
- public function handleRequest(AphrontRequest $request) {
- $response = $this->loadDiffusionContextForEdit();
- if ($response) {
- return $response;
- }
-
- $viewer = $this->getViewer();
- $drequest = $this->getDiffusionRequest();
- $repository = $drequest->getRepository();
-
- $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
-
- $v_sources = $repository->getSymbolSources();
- $v_languages = $repository->getSymbolLanguages();
- if ($v_languages) {
- $v_languages = implode(', ', $v_languages);
- }
- $errors = array();
-
- if ($request->isFormPost()) {
- $v_sources = $request->getArr('sources');
- $v_languages = $request->getStrList('languages');
- $v_languages = array_map('phutil_utf8_strtolower', $v_languages);
-
- if (!$errors) {
- $xactions = array();
- $template = id(new PhabricatorRepositoryTransaction());
-
- $type_sources = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_SOURCES;
- $type_lang = PhabricatorRepositoryTransaction::TYPE_SYMBOLS_LANGUAGE;
-
- $xactions[] = id(clone $template)
- ->setTransactionType($type_sources)
- ->setNewValue($v_sources);
-
- $xactions[] = id(clone $template)
- ->setTransactionType($type_lang)
- ->setNewValue($v_languages);
-
- try {
- id(new PhabricatorRepositoryEditor())
- ->setContinueOnNoEffect(true)
- ->setContentSourceFromRequest($request)
- ->setActor($viewer)
- ->applyTransactions($repository, $xactions);
-
- return id(new AphrontRedirectResponse())->setURI($edit_uri);
- } catch (Exception $ex) {
- $errors[] = $ex->getMessage();
- }
- }
- }
-
- $crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb(pht('Edit Symbols'));
-
- $title = pht('Edit Symbols (%s)', $repository->getName());
- $header = id(new PHUIHeaderView())
- ->setHeader($title)
- ->setHeaderIcon('fa-pencil');
-
- $form = id(new AphrontFormView())
- ->setUser($viewer)
- ->appendRemarkupInstructions($this->getInstructions())
- ->appendChild(
- id(new AphrontFormTextControl())
- ->setName('languages')
- ->setLabel(pht('Indexed Languages'))
- ->setCaption(pht(
- 'File extensions, separate with commas, for example: php, py. '.
- 'Leave blank for "any".'))
- ->setValue($v_languages))
-
- ->appendControl(
- id(new AphrontFormTokenizerControl())
- ->setName('sources')
- ->setLabel(pht('Uses Symbols From'))
- ->setDatasource(new DiffusionRepositoryDatasource())
- ->setValue($v_sources))
-
- ->appendChild(
- id(new AphrontFormSubmitControl())
- ->setValue(pht('Save'))
- ->addCancelButton($edit_uri));
-
- $form_box = id(new PHUIObjectBoxView())
- ->setHeaderText(pht('Symbols'))
- ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
- ->setForm($form)
- ->setFormErrors($errors);
-
- $view = id(new PHUITwoColumnView())
- ->setHeader($header)
- ->setFooter(array(
- $form_box,
- ));
-
- return $this->newPage()
- ->setTitle($title)
- ->setCrumbs($crumbs)
- ->appendChild($view);
- }
-
- private function getInstructions() {
- return pht(<<<EOT
-Configure Symbols for this repository.
-
-See [[%s | Symbol Indexes]] for more information on using symbols.
-EOT
- ,
- PhabricatorEnv::getDoclink(
- 'Diffusion User Guide: Symbol Indexes'));
- }
-
-}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php b/src/applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryTestAutomationController.php
@@ -13,7 +13,9 @@
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- $edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
+ $panel_uri = id(new DiffusionRepositoryAutomationManagementPanel())
+ ->setRepository($repository)
+ ->getPanelURI();
if (!$repository->canPerformAutomation()) {
return $this->newDialog()
@@ -23,7 +25,7 @@
'You can not run a configuration test for this repository '.
'because you have not configured repository automation yet. '.
'Configure it first, then test the configuration.'))
- ->addCancelButton($edit_uri);
+ ->addCancelButton($panel_uri);
}
if ($request->isFormPost()) {
@@ -63,7 +65,7 @@
'If you run into write failures despite passing this test, '.
'it suggests that your setup is nearly correct but authentication '.
'is probably not fully configured.'))
- ->addCancelButton($edit_uri)
+ ->addCancelButton($panel_uri)
->addSubmitButton(pht('Start Test'));
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 6:25 PM (2 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6739753
Default Alt Text
D15867.diff (14 KB)

Event Timeline