Page MenuHomePhorge

Convert tokens given to use SearchEngine
Needs ReviewPublic

Authored by taavi on Tue, Feb 4, 13:11.

Details

Summary

refs T15988

Test Plan

Tested that /token/ still renders fine.

Order by Creation (Newest First): it works.

Order by Creation (Oldest First): it works.

Diff Detail

Repository
rP Phorge
Branch
tokens-search
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1680
Build 1680: arc lint + arc unit

Event Timeline

taavi requested review of this revision.Tue, Feb 4, 13:11

It works on my computer but I see that in the left sidebar usually there is "Queries" 🤔 instead it seems to work for ManiphestController and similar ones

OK probably just this is missing

diff --git a/src/applications/tokens/controller/PhabricatorTokenController.php b/src/applications/tokens/controller/PhabricatorTokenController.php
index 8cd61b92b6..c1ff7408aa 100644
--- a/src/applications/tokens/controller/PhabricatorTokenController.php
+++ b/src/applications/tokens/controller/PhabricatorTokenController.php
@@ -3,9 +3,15 @@
 abstract class PhabricatorTokenController extends PhabricatorController {
 
   protected function buildSideNav() {
+    $viewer = $this->getViewer();
+
     $nav = new AphrontSideNavFilterView();
     $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
 
+    id(new PhabricatorTokenGivenSearchEngine())
+      ->setViewer($viewer)
+      ->addNavigationItems($nav->getMenu());
+
     $nav->addLabel(pht('Tokens'));
     $nav->addFilter('given/', pht('Tokens Given'));
     $nav->addFilter('leaders/', pht('Leader Board'));

If you want to easily try that missing piece I can add it with a little cute amend (keeping your authorship). We can always rollback the patch if you don't like the result or if it creates a nuclear weapon. Sounds OK?