Now the page /token/given/ allows to sort tokens by newest (default) and oldest.
The default sort is unchanged.
The given tokens are also now easily usable into any Dashboard.
This introduces creative space to add future filters.
refs T15988
Differential D25863
Convert tokens given to use SearchEngine taavi on Tue, Feb 4, 13:11. Authored by Tags None Referenced Files
Subscribers
Details
Now the page /token/given/ allows to sort tokens by newest (default) and oldest. The given tokens are also now easily usable into any Dashboard. This introduces creative space to add future filters. refs T15988 Tested that /token/ still renders fine. Order by Creation (Newest First): it works. Order by Creation (Oldest First): it works. Activate the DarkConsole's top bar and open the tab Services to inspect the generated queries, that are like this, and not anything alien, SELECT * FROM `token_given` ORDER BY `id` DESC LIMIT 101 SELECT * FROM `token_given` ORDER BY `id` ASC LIMIT 101 Test the page /token/given/ as logged-out: it the Tokens app is configured as public, it still works like before. From the page /token/given/ order by "Creation (oldest first)", use Use Results → Add Dashboard and see that it works. From the same Dashboard: Create Panel → Query Panel and select "Tokens Given" with Limit=1 and title "Most Recent Tokenzzz" and see that it works as expected. Visit the Leader Board page at /token/leaders/: it still works like before.
Diff Detail
Event TimelineComment Actions 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 Comment Actions 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')); Comment Actions 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? Comment Actions I did that in PhabricatorTokenGivenController since I don't think that menu should show up on the token leaderboard. WDYT? Comment Actions Thaaanks taavi! Known non-issue: somebody may wonder why in Maniphest the "Queries" are listed before other things. I may answer that in Phame the "Queries" are listed after other things. So this is consistent with Phame /phame/post/ page. lol Please wait at least next Wednesday before landing, so to attract more eyeballs and maybe receive suggestions to expand the test plan. But seems very Phorgi to me. |