From e6a23274fee433a4b84039456aab7cf36b204190 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 16 Mar 2021 15:49:16 -0700 Subject: [PATCH] Default the Almanac Devices query to "Active Devices" Summary: Ref T13641. Now that we can provide an "Active Devices" query, provide it and make it the default. Test Plan: Viewed Almanac devices, got a list of active devices. Clicked "All Devices" to get all devices. Maniphest Tasks: T13641 Differential Revision: https://secure.phabricator.com/D21636 --- src/applications/almanac/query/AlmanacDeviceSearchEngine.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/almanac/query/AlmanacDeviceSearchEngine.php b/src/applications/almanac/query/AlmanacDeviceSearchEngine.php index 956ade5ed4..9f98abb292 100644 --- a/src/applications/almanac/query/AlmanacDeviceSearchEngine.php +++ b/src/applications/almanac/query/AlmanacDeviceSearchEngine.php @@ -71,6 +71,7 @@ final class AlmanacDeviceSearchEngine protected function getBuiltinQueryNames() { $names = array( + 'active' => pht('Active Devices'), 'all' => pht('All Devices'), ); @@ -78,11 +79,13 @@ final class AlmanacDeviceSearchEngine } public function buildSavedQueryFromBuiltin($query_key) { - $query = $this->newSavedQuery(); $query->setQueryKey($query_key); switch ($query_key) { + case 'active': + $active_statuses = AlmanacDeviceStatus::getActiveStatusList(); + return $query->setParameter('statuses', $active_statuses); case 'all': return $query; }