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

Add developer UI for accessing NUX and "Overheated" query states

Summary: Ref T11773. Not committed to this implementation, but adds some "Developer" query actions to jump to the nux/overheated states without needing to know secret magic URL variables.

Test Plan: {F1878984}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11773

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

+49 -3
+45 -3
src/applications/search/controller/PhabricatorApplicationSearchController.php
··· 111 111 'before' => true, 112 112 'after' => true, 113 113 'nux' => true, 114 + 'overheated' => true, 114 115 ); 115 116 116 117 foreach ($pt_data as $pt_key => $pt_value) { ··· 238 239 $nux_view = null; 239 240 } 240 241 241 - $is_overheated = $query->getIsOverheated(); 242 + $force_overheated = $request->getBool('overheated'); 243 + $is_overheated = $query->getIsOverheated() || $force_overheated; 242 244 243 245 if ($nux_view) { 244 246 $box->appendChild($nux_view); ··· 277 279 $header = $result_header; 278 280 } 279 281 280 - if ($list->getActions()) { 281 - foreach ($list->getActions() as $action) { 282 + $actions = $list->getActions(); 283 + if ($actions) { 284 + foreach ($actions as $action) { 282 285 $header->addActionLink($action); 283 286 } 284 287 } 285 288 286 289 $use_actions = $engine->newUseResultsActions($saved_query); 290 + 291 + // TODO: Eventually, modularize all this stuff. 292 + $builtin_use_actions = $this->newBuiltinUseActions(); 293 + if ($builtin_use_actions) { 294 + foreach ($builtin_use_actions as $builtin_use_action) { 295 + $use_actions[] = $builtin_use_action; 296 + } 297 + } 298 + 287 299 if ($use_actions) { 288 300 $use_dropdown = $this->newUseResultsDropdown( 289 301 $saved_query, ··· 552 564 array( 553 565 $message, 554 566 )); 567 + } 568 + 569 + private function newBuiltinUseActions() { 570 + $actions = array(); 571 + 572 + $is_dev = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); 573 + 574 + if ($is_dev) { 575 + $engine = $this->getSearchEngine(); 576 + $nux_uri = $engine->getQueryBaseURI(); 577 + $nux_uri = id(new PhutilURI($nux_uri)) 578 + ->setQueryParam('nux', true); 579 + 580 + $actions[] = id(new PhabricatorActionView()) 581 + ->setIcon('fa-bug') 582 + ->setName(pht('Developer: Show New User State')) 583 + ->setHref($nux_uri); 584 + } 585 + 586 + if ($is_dev) { 587 + $overheated_uri = $this->getRequest()->getRequestURI() 588 + ->setQueryParam('overheated', true); 589 + 590 + $actions[] = id(new PhabricatorActionView()) 591 + ->setIcon('fa-bug') 592 + ->setName(pht('Developer: Show Overheated State')) 593 + ->setHref($overheated_uri); 594 + } 595 + 596 + return $actions; 555 597 } 556 598 557 599 }
+4
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
··· 406 406 return $this->getURI('query/edit/'); 407 407 } 408 408 409 + public function getQueryBaseURI() { 410 + return $this->getURI(''); 411 + } 412 + 409 413 410 414 /** 411 415 * Return the URI to a path within the application. Used to construct default