Page MenuHomePhabricator

D20637.id49222.diff
No OneTemporary

D20637.id49222.diff

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
@@ -495,24 +495,26 @@
->setName($name);
if ($is_custom) {
- $uri = $this->getApplicationURI(
- 'board/'.$project->getID().'/filter/query/'.$key.'/');
+ // When you're using a custom filter already and you select "Custom
+ // Filter", you get a dialog back to let you edit the filter. This is
+ // equivalent to selecting "Advanced Filter..." to configure a new
+ // filter.
+ $filter_uri = $state->newWorkboardURI('filter/');
$item->setWorkflow(true);
} else {
- $uri = $engine->getQueryResultsPageURI($key);
+ $filter_uri = urisprintf('query/%s/', $key);
+ $filter_uri = $state->newWorkboardURI($filter_uri);
+ $filter_uri->removeQueryParam('filter');
}
- $uri = $this->getURIWithState($uri)
- ->removeQueryParam('filter');
- $item->setHref($uri);
+ $item->setHref($filter_uri);
$items[] = $item;
}
$id = $project->getID();
- $filter_uri = $this->getApplicationURI("board/{$id}/filter/");
- $filter_uri = $this->getURIWithState($filter_uri, $force = true);
+ $filter_uri = $state->newWorkboardURI('filter/');
$items[] = id(new PhabricatorActionView())
->setIcon('fa-cog')
@@ -716,10 +718,8 @@
->setIcon('fa-search')
->setHref($query_uri);
- $column_move_uri = $state->newWorkboardURI(
- urisprintf(
- 'bulkmove/%d/column/',
- $column->getID()));
+ $column_move_uri = urisprintf('bulkmove/%d/column/', $column->getID());
+ $column_move_uri = $state->newWorkboardURI($column_move_uri);
$column_items[] = id(new PhabricatorActionView())
->setIcon('fa-arrows-h')
@@ -727,10 +727,8 @@
->setHref($column_move_uri)
->setWorkflow(true);
- $project_move_uri = $state->newWorkboardURI(
- urisprintf(
- 'bulkmove/%d/project/',
- $column->getID()));
+ $project_move_uri = urisprintf('bulkmove/%d/project/', $column->getID());
+ $project_move_uri = $state->newWorkboardURI($project_move_uri);
$column_items[] = id(new PhabricatorActionView())
->setIcon('fa-arrows')
@@ -738,10 +736,8 @@
->setHref($project_move_uri)
->setWorkflow(true);
- $bulk_edit_uri = $state->newWorkboardURI(
- urisprintf(
- 'bulk/%d/',
- $column->getID()));
+ $bulk_edit_uri = urisprintf('bulk/%d/', $column->getID());
+ $bulk_edit_uri = $state->newWorkboardURI($bulk_edit_uri);
$can_bulk_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
@@ -767,9 +763,9 @@
->setWorkflow(true);
$can_hide = ($can_edit && !$column->isDefaultColumn());
- $hide_uri = 'board/'.$project->getID().'/hide/'.$column->getID().'/';
- $hide_uri = $this->getApplicationURI($hide_uri);
- $hide_uri = $this->getURIWithState($hide_uri);
+
+ $hide_uri = urisprintf('hide/%d/', $column->getID());
+ $hide_uri = $state->newWorkboardURI($hide_uri);
if (!$column->isHidden()) {
$column_items[] = id(new PhabricatorActionView())
@@ -875,26 +871,6 @@
return $trigger_button;
}
- /**
- * Add current state parameters (like order and the visibility of hidden
- * columns) to a URI.
- *
- * This allows actions which toggle or adjust one piece of state to keep
- * the rest of the board state persistent. If no URI is provided, this method
- * starts with the request URI.
- *
- * @param string|null URI to add state parameters to.
- * @param bool True to explicitly include all state.
- * @return PhutilURI URI with state parameters.
- */
- private function getURIWithState($base = null, $force = false) {
- if ($base === null) {
- $base = $this->getProject()->getWorkboardURI();
- }
-
- return $this->getViewState()->newURI($base, $force);
- }
-
private function buildInitializeContent(PhabricatorProject $project) {
$request = $this->getRequest();
$viewer = $this->getViewer();
diff --git a/src/applications/project/state/PhabricatorWorkboardViewState.php b/src/applications/project/state/PhabricatorWorkboardViewState.php
--- a/src/applications/project/state/PhabricatorWorkboardViewState.php
+++ b/src/applications/project/state/PhabricatorWorkboardViewState.php
@@ -107,13 +107,13 @@
return $this->newURI($uri);
}
- public function newURI($path, $force = false) {
+ public function newURI($path) {
$project = $this->getProject();
$uri = new PhutilURI($path);
$request_order = $this->getOrder();
$default_order = $this->getDefaultOrder();
- if ($force || ($request_order !== $default_order)) {
+ if ($request_order !== $default_order) {
$request_value = idx($this->requestState, 'order');
if ($request_value !== null) {
$uri->replaceQueryParam('order', $request_value);
@@ -126,7 +126,7 @@
$request_query = $this->getQueryKey();
$default_query = $this->getDefaultQueryKey();
- if ($force || ($request_query !== $default_query)) {
+ if ($request_query !== $default_query) {
$request_value = idx($this->requestState, 'filter');
if ($request_value !== null) {
$uri->replaceQueryParam('filter', $request_value);

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 21, 2:33 PM (1 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223170
Default Alt Text
D20637.id49222.diff (5 KB)

Event Timeline