Page MenuHomePhabricator

D12897.id31329.diff
No OneTemporary

D12897.id31329.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
@@ -2386,8 +2386,6 @@
'PhabricatorRepositoriesSetupCheck' => 'applications/config/check/PhabricatorRepositoriesSetupCheck.php',
'PhabricatorRepository' => 'applications/repository/storage/PhabricatorRepository.php',
'PhabricatorRepositoryArcanistProject' => 'applications/repository/storage/PhabricatorRepositoryArcanistProject.php',
- 'PhabricatorRepositoryArcanistProjectDeleteController' => 'applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php',
- 'PhabricatorRepositoryArcanistProjectEditController' => 'applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php',
'PhabricatorRepositoryArcanistProjectPHIDType' => 'applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php',
'PhabricatorRepositoryArcanistProjectQuery' => 'applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php',
'PhabricatorRepositoryAuditRequest' => 'applications/repository/storage/PhabricatorRepositoryAuditRequest.php',
@@ -5831,8 +5829,6 @@
'PhabricatorPolicyInterface',
'PhabricatorDestructibleInterface',
),
- 'PhabricatorRepositoryArcanistProjectDeleteController' => 'PhabricatorRepositoryController',
- 'PhabricatorRepositoryArcanistProjectEditController' => 'PhabricatorRepositoryController',
'PhabricatorRepositoryArcanistProjectPHIDType' => 'PhabricatorPHIDType',
'PhabricatorRepositoryArcanistProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorRepositoryAuditRequest' => array(
diff --git a/src/applications/repository/application/PhabricatorRepositoriesApplication.php b/src/applications/repository/application/PhabricatorRepositoriesApplication.php
--- a/src/applications/repository/application/PhabricatorRepositoriesApplication.php
+++ b/src/applications/repository/application/PhabricatorRepositoriesApplication.php
@@ -30,10 +30,6 @@
return array(
'/repository/' => array(
'' => 'PhabricatorRepositoryListController',
- 'project/edit/(?P<id>[1-9]\d*)/'
- => 'PhabricatorRepositoryArcanistProjectEditController',
- 'project/delete/(?P<id>[1-9]\d*)/'
- => 'PhabricatorRepositoryArcanistProjectDeleteController',
),
);
}
diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php
deleted file mode 100644
--- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-final class PhabricatorRepositoryArcanistProjectDeleteController
- extends PhabricatorRepositoryController {
-
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
-
- $arc_project =
- id(new PhabricatorRepositoryArcanistProject())->load($this->id);
- if (!$arc_project) {
- return new Aphront404Response();
- }
-
- $request = $this->getRequest();
-
- if ($request->isDialogFormPost()) {
- $arc_project->delete();
- return id(new AphrontRedirectResponse())->setURI('/repository/');
- }
-
- $dialog = new AphrontDialogView();
- $dialog
- ->setUser($request->getUser())
- ->setTitle(pht('Really delete this arcanist project?'))
- ->appendChild(
- pht(
- 'Really delete the "%s" arcanist project? '.
- 'This operation can not be undone.',
- $arc_project->getName()))
- ->setSubmitURI('/repository/project/delete/'.$this->id.'/')
- ->addSubmitButton(pht('Delete Arcanist Project'))
- ->addCancelButton('/repository/');
-
- return id(new AphrontDialogResponse())->setDialog($dialog);
- }
-}
diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
deleted file mode 100644
--- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-
-final class PhabricatorRepositoryArcanistProjectEditController
- extends PhabricatorRepositoryController {
-
- private $id;
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
-
- $request = $this->getRequest();
- $user = $request->getUser();
-
- $project = id(new PhabricatorRepositoryArcanistProject())->load($this->id);
- if (!$project) {
- return new Aphront404Response();
- }
-
- $repositories = id(new PhabricatorRepositoryQuery())
- ->setViewer($user)
- ->execute();
- $repos = array(
- 0 => 'None',
- );
- foreach ($repositories as $repository) {
- $callsign = $repository->getCallsign();
- $name = $repository->getname();
- $repos[$repository->getID()] = "r{$callsign} ({$name})";
- }
- // note "None" will still be first thanks to 'r' prefix
- asort($repos);
-
- if ($request->isFormPost()) {
- $repo_id = $request->getInt('repository', 0);
- if (isset($repos[$repo_id])) {
- $project->setRepositoryID($repo_id);
- $project->save();
-
- return id(new AphrontRedirectResponse())
- ->setURI('/repository/');
- }
- }
-
- $form = id(new AphrontFormView())
- ->setUser($user)
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel(pht('Name'))
- ->setValue($project->getName()))
- ->appendChild(
- id(new AphrontFormStaticControl())
- ->setLabel('PHID')
- ->setValue($project->getPHID()))
- ->appendChild(
- id(new AphrontFormSelectControl())
- ->setLabel(pht('Repository'))
- ->setOptions($repos)
- ->setName('repository')
- ->setValue($project->getRepositoryID()))
- ->appendChild(
- id(new AphrontFormSubmitControl())
- ->addCancelButton('/repository/')
- ->setValue(pht('Save')));
-
- $panel = new PHUIObjectBoxView();
- $panel->setHeaderText(pht('Edit Arcanist Project'));
- $panel->setForm($form);
-
- $crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb(pht('Edit Project'));
-
- return $this->buildApplicationPage(
- array(
- $crumbs,
- $panel,
- ),
- array(
- 'title' => pht('Edit Project'),
- ));
- }
-
-}
diff --git a/src/applications/repository/controller/PhabricatorRepositoryListController.php b/src/applications/repository/controller/PhabricatorRepositoryListController.php
--- a/src/applications/repository/controller/PhabricatorRepositoryListController.php
+++ b/src/applications/repository/controller/PhabricatorRepositoryListController.php
@@ -85,68 +85,6 @@
$panel->setHeader($header);
$panel->appendChild($table);
- $projects = id(new PhabricatorRepositoryArcanistProject())->loadAll();
-
- $rows = array();
- foreach ($projects as $project) {
- $repo = idx($repos, $project->getRepositoryID());
- if ($repo) {
- $repo_name = $repo->getName();
- } else {
- $repo_name = '-';
- }
-
- $rows[] = array(
- $project->getName(),
- $repo_name,
- phutil_tag(
- 'a',
- array(
- 'href' => '/repository/project/edit/'.$project->getID().'/',
- 'class' => 'button grey small',
- ),
- pht('Edit')),
- javelin_tag(
- 'a',
- array(
- 'href' => '/repository/project/delete/'.$project->getID().'/',
- 'class' => 'button grey small',
- 'sigil' => 'workflow',
- ),
- pht('Delete')),
- );
-
- }
-
- $project_table = new AphrontTableView($rows);
- $project_table->setNoDataString(pht('No Arcanist Projects'));
- $project_table->setHeaders(
- array(
- pht('Project ID'),
- pht('Repository'),
- '',
- '',
- ));
- $project_table->setColumnClasses(
- array(
- '',
- 'wide',
- 'action',
- 'action',
- ));
-
- $project_table->setColumnVisibility(
- array(
- true,
- true,
- $is_admin,
- $is_admin,
- ));
-
- $project_panel = new PHUIObjectBoxView();
- $project_panel->setHeaderText(pht('Arcanist Projects'));
- $project_panel->appendChild($project_table);
-
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Repository List'));
@@ -154,7 +92,6 @@
array(
$crumbs,
$panel,
- $project_panel,
),
array(
'title' => pht('Repository List'),

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 21, 5:21 PM (4 w, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6739652
Default Alt Text
D12897.id31329.diff (8 KB)

Event Timeline