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

Modernize Herald

Summary: Updates Herald to use modern methods.

Test Plan: View List, View Test Console, Run a test, View Results, View Rules, New Rule, Edit Rule, Check mobile menus.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

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

+53 -63
+6 -11
src/applications/herald/controller/HeraldController.php
··· 18 18 return $crumbs; 19 19 } 20 20 21 - public function buildSideNavView($for_app = false) { 22 - $user = $this->getRequest()->getUser(); 21 + public function buildSideNavView() { 22 + $viewer = $this->getViewer(); 23 23 24 24 $nav = new AphrontSideNavFilterView(); 25 25 $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 26 26 27 - if ($for_app) { 28 - $nav->addFilter('new', pht('Create Rule')); 29 - } 30 - 31 27 id(new HeraldRuleSearchEngine()) 32 - ->setViewer($user) 28 + ->setViewer($viewer) 33 29 ->addNavigationItems($nav->getMenu()); 34 30 35 - $nav 36 - ->addLabel(pht('Utilities')) 37 - ->addFilter('test', pht('Test Console')) 38 - ->addFilter('transcript', pht('Transcripts')); 31 + $nav->addLabel(pht('Utilities')) 32 + ->addFilter('test', pht('Test Console')) 33 + ->addFilter('transcript', pht('Transcripts')); 39 34 40 35 $nav->selectFilter(null); 41 36
+8 -7
src/applications/herald/controller/HeraldNewController.php
··· 206 206 ->buildApplicationCrumbs() 207 207 ->addTextCrumb(pht('Create Rule')); 208 208 209 - return $this->buildApplicationPage( 210 - array( 211 - $crumbs, 212 - $form_box, 213 - ), 214 - array( 215 - 'title' => pht('Create Herald Rule'), 209 + $title = pht('Create Herald Rule'); 210 + 211 + return $this->newPage() 212 + ->setTitle($title) 213 + ->setCrumbs($crumbs) 214 + ->appendChild( 215 + array( 216 + $form_box, 216 217 )); 217 218 } 218 219
+8 -7
src/applications/herald/controller/HeraldRuleController.php
··· 247 247 ->buildApplicationCrumbs() 248 248 ->addTextCrumb($title); 249 249 250 - return $this->buildApplicationPage( 251 - array( 252 - $crumbs, 253 - $form_box, 254 - ), 255 - array( 256 - 'title' => pht('Edit Rule'), 250 + $title = pht('Edit Rule'); 251 + 252 + return $this->newPage() 253 + ->setTitle($title) 254 + ->setCrumbs($crumbs) 255 + ->appendChild( 256 + array( 257 + $form_box, 257 258 )); 258 259 } 259 260
+9 -8
src/applications/herald/controller/HeraldRuleViewController.php
··· 49 49 new HeraldTransactionQuery()); 50 50 $timeline->setShouldTerminate(true); 51 51 52 - return $this->buildApplicationPage( 53 - array( 54 - $crumbs, 55 - $object_box, 56 - $timeline, 57 - ), 58 - array( 59 - 'title' => $rule->getName(), 52 + $title = $rule->getName(); 53 + 54 + return $this->newPage() 55 + ->setTitle($title) 56 + ->setCrumbs($crumbs) 57 + ->appendChild( 58 + array( 59 + $object_box, 60 + $timeline, 60 61 )); 61 62 } 62 63
+9 -9
src/applications/herald/controller/HeraldTestConsoleController.php
··· 102 102 ->setFormErrors($errors) 103 103 ->setForm($form); 104 104 105 - $nav = $this->buildSideNavView(); 106 - $nav->selectFilter('test'); 107 - $nav->appendChild($box); 108 - 109 105 $crumbs = id($this->buildApplicationCrumbs()) 110 106 ->addTextCrumb(pht('Test Console')); 111 - $nav->setCrumbs($crumbs); 112 107 113 - return $this->buildApplicationPage( 114 - $nav, 115 - array( 116 - 'title' => pht('Test Console'), 108 + $title = pht('Test Console'); 109 + 110 + return $this->newPage() 111 + ->setTitle($title) 112 + ->setCrumbs($crumbs) 113 + ->appendChild( 114 + array( 115 + $box, 117 116 )); 117 + 118 118 } 119 119 120 120 }
+8 -7
src/applications/herald/controller/HeraldTranscriptController.php
··· 81 81 $this->getApplicationURI('/transcript/')) 82 82 ->addTextCrumb($xscript->getID()); 83 83 84 - return $this->buildApplicationPage( 85 - array( 86 - $crumbs, 87 - $content, 88 - ), 89 - array( 90 - 'title' => pht('Transcript'), 84 + $title = pht('Transcript'); 85 + 86 + return $this->newPage() 87 + ->setTitle($title) 88 + ->setCrumbs($crumbs) 89 + ->appendChild( 90 + array( 91 + $content, 91 92 )); 92 93 } 93 94
+4 -13
src/applications/herald/controller/HeraldTranscriptListController.php
··· 2 2 3 3 final class HeraldTranscriptListController extends HeraldController { 4 4 5 - public function buildSideNavView($for_app = false) { 5 + public function buildSideNavView() { 6 6 $user = $this->getRequest()->getUser(); 7 7 8 8 $nav = new AphrontSideNavFilterView(); 9 9 $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 10 - 11 - if ($for_app) { 12 - $nav->addFilter('new', pht('Create Rule')); 13 - } 14 10 15 11 id(new HeraldTranscriptSearchEngine()) 16 12 ->setViewer($user) ··· 31 27 } 32 28 33 29 public function handleRequest(AphrontRequest $request) { 34 - $querykey = $request->getURIData('queryKey'); 35 - 36 - $controller = id(new PhabricatorApplicationSearchController()) 37 - ->setQueryKey($querykey) 38 - ->setSearchEngine(new HeraldTranscriptSearchEngine()) 39 - ->setNavigation($this->buildSideNavView()); 40 - 41 - return $this->delegateToController($controller); 30 + return id(new HeraldTranscriptSearchEngine()) 31 + ->setController($this) 32 + ->buildResponse(); 42 33 } 43 34 44 35 }
+1 -1
src/applications/herald/query/HeraldTranscriptSearchEngine.php
··· 76 76 77 77 protected function getBuiltinQueryNames() { 78 78 return array( 79 - 'all' => pht('All'), 79 + 'all' => pht('All Transcripts'), 80 80 ); 81 81 } 82 82