1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00

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
This commit is contained in:
epriestley 2021-03-16 15:49:16 -07:00
parent 12341e4bc8
commit e6a23274fe

View file

@ -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;
}