@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.

Update Dashboard for handleRequest

Summary: Updates Dashboards

Test Plan: Bounced around lists, installed, history, create panel, create dashboard, etc.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T8628

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

+62 -141
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardAddPanelController.php
··· 3 3 final class PhabricatorDashboardAddPanelController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $dashboard = id(new PhabricatorDashboardQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->requireCapabilities( 20 14 array( 21 15 PhabricatorPolicyCapability::CAN_VIEW,
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardCopyController.php
··· 3 3 final class PhabricatorDashboardCopyController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $dashboard = id(new PhabricatorDashboardQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->needPanels(true) 20 14 ->executeOne(); 21 15 if (!$dashboard) {
+5 -11
src/applications/dashboard/controller/PhabricatorDashboardEditController.php
··· 3 3 final class PhabricatorDashboardEditController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 - if ($this->id) { 10 + if ($id) { 17 11 $dashboard = id(new PhabricatorDashboardQuery()) 18 12 ->setViewer($viewer) 19 - ->withIDs(array($this->id)) 13 + ->withIDs(array($id)) 20 14 ->needPanels(true) 21 15 ->requireCapabilities( 22 16 array(
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
··· 3 3 final class PhabricatorDashboardHistoryController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['id']; 10 - } 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 11 9 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 15 - $id = $this->id; 16 10 $dashboard_view_uri = $this->getApplicationURI('view/'.$id.'/'); 17 11 $dashboard_manage_uri = $this->getApplicationURI('manage/'.$id.'/'); 18 12 19 13 $dashboard = id(new PhabricatorDashboardQuery()) 20 14 ->setViewer($viewer) 21 - ->withIDs(array($this->id)) 15 + ->withIDs(array($id)) 22 16 ->executeOne(); 23 17 if (!$dashboard) { 24 18 return new Aphront404Response();
+3 -7
src/applications/dashboard/controller/PhabricatorDashboardInstallController.php
··· 5 5 6 6 private $id; 7 7 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 8 + public function handleRequest(AphrontRequest $request) { 9 + $viewer = $request->getViewer(); 10 + $this->id = $request->getURIData('id'); 15 11 16 12 $dashboard = id(new PhabricatorDashboardQuery()) 17 13 ->setViewer($viewer)
+4 -7
src/applications/dashboard/controller/PhabricatorDashboardListController.php
··· 3 3 final class PhabricatorDashboardListController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $queryKey; 7 - 8 6 public function shouldAllowPublic() { 9 7 return true; 10 8 } 11 9 12 - public function willProcessRequest(array $data) { 13 - $this->queryKey = idx($data, 'queryKey'); 14 - } 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $request->getViewer(); 12 + $query_key = $request->getURIData('queryKey'); 15 13 16 - public function processRequest() { 17 14 $controller = id(new PhabricatorApplicationSearchController()) 18 - ->setQueryKey($this->queryKey) 15 + ->setQueryKey($query_key) 19 16 ->setSearchEngine(new PhabricatorDashboardSearchEngine()) 20 17 ->setNavigation($this->buildSideNavView()); 21 18 return $this->delegateToController($controller);
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardMovePanelController.php
··· 3 3 final class PhabricatorDashboardMovePanelController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['id']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $column_id = $request->getStr('columnID'); 17 11 $panel_phid = $request->getStr('objectPHID'); ··· 20 14 21 15 $dashboard = id(new PhabricatorDashboardQuery()) 22 16 ->setViewer($viewer) 23 - ->withIDs(array($this->id)) 17 + ->withIDs(array($id)) 24 18 ->needPanels(true) 25 19 ->requireCapabilities( 26 20 array(
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardPanelArchiveController.php
··· 3 3 final class PhabricatorDashboardPanelArchiveController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = $data['id']; 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $panel = id(new PhabricatorDashboardPanelQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->requireCapabilities( 20 14 array( 21 15 PhabricatorPolicyCapability::CAN_VIEW,
+5 -11
src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
··· 3 3 final class PhabricatorDashboardPanelEditController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 // If the user is trying to create a panel directly on a dashboard, make 17 11 // sure they have permission to see and edit the dashboard. ··· 35 29 $manage_uri = $this->getApplicationURI('manage/'.$dashboard_id.'/'); 36 30 } 37 31 38 - if ($this->id) { 32 + if ($id) { 39 33 $is_create = false; 40 34 41 35 if ($dashboard) { ··· 51 45 52 46 $panel = id(new PhabricatorDashboardPanelQuery()) 53 47 ->setViewer($viewer) 54 - ->withIDs(array($this->id)) 48 + ->withIDs(array($id)) 55 49 ->requireCapabilities($capabilities) 56 50 ->executeOne(); 57 51 if (!$panel) {
+3 -5
src/applications/dashboard/controller/PhabricatorDashboardPanelListController.php
··· 9 9 return true; 10 10 } 11 11 12 - public function willProcessRequest(array $data) { 13 - $this->queryKey = idx($data, 'queryKey'); 14 - } 12 + public function handleRequest(AphrontRequest $request) { 13 + $query_key = $request->getURIData('queryKey'); 15 14 16 - public function processRequest() { 17 15 $controller = id(new PhabricatorApplicationSearchController()) 18 - ->setQueryKey($this->queryKey) 16 + ->setQueryKey($query_key) 19 17 ->setSearchEngine(new PhabricatorDashboardPanelSearchEngine()) 20 18 ->setNavigation($this->buildSideNavView()); 21 19 return $this->delegateToController($controller);
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php
··· 3 3 final class PhabricatorDashboardPanelRenderController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 6 public function shouldAllowPublic() { 9 7 return true; 10 8 } 11 9 12 - public function willProcessRequest(array $data) { 13 - $this->id = $data['id']; 14 - } 15 - 16 - public function processRequest() { 17 - $request = $this->getRequest(); 18 - $viewer = $request->getUser(); 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $request->getViewer(); 12 + $id = $request->getURIData('id'); 19 13 20 14 $panel = id(new PhabricatorDashboardPanelQuery()) 21 15 ->setViewer($viewer) 22 - ->withIDs(array($this->id)) 16 + ->withIDs(array($id)) 23 17 ->executeOne(); 24 18 if (!$panel) { 25 19 return new Aphront404Response();
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
··· 3 3 final class PhabricatorDashboardPanelViewController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 6 public function shouldAllowPublic() { 9 7 return true; 10 8 } 11 9 12 - public function willProcessRequest(array $data) { 13 - $this->id = $data['id']; 14 - } 15 - 16 - public function processRequest() { 17 - $request = $this->getRequest(); 18 - $viewer = $request->getUser(); 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $request->getViewer(); 12 + $id = $request->getURIData('id'); 19 13 20 14 $panel = id(new PhabricatorDashboardPanelQuery()) 21 15 ->setViewer($viewer) 22 - ->withIDs(array($this->id)) 16 + ->withIDs(array($id)) 23 17 ->executeOne(); 24 18 if (!$panel) { 25 19 return new Aphront404Response();
+4 -10
src/applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php
··· 3 3 final class PhabricatorDashboardRemovePanelController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $dashboard = id(new PhabricatorDashboardQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->requireCapabilities( 20 14 array( 21 15 PhabricatorPolicyCapability::CAN_VIEW,
+7 -13
src/applications/dashboard/controller/PhabricatorDashboardUninstallController.php
··· 3 3 final class PhabricatorDashboardUninstallController 4 4 extends PhabricatorDashboardController { 5 5 6 - private $id; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->id = idx($data, 'id'); 10 - } 11 - 12 - public function processRequest() { 13 - $request = $this->getRequest(); 14 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 + $id = $request->getURIData('id'); 15 9 16 10 $dashboard = id(new PhabricatorDashboardQuery()) 17 11 ->setViewer($viewer) 18 - ->withIDs(array($this->id)) 12 + ->withIDs(array($id)) 19 13 ->executeOne(); 20 14 if (!$dashboard) { 21 15 return new Aphront404Response(); ··· 73 67 ->setTitle(pht('Uninstall Dashboard')) 74 68 ->appendChild($form->buildLayoutView()) 75 69 ->addCancelButton($this->getCancelURI( 76 - $application_class, $object_phid)) 70 + $application_class, $object_phid, $id)) 77 71 ->addSubmitButton(pht('Uninstall Dashboard')); 78 72 } 79 73 ··· 114 108 return $body; 115 109 } 116 110 117 - private function getCancelURI($application_class, $object_phid) { 111 + private function getCancelURI($application_class, $object_phid, $id) { 118 112 $uri = null; 119 113 switch ($application_class) { 120 114 case 'PhabricatorHomeApplication': 121 - $uri = '/dashboard/view/'.$this->id.'/'; 115 + $uri = '/dashboard/view/'.$id.'/'; 122 116 break; 123 117 } 124 118 return $uri;
+3 -7
src/applications/dashboard/controller/PhabricatorDashboardViewController.php
··· 9 9 return true; 10 10 } 11 11 12 - public function willProcessRequest(array $data) { 13 - $this->id = $data['id']; 14 - } 15 - 16 - public function processRequest() { 17 - $request = $this->getRequest(); 18 - $viewer = $request->getUser(); 12 + public function handleRequest(AphrontRequest $request) { 13 + $viewer = $request->getViewer(); 14 + $this->id = $request->getURIData('id'); 19 15 20 16 $dashboard = id(new PhabricatorDashboardQuery()) 21 17 ->setViewer($viewer)