From a25c79bbc01ee145224ca7269b5d9e4f01c51f05 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 14 May 2017 15:27:29 -0400 Subject: [PATCH] Add Column Edit / History actions to workboard columns Summary: This brings up "Edit Column" as an action item under the main column dropdown as well as a "Column History" for completeness. Unsure column history is actually useful, but leaving it in anyways. It might be nice to have some sort of dialog version of a history page. Test Plan: Make a workboard, add a column, edit column name, stay on workboard. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D17874 --- .../PhabricatorProjectBoardViewController.php | 16 ++++++++++++++++ .../PhabricatorProjectColumnDetailController.php | 2 +- .../PhabricatorProjectColumnEditController.php | 7 +------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php index 80ed701ff9..3b117c747f 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php @@ -837,6 +837,16 @@ final class PhabricatorProjectBoardViewController ->setHref($batch_edit_uri) ->setDisabled(!$can_batch_edit); + // Column Related Actions Below + // + $edit_uri = 'board/'.$this->id.'/edit/'.$column->getID().'/'; + $column_items[] = id(new PhabricatorActionView()) + ->setName(pht('Edit Column')) + ->setIcon('fa-pencil') + ->setHref($this->getApplicationURI($edit_uri)) + ->setDisabled(!$can_edit) + ->setWorkflow(true); + $can_hide = ($can_edit && !$column->isDefaultColumn()); $hide_uri = 'board/'.$this->id.'/hide/'.$column->getID().'/'; $hide_uri = $this->getApplicationURI($hide_uri); @@ -858,6 +868,12 @@ final class PhabricatorProjectBoardViewController ->setWorkflow(true); } + $details_uri = 'board/'.$this->id.'/column/'.$column->getID().'/'; + $column_items[] = id(new PhabricatorActionView()) + ->setName(pht('Column History')) + ->setIcon('fa-columns') + ->setHref($this->getApplicationURI($details_uri)); + $column_menu = id(new PhabricatorActionListView()) ->setUser($viewer); foreach ($column_items as $item) { diff --git a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php index 84bdc2b89c..d922d24714 100644 --- a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php +++ b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php @@ -103,7 +103,7 @@ final class PhabricatorProjectColumnDetailController ->setIcon('fa-pencil') ->setHref($this->getApplicationURI($base_uri.'edit/'.$id.'/')) ->setDisabled(!$can_edit) - ->setWorkflow(!$can_edit)); + ->setWorkflow(true)); return $actions; } diff --git a/src/applications/project/controller/PhabricatorProjectColumnEditController.php b/src/applications/project/controller/PhabricatorProjectColumnEditController.php index fb0c7b0910..94277c92e5 100644 --- a/src/applications/project/controller/PhabricatorProjectColumnEditController.php +++ b/src/applications/project/controller/PhabricatorProjectColumnEditController.php @@ -51,12 +51,7 @@ final class PhabricatorProjectColumnEditController $validation_exception = null; $base_uri = '/board/'.$project_id.'/'; - if ($is_new) { - // we want to go back to the board - $view_uri = $this->getApplicationURI($base_uri); - } else { - $view_uri = $this->getApplicationURI($base_uri.'column/'.$id.'/'); - } + $view_uri = $this->getApplicationURI($base_uri); if ($request->isFormPost()) { $v_name = $request->getStr('name');