@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove "arcanist project" controllers

Summary: Ref T7603. Ref T7604. There is no need for these controllers anymore as the "Arcanist Project" data is not used anywhere. Depends on D12894 and D12898.

Test Plan: Went to `/repository/project/edit/2/` and got a 404.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7603, T7604

Differential Revision: https://secure.phabricator.com/D12897

-198
-4
src/__phutil_library_map__.php
··· 2387 2387 'PhabricatorRepositoriesSetupCheck' => 'applications/config/check/PhabricatorRepositoriesSetupCheck.php', 2388 2388 'PhabricatorRepository' => 'applications/repository/storage/PhabricatorRepository.php', 2389 2389 'PhabricatorRepositoryArcanistProject' => 'applications/repository/storage/PhabricatorRepositoryArcanistProject.php', 2390 - 'PhabricatorRepositoryArcanistProjectDeleteController' => 'applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php', 2391 - 'PhabricatorRepositoryArcanistProjectEditController' => 'applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php', 2392 2390 'PhabricatorRepositoryArcanistProjectPHIDType' => 'applications/repository/phid/PhabricatorRepositoryArcanistProjectPHIDType.php', 2393 2391 'PhabricatorRepositoryArcanistProjectQuery' => 'applications/repository/query/PhabricatorRepositoryArcanistProjectQuery.php', 2394 2392 'PhabricatorRepositoryAuditRequest' => 'applications/repository/storage/PhabricatorRepositoryAuditRequest.php', ··· 5832 5830 'PhabricatorPolicyInterface', 5833 5831 'PhabricatorDestructibleInterface', 5834 5832 ), 5835 - 'PhabricatorRepositoryArcanistProjectDeleteController' => 'PhabricatorRepositoryController', 5836 - 'PhabricatorRepositoryArcanistProjectEditController' => 'PhabricatorRepositoryController', 5837 5833 'PhabricatorRepositoryArcanistProjectPHIDType' => 'PhabricatorPHIDType', 5838 5834 'PhabricatorRepositoryArcanistProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 5839 5835 'PhabricatorRepositoryAuditRequest' => array(
-4
src/applications/repository/application/PhabricatorRepositoriesApplication.php
··· 30 30 return array( 31 31 '/repository/' => array( 32 32 '' => 'PhabricatorRepositoryListController', 33 - 'project/edit/(?P<id>[1-9]\d*)/' 34 - => 'PhabricatorRepositoryArcanistProjectEditController', 35 - 'project/delete/(?P<id>[1-9]\d*)/' 36 - => 'PhabricatorRepositoryArcanistProjectDeleteController', 37 33 ), 38 34 ); 39 35 }
-42
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryArcanistProjectDeleteController 4 - extends PhabricatorRepositoryController { 5 - 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['id']; 10 - } 11 - 12 - public function processRequest() { 13 - 14 - $arc_project = 15 - id(new PhabricatorRepositoryArcanistProject())->load($this->id); 16 - if (!$arc_project) { 17 - return new Aphront404Response(); 18 - } 19 - 20 - $request = $this->getRequest(); 21 - 22 - if ($request->isDialogFormPost()) { 23 - $arc_project->delete(); 24 - return id(new AphrontRedirectResponse())->setURI('/repository/'); 25 - } 26 - 27 - $dialog = new AphrontDialogView(); 28 - $dialog 29 - ->setUser($request->getUser()) 30 - ->setTitle(pht('Really delete this arcanist project?')) 31 - ->appendChild( 32 - pht( 33 - 'Really delete the "%s" arcanist project? '. 34 - 'This operation can not be undone.', 35 - $arc_project->getName())) 36 - ->setSubmitURI('/repository/project/delete/'.$this->id.'/') 37 - ->addSubmitButton(pht('Delete Arcanist Project')) 38 - ->addCancelButton('/repository/'); 39 - 40 - return id(new AphrontDialogResponse())->setDialog($dialog); 41 - } 42 - }
-85
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
··· 1 - <?php 2 - 3 - final class PhabricatorRepositoryArcanistProjectEditController 4 - extends PhabricatorRepositoryController { 5 - 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['id']; 10 - } 11 - 12 - public function processRequest() { 13 - 14 - $request = $this->getRequest(); 15 - $user = $request->getUser(); 16 - 17 - $project = id(new PhabricatorRepositoryArcanistProject())->load($this->id); 18 - if (!$project) { 19 - return new Aphront404Response(); 20 - } 21 - 22 - $repositories = id(new PhabricatorRepositoryQuery()) 23 - ->setViewer($user) 24 - ->execute(); 25 - $repos = array( 26 - 0 => 'None', 27 - ); 28 - foreach ($repositories as $repository) { 29 - $callsign = $repository->getCallsign(); 30 - $name = $repository->getname(); 31 - $repos[$repository->getID()] = "r{$callsign} ({$name})"; 32 - } 33 - // note "None" will still be first thanks to 'r' prefix 34 - asort($repos); 35 - 36 - if ($request->isFormPost()) { 37 - $repo_id = $request->getInt('repository', 0); 38 - if (isset($repos[$repo_id])) { 39 - $project->setRepositoryID($repo_id); 40 - $project->save(); 41 - 42 - return id(new AphrontRedirectResponse()) 43 - ->setURI('/repository/'); 44 - } 45 - } 46 - 47 - $form = id(new AphrontFormView()) 48 - ->setUser($user) 49 - ->appendChild( 50 - id(new AphrontFormStaticControl()) 51 - ->setLabel(pht('Name')) 52 - ->setValue($project->getName())) 53 - ->appendChild( 54 - id(new AphrontFormStaticControl()) 55 - ->setLabel('PHID') 56 - ->setValue($project->getPHID())) 57 - ->appendChild( 58 - id(new AphrontFormSelectControl()) 59 - ->setLabel(pht('Repository')) 60 - ->setOptions($repos) 61 - ->setName('repository') 62 - ->setValue($project->getRepositoryID())) 63 - ->appendChild( 64 - id(new AphrontFormSubmitControl()) 65 - ->addCancelButton('/repository/') 66 - ->setValue(pht('Save'))); 67 - 68 - $panel = new PHUIObjectBoxView(); 69 - $panel->setHeaderText(pht('Edit Arcanist Project')); 70 - $panel->setForm($form); 71 - 72 - $crumbs = $this->buildApplicationCrumbs(); 73 - $crumbs->addTextCrumb(pht('Edit Project')); 74 - 75 - return $this->buildApplicationPage( 76 - array( 77 - $crumbs, 78 - $panel, 79 - ), 80 - array( 81 - 'title' => pht('Edit Project'), 82 - )); 83 - } 84 - 85 - }
-63
src/applications/repository/controller/PhabricatorRepositoryListController.php
··· 85 85 $panel->setHeader($header); 86 86 $panel->appendChild($table); 87 87 88 - $projects = id(new PhabricatorRepositoryArcanistProject())->loadAll(); 89 - 90 - $rows = array(); 91 - foreach ($projects as $project) { 92 - $repo = idx($repos, $project->getRepositoryID()); 93 - if ($repo) { 94 - $repo_name = $repo->getName(); 95 - } else { 96 - $repo_name = '-'; 97 - } 98 - 99 - $rows[] = array( 100 - $project->getName(), 101 - $repo_name, 102 - phutil_tag( 103 - 'a', 104 - array( 105 - 'href' => '/repository/project/edit/'.$project->getID().'/', 106 - 'class' => 'button grey small', 107 - ), 108 - pht('Edit')), 109 - javelin_tag( 110 - 'a', 111 - array( 112 - 'href' => '/repository/project/delete/'.$project->getID().'/', 113 - 'class' => 'button grey small', 114 - 'sigil' => 'workflow', 115 - ), 116 - pht('Delete')), 117 - ); 118 - 119 - } 120 - 121 - $project_table = new AphrontTableView($rows); 122 - $project_table->setNoDataString(pht('No Arcanist Projects')); 123 - $project_table->setHeaders( 124 - array( 125 - pht('Project ID'), 126 - pht('Repository'), 127 - '', 128 - '', 129 - )); 130 - $project_table->setColumnClasses( 131 - array( 132 - '', 133 - 'wide', 134 - 'action', 135 - 'action', 136 - )); 137 - 138 - $project_table->setColumnVisibility( 139 - array( 140 - true, 141 - true, 142 - $is_admin, 143 - $is_admin, 144 - )); 145 - 146 - $project_panel = new PHUIObjectBoxView(); 147 - $project_panel->setHeaderText(pht('Arcanist Projects')); 148 - $project_panel->appendChild($project_table); 149 - 150 88 $crumbs = $this->buildApplicationCrumbs(); 151 89 $crumbs->addTextCrumb(pht('Repository List')); 152 90 ··· 154 92 array( 155 93 $crumbs, 156 94 $panel, 157 - $project_panel, 158 95 ), 159 96 array( 160 97 'title' => pht('Repository List'),