mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-13 10:22:42 +01:00
38f5894b58
Summary: Ref T4986. Allows the Drydock search engines to render as panels. Test Plan: Viewed affected interfaces in Drydock. Created panels from each engine. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T4986 Differential Revision: https://secure.phabricator.com/D9103
63 lines
1.3 KiB
PHP
63 lines
1.3 KiB
PHP
<?php
|
|
|
|
final class DrydockLogSearchEngine
|
|
extends PhabricatorApplicationSearchEngine {
|
|
|
|
public function getApplicationClassName() {
|
|
return 'PhabricatorApplicationDrydock';
|
|
}
|
|
|
|
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
|
$saved = new PhabricatorSavedQuery();
|
|
|
|
return $saved;
|
|
}
|
|
|
|
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
|
|
$query = id(new DrydockLogQuery());
|
|
|
|
return $query;
|
|
}
|
|
|
|
public function buildSearchForm(
|
|
AphrontFormView $form,
|
|
PhabricatorSavedQuery $saved) {
|
|
|
|
}
|
|
|
|
protected function getURI($path) {
|
|
return '/drydock/log/'.$path;
|
|
}
|
|
|
|
public function getBuiltinQueryNames() {
|
|
$names = array(
|
|
'all' => pht('All Logs'),
|
|
);
|
|
|
|
return $names;
|
|
}
|
|
|
|
public function buildSavedQueryFromBuiltin($query_key) {
|
|
$query = $this->newSavedQuery();
|
|
$query->setQueryKey($query_key);
|
|
|
|
switch ($query_key) {
|
|
case 'all':
|
|
return $query;
|
|
}
|
|
|
|
return parent::buildSavedQueryFromBuiltin($query_key);
|
|
}
|
|
|
|
protected function renderResultList(
|
|
array $logs,
|
|
PhabricatorSavedQuery $query,
|
|
array $handles) {
|
|
|
|
return id(new DrydockLogListView())
|
|
->setUser($this->requireViewer())
|
|
->setLogs($logs)
|
|
->render();
|
|
}
|
|
|
|
}
|