From 40391d089eefb15ede652315ae275deecf90c7f5 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 10 Mar 2017 19:37:44 -0800 Subject: [PATCH] Add a sort order to the favorites menu Summary: These were once ordered, but I think we switched to being defined in the Engine and never implemented the sorts there. This adds sort ordering to Tasks, Projects, and Repositories. Test Plan: Review Favorites Menu in local install, see order is now set per the engine. Click Edit Favorites, and re-order. See order sticks. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17490 --- .../diffusion/editor/DiffusionRepositoryEditEngine.php | 4 ++++ src/applications/maniphest/editor/ManiphestEditEngine.php | 4 ++++ .../project/engine/PhabricatorProjectEditEngine.php | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php b/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php index 4f45357956..2459c8c559 100644 --- a/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php +++ b/src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php @@ -24,6 +24,10 @@ final class DiffusionRepositoryEditEngine return true; } + public function getQuickCreateOrderVector() { + return id(new PhutilSortVector())->addInt(300); + } + public function getEngineName() { return pht('Repositories'); } diff --git a/src/applications/maniphest/editor/ManiphestEditEngine.php b/src/applications/maniphest/editor/ManiphestEditEngine.php index 0433e8200a..ad0171592c 100644 --- a/src/applications/maniphest/editor/ManiphestEditEngine.php +++ b/src/applications/maniphest/editor/ManiphestEditEngine.php @@ -25,6 +25,10 @@ final class ManiphestEditEngine return true; } + public function getQuickCreateOrderVector() { + return id(new PhutilSortVector())->addInt(100); + } + protected function newEditableObject() { return ManiphestTask::initializeNewTask($this->getViewer()); } diff --git a/src/applications/project/engine/PhabricatorProjectEditEngine.php b/src/applications/project/engine/PhabricatorProjectEditEngine.php index 7a0c11be0e..286e9bab0f 100644 --- a/src/applications/project/engine/PhabricatorProjectEditEngine.php +++ b/src/applications/project/engine/PhabricatorProjectEditEngine.php @@ -30,6 +30,10 @@ final class PhabricatorProjectEditEngine return true; } + public function getQuickCreateOrderVector() { + return id(new PhutilSortVector())->addInt(200); + } + public function getEngineName() { return pht('Projects'); }