Page MenuHomePhabricator

D9211.id21877.diff
No OneTemporary

D9211.id21877.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -146,7 +146,7 @@
'rsrc/css/phui/phui-tag-view.css' => '74051f4e',
'rsrc/css/phui/phui-text.css' => '23e9b4b7',
'rsrc/css/phui/phui-timeline-view.css' => '15ff2a9f',
- 'rsrc/css/phui/phui-workboard-view.css' => '2bf82d00',
+ 'rsrc/css/phui/phui-workboard-view.css' => '8091e4bd',
'rsrc/css/phui/phui-workpanel-view.css' => 'fddd97bf',
'rsrc/css/sprite-actions.css' => '969ad0e5',
'rsrc/css/sprite-apps-large.css' => 'd7ef733e',
@@ -778,7 +778,7 @@
'phui-tag-view-css' => '74051f4e',
'phui-text-css' => '23e9b4b7',
'phui-timeline-view-css' => '15ff2a9f',
- 'phui-workboard-view-css' => '2bf82d00',
+ 'phui-workboard-view-css' => '8091e4bd',
'phui-workpanel-view-css' => 'fddd97bf',
'phuix-action-list-view' => 'b5c256b8',
'phuix-action-view' => '6e8cefa4',
diff --git a/src/applications/maniphest/query/ManiphestTaskQuery.php b/src/applications/maniphest/query/ManiphestTaskQuery.php
--- a/src/applications/maniphest/query/ManiphestTaskQuery.php
+++ b/src/applications/maniphest/query/ManiphestTaskQuery.php
@@ -95,6 +95,22 @@
return $this;
}
+ /**
+ * Add an additional "all projects" constraint to existing filters.
+ *
+ * This is used by boards to supplement queries.
+ *
+ * @param list<phid> List of project PHIDs to add to any existing constriant.
+ * @return this
+ */
+ public function addWithAllProjects(array $projects) {
+ if ($this->projectPHIDs === null) {
+ $this->projectPHIDs = array();
+ }
+
+ return $this->withAllProjects(array_merge($this->projectPHIDs, $projects));
+ }
+
public function withoutProjects(array $projects) {
$this->xprojectPHIDs = $projects;
return $this;
diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
--- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
+++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
@@ -4,6 +4,26 @@
extends PhabricatorApplicationSearchEngine {
private $showBatchControls;
+ private $baseURI;
+ private $isBoardView;
+
+ public function setIsBoardView($is_board_view) {
+ $this->isBoardView = $is_board_view;
+ return $this;
+ }
+
+ public function getIsBoardView() {
+ return $this->isBoardView;
+ }
+
+ public function setBaseURI($base_uri) {
+ $this->baseURI = $base_uri;
+ return $this;
+ }
+
+ public function getBaseURI() {
+ return $this->baseURI;
+ }
public function setShowBatchControls($show_batch_controls) {
$this->showBatchControls = $show_batch_controls;
@@ -301,14 +321,20 @@
->setDatasource('/typeahead/common/projects/')
->setName('allProjects')
->setLabel(pht('In All Projects'))
- ->setValue($all_project_handles))
- ->appendChild(
- id(new AphrontFormCheckboxControl())
- ->addCheckbox(
- 'withNoProject',
- 1,
- pht('Show only tasks with no projects.'),
- $with_no_projects))
+ ->setValue($all_project_handles));
+
+ if (!$this->getIsBoardView()) {
+ $form
+ ->appendChild(
+ id(new AphrontFormCheckboxControl())
+ ->addCheckbox(
+ 'withNoProject',
+ 1,
+ pht('Show only tasks with no projects.'),
+ $with_no_projects));
+ }
+
+ $form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/projects/')
@@ -340,19 +366,25 @@
->setLabel(pht('Subscribers'))
->setValue($subscriber_handles))
->appendChild($status_control)
- ->appendChild($priority_control)
- ->appendChild(
- id(new AphrontFormSelectControl())
- ->setName('group')
- ->setLabel(pht('Group By'))
- ->setValue($saved->getParameter('group'))
- ->setOptions($this->getGroupOptions()))
- ->appendChild(
- id(new AphrontFormSelectControl())
- ->setName('order')
- ->setLabel(pht('Order By'))
- ->setValue($saved->getParameter('order'))
- ->setOptions($this->getOrderOptions()))
+ ->appendChild($priority_control);
+
+ if (!$this->getIsBoardView()) {
+ $form
+ ->appendChild(
+ id(new AphrontFormSelectControl())
+ ->setName('group')
+ ->setLabel(pht('Group By'))
+ ->setValue($saved->getParameter('group'))
+ ->setOptions($this->getGroupOptions()))
+ ->appendChild(
+ id(new AphrontFormSelectControl())
+ ->setName('order')
+ ->setLabel(pht('Order By'))
+ ->setValue($saved->getParameter('order'))
+ ->setOptions($this->getOrderOptions()));
+ }
+
+ $form
->appendChild(
id(new AphrontFormTextControl())
->setName('fulltext')
@@ -382,15 +414,20 @@
'modifiedEnd',
pht('Updated Before'));
- $form
- ->appendChild(
- id(new AphrontFormTextControl())
- ->setName('limit')
- ->setLabel(pht('Page Size'))
- ->setValue($saved->getParameter('limit', 100)));
+ if (!$this->getIsBoardView()) {
+ $form
+ ->appendChild(
+ id(new AphrontFormTextControl())
+ ->setName('limit')
+ ->setLabel(pht('Page Size'))
+ ->setValue($saved->getParameter('limit', 100)));
+ }
}
protected function getURI($path) {
+ if ($this->baseURI) {
+ return $this->baseURI.$path;
+ }
return '/maniphest/'.$path;
}
diff --git a/src/applications/project/application/PhabricatorApplicationProject.php b/src/applications/project/application/PhabricatorApplicationProject.php
--- a/src/applications/project/application/PhabricatorApplicationProject.php
+++ b/src/applications/project/application/PhabricatorApplicationProject.php
@@ -51,7 +51,8 @@
'picture/(?P<id>[1-9]\d*)/' =>
'PhabricatorProjectEditPictureController',
'create/' => 'PhabricatorProjectCreateController',
- 'board/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectBoardViewController',
+ 'board/(?P<id>[1-9]\d*)/(?:query/(?P<queryKey>[^/]+)/)?' =>
+ 'PhabricatorProjectBoardViewController',
'move/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectMoveController',
'board/(?P<projectID>[1-9]\d*)/edit/(?:(?P<id>\d+)/)?'
=> 'PhabricatorProjectBoardEditController',
diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
--- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php
+++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
@@ -5,6 +5,7 @@
private $id;
private $handles;
+ private $queryKey;
public function shouldAllowPublic() {
return true;
@@ -12,6 +13,7 @@
public function willProcessRequest(array $data) {
$this->id = $data['id'];
+ $this->queryKey = idx($data, 'queryKey');
}
public function processRequest() {
@@ -50,12 +52,41 @@
ksort($columns);
- $tasks = id(new ManiphestTaskQuery())
+ $board_uri = $this->getApplicationURI('board/'.$project->getID().'/');
+
+ $engine = id(new ManiphestTaskSearchEngine())
+ ->setViewer($viewer)
+ ->setBaseURI($board_uri)
+ ->setIsBoardView(true);
+
+ if ($request->isFormPost()) {
+ $saved = $engine->buildSavedQueryFromRequest($request);
+ $engine->saveQuery($saved);
+ return id(new AphrontRedirectResponse())->setURI(
+ $engine->getQueryResultsPageURI($saved->getQueryKey()));
+ }
+
+ $query_key = $this->queryKey;
+ if ($query_key) {
+ $saved = id(new PhabricatorSavedQueryQuery())
+ ->setViewer($viewer)
+ ->withQueryKeys(array($query_key))
+ ->executeOne();
+
+ if (!$saved) {
+ return new Aphront404Response();
+ }
+ } else {
+ $saved = $engine->buildSavedQueryFromBuiltin('open');
+ }
+
+ $task_query = $engine->buildQueryFromSavedQuery($saved);
+
+ $tasks = $task_query
+ ->addWithAllProjects(array($project->getPHID()))
->setViewer($viewer)
- ->withAllProjects(array($project->getPHID()))
- ->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())
- ->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY)
->execute();
+
$tasks = mpull($tasks, null, 'getPHID');
$task_phids = array_keys($tasks);
@@ -166,6 +197,63 @@
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit);
+ Javelin::initBehavior('phabricator-reveal-content');
+ $filter_id = celerity_generate_unique_node_id();
+ $unfilter_id = celerity_generate_unique_node_id();
+ $filter_panel_id = celerity_generate_unique_node_id();
+
+ $filter_icon = id(new PHUIIconView())
+ ->setIconFont('fa-search-plus bluegrey');
+
+ $filter_button = id(new PHUIButtonView())
+ ->setText(pht('Filter Tasks'))
+ ->setIcon($filter_icon)
+ ->setTag('a')
+ ->setHref('#')
+ ->setID($filter_id)
+ ->addSigil('reveal-content')
+ ->setMetadata(
+ array(
+ 'showIDs' => array($unfilter_id, $filter_panel_id),
+ 'hideIDs' => array($filter_id),
+ ));
+
+ $unfilter_icon = id(new PHUIIconView())
+ ->setIconFont('fa-search-minus bluegrey');
+
+ $unfilter_button = id(new PHUIButtonView())
+ ->setText(pht('Hide Filters'))
+ ->setIcon($unfilter_icon)
+ ->setTag('a')
+ ->setStyle('display: none')
+ ->setHref('#')
+ ->setID($unfilter_id)
+ ->addSigil('reveal-content')
+ ->setMetadata(
+ array(
+ 'showIDs' => array($filter_id),
+ 'hideIDs' => array($unfilter_id, $filter_panel_id),
+ ));
+
+ $filter_form = id(new AphrontFormView())
+ ->setUser($viewer);
+ $engine->buildSearchForm($filter_form, $saved);
+ $filter_form->appendChild(
+ id(new AphrontFormSubmitControl())
+ ->setValue(pht('Filter Tasks')));
+
+ $filter_box = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('Filter Tasks'))
+ ->appendChild($filter_form);
+
+ $filter_panel = phutil_tag(
+ 'div',
+ array(
+ 'id' => $filter_panel_id,
+ 'style' => 'display: none; padding-bottom: 24px;',
+ ),
+ $filter_box);
+
$header_link = phutil_tag(
'a',
array(
@@ -179,6 +267,8 @@
->setNoBackground(true)
->setImage($project->getProfileImageURI())
->setImageURL($this->getApplicationURI('view/'.$project->getID().'/'))
+ ->addActionLink($filter_button)
+ ->addActionLink($unfilter_button)
->addActionLink($add_button)
->setPolicyObject($project);
@@ -189,6 +279,7 @@
return $this->buildApplicationPage(
array(
$header,
+ $filter_panel,
$board_box,
),
array(
diff --git a/src/applications/project/view/ProjectBoardTaskCard.php b/src/applications/project/view/ProjectBoardTaskCard.php
--- a/src/applications/project/view/ProjectBoardTaskCard.php
+++ b/src/applications/project/view/ProjectBoardTaskCard.php
@@ -53,6 +53,7 @@
->setGrippable($can_edit)
->setHref('/T'.$task->getID())
->addSigil('project-card')
+ ->setDisabled($task->isClosed())
->setMetadata(
array(
'objectPHID' => $task->getPHID(),
diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -90,7 +90,7 @@
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 @@
// 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 @@
));
}
- 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();
}
diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
--- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
+++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
@@ -35,6 +35,18 @@
return $this->viewer;
}
+ public function saveQuery(PhabricatorSavedQuery $query) {
+ $query->setEngineClassName(get_class($this));
+
+ $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
+ try {
+ $query->save();
+ } catch (AphrontQueryDuplicateKeyException $ex) {
+ // Ignore, this is just a repeated search.
+ }
+ unset($unguarded);
+ }
+
/**
* Create a saved query object from the request.
*
diff --git a/webroot/rsrc/css/phui/phui-workboard-view.css b/webroot/rsrc/css/phui/phui-workboard-view.css
--- a/webroot/rsrc/css/phui/phui-workboard-view.css
+++ b/webroot/rsrc/css/phui/phui-workboard-view.css
@@ -8,11 +8,18 @@
.device-desktop .phui-workboard-view-shadow {
overflow-x: auto;
+
+ /*
+
+ TODO: This prevents us from putting anything above boards, like the
+ setup issue warning or the filtering UI.
+
position: absolute;
top: 120px;
bottom: 0;
left: 0;
right: 0;
+ */
}
.phui-workboard-view-shadow::-webkit-scrollbar {

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 2:52 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707233
Default Alt Text
D9211.id21877.diff (14 KB)

Event Timeline