mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Move column hide/show to the column context menu on workboards
Summary: Fixes T5993. Now that we have a context menu we can make some edit operations easier to access. Test Plan: Toggled column visibility. Verified board state (columns shown/hidden, ordering) was retained. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T5993 Differential Revision: https://secure.phabricator.com/D10417
This commit is contained in:
parent
2f4addc671
commit
d8e3f2edf2
5 changed files with 36 additions and 27 deletions
|
@ -1940,13 +1940,13 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectApplication' => 'applications/project/application/PhabricatorProjectApplication.php',
|
||||
'PhabricatorProjectArchiveController' => 'applications/project/controller/PhabricatorProjectArchiveController.php',
|
||||
'PhabricatorProjectBoardController' => 'applications/project/controller/PhabricatorProjectBoardController.php',
|
||||
'PhabricatorProjectBoardDeleteController' => 'applications/project/controller/PhabricatorProjectBoardDeleteController.php',
|
||||
'PhabricatorProjectBoardImportController' => 'applications/project/controller/PhabricatorProjectBoardImportController.php',
|
||||
'PhabricatorProjectBoardReorderController' => 'applications/project/controller/PhabricatorProjectBoardReorderController.php',
|
||||
'PhabricatorProjectBoardViewController' => 'applications/project/controller/PhabricatorProjectBoardViewController.php',
|
||||
'PhabricatorProjectColumn' => 'applications/project/storage/PhabricatorProjectColumn.php',
|
||||
'PhabricatorProjectColumnDetailController' => 'applications/project/controller/PhabricatorProjectColumnDetailController.php',
|
||||
'PhabricatorProjectColumnEditController' => 'applications/project/controller/PhabricatorProjectColumnEditController.php',
|
||||
'PhabricatorProjectColumnHideController' => 'applications/project/controller/PhabricatorProjectColumnHideController.php',
|
||||
'PhabricatorProjectColumnPHIDType' => 'applications/project/phid/PhabricatorProjectColumnPHIDType.php',
|
||||
'PhabricatorProjectColumnPosition' => 'applications/project/storage/PhabricatorProjectColumnPosition.php',
|
||||
'PhabricatorProjectColumnPositionQuery' => 'applications/project/query/PhabricatorProjectColumnPositionQuery.php',
|
||||
|
@ -4800,7 +4800,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorProjectArchiveController' => 'PhabricatorProjectController',
|
||||
'PhabricatorProjectBoardController' => 'PhabricatorProjectController',
|
||||
'PhabricatorProjectBoardDeleteController' => 'PhabricatorProjectBoardController',
|
||||
'PhabricatorProjectBoardImportController' => 'PhabricatorProjectBoardController',
|
||||
'PhabricatorProjectBoardReorderController' => 'PhabricatorProjectBoardController',
|
||||
'PhabricatorProjectBoardViewController' => 'PhabricatorProjectBoardController',
|
||||
|
@ -4811,6 +4810,7 @@ phutil_register_library_map(array(
|
|||
),
|
||||
'PhabricatorProjectColumnDetailController' => 'PhabricatorProjectBoardController',
|
||||
'PhabricatorProjectColumnEditController' => 'PhabricatorProjectBoardController',
|
||||
'PhabricatorProjectColumnHideController' => 'PhabricatorProjectBoardController',
|
||||
'PhabricatorProjectColumnPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorProjectColumnPosition' => array(
|
||||
'PhabricatorProjectDAO',
|
||||
|
|
|
@ -67,8 +67,8 @@ final class PhabricatorProjectApplication extends PhabricatorApplication {
|
|||
'board/(?P<projectID>[1-9]\d*)/' => array(
|
||||
'edit/(?:(?P<id>\d+)/)?'
|
||||
=> 'PhabricatorProjectColumnEditController',
|
||||
'delete/(?:(?P<id>\d+)/)?'
|
||||
=> 'PhabricatorProjectBoardDeleteController',
|
||||
'hide/(?:(?P<id>\d+)/)?'
|
||||
=> 'PhabricatorProjectColumnHideController',
|
||||
'column/(?:(?P<id>\d+)/)?'
|
||||
=> 'PhabricatorProjectColumnDetailController',
|
||||
'import/'
|
||||
|
|
|
@ -562,6 +562,27 @@ final class PhabricatorProjectBoardViewController
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit);
|
||||
|
||||
$can_hide = ($can_edit && !$column->isDefaultColumn());
|
||||
$hide_uri = 'board/'.$this->id.'/hide/'.$column->getID().'/';
|
||||
$hide_uri = $this->getApplicationURI($hide_uri);
|
||||
$hide_uri = $this->getURIWithState($hide_uri);
|
||||
|
||||
if (!$column->isHidden()) {
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setName(pht('Hide Column'))
|
||||
->setIcon('fa-eye-slash')
|
||||
->setHref($hide_uri)
|
||||
->setDisabled(!$can_hide)
|
||||
->setWorkflow(true);
|
||||
} else {
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setName(pht('Show Column'))
|
||||
->setIcon('fa-eye')
|
||||
->setHref($hide_uri)
|
||||
->setDisabled(!$can_hide)
|
||||
->setWorkflow(true);
|
||||
}
|
||||
|
||||
$column_menu = id(new PhabricatorActionListView())
|
||||
->setUser($viewer);
|
||||
foreach ($column_items as $item) {
|
||||
|
|
|
@ -119,26 +119,6 @@ final class PhabricatorProjectColumnDetailController
|
|||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit));
|
||||
|
||||
$can_hide = ($can_edit && !$column->isDefaultColumn());
|
||||
|
||||
if (!$column->isHidden()) {
|
||||
$actions->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Hide Column'))
|
||||
->setIcon('fa-eye-slash')
|
||||
->setHref($this->getApplicationURI($base_uri.'delete/'.$id.'/'))
|
||||
->setDisabled(!$can_hide)
|
||||
->setWorkflow(true));
|
||||
} else {
|
||||
$actions->addAction(
|
||||
id(new PhabricatorActionView())
|
||||
->setName(pht('Show Column'))
|
||||
->setIcon('fa-eye')
|
||||
->setHref($this->getApplicationURI($base_uri.'delete/'.$id.'/'))
|
||||
->setDisabled(!$can_hide)
|
||||
->setWorkflow(true));
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorProjectBoardDeleteController
|
||||
final class PhabricatorProjectColumnHideController
|
||||
extends PhabricatorProjectBoardController {
|
||||
|
||||
private $id;
|
||||
|
@ -42,8 +42,12 @@ final class PhabricatorProjectBoardDeleteController
|
|||
}
|
||||
|
||||
$column_phid = $column->getPHID();
|
||||
$view_uri = $this->getApplicationURI(
|
||||
'/board/'.$this->projectID.'/column/'.$this->id.'/');
|
||||
|
||||
$view_uri = $this->getApplicationURI('/board/'.$this->projectID.'/');
|
||||
$view_uri = new PhutilURI($view_uri);
|
||||
foreach ($request->getPassthroughRequestData() as $key => $value) {
|
||||
$view_uri->setQueryParam($key, $value);
|
||||
}
|
||||
|
||||
if ($column->isDefaultColumn()) {
|
||||
return $this->newDialog()
|
||||
|
@ -97,6 +101,10 @@ final class PhabricatorProjectBoardDeleteController
|
|||
->addCancelButton($view_uri)
|
||||
->addSubmitButton($title);
|
||||
|
||||
foreach ($request->getPassthroughRequestData() as $key => $value) {
|
||||
$dialog->addHiddenInput($key, $value);
|
||||
}
|
||||
|
||||
return $dialog;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue