Allow workboards to be filtered with ApplicationSearch
Summary:
Ref T4673.
IMPORTANT: I had to break one thing (see TODO) to get this working. Not sure how you want to deal with that. I might be able to put the element //inside// the workboard, or I could write some JS. But I figured I'd get feedback first.
General areas for improvement:
- It would be nice to give you some feedback that you have a filter applied.
- It would be nice to let you save and quickly select common filters.
- These would probably both be covered by a dropdown menu instead of a button, but that's more JS than I want to sign up for right now.
- Managing custom filters is also a significant amount of extra UI to build.
- Also, maybe these filters should be sticky per-board? Or across all boards? Or have a "make this my default view"? I tend to dislike implicit stickiness.
Test Plan:
Before:
{F157543}
Apply Filter:
{F157544}
Filtered:
{F157545}
Reviewers: chad, btrahan
Reviewed By: btrahan
Subscribers: qgil, swisspol, epriestley
Maniphest Tasks: T4673
Differential Revision: https://secure.phabricator.com/D9211
This commit is contained in:
@@ -90,7 +90,7 @@ final class PhabricatorApplicationSearchController
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$saved_query = $engine->buildSavedQueryFromRequest($request);
|
||||
$this->saveQuery($saved_query);
|
||||
$engine->saveQuery($saved_query);
|
||||
return id(new AphrontRedirectResponse())->setURI(
|
||||
$engine->getQueryResultsPageURI($saved_query->getQueryKey()).'#R');
|
||||
}
|
||||
@@ -145,7 +145,7 @@ final class PhabricatorApplicationSearchController
|
||||
|
||||
// Save the query to generate a query key, so "Save Custom Query..." and
|
||||
// other features like Maniphest's "Export..." work correctly.
|
||||
$this->saveQuery($saved_query);
|
||||
$engine->saveQuery($saved_query);
|
||||
}
|
||||
|
||||
$nav->selectFilter(
|
||||
@@ -353,18 +353,6 @@ final class PhabricatorApplicationSearchController
|
||||
));
|
||||
}
|
||||
|
||||
private function saveQuery(PhabricatorSavedQuery $query) {
|
||||
$query->setEngineClassName(get_class($this->getSearchEngine()));
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
try {
|
||||
$query->save();
|
||||
} catch (AphrontQueryDuplicateKeyException $ex) {
|
||||
// Ignore, this is just a repeated search.
|
||||
}
|
||||
unset($unguarded);
|
||||
}
|
||||
|
||||
protected function buildApplicationMenu() {
|
||||
return $this->getDelegatingController()->buildApplicationMenu();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user