@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve some column behaviors for Milestone/Subproject columns

Summary:
Ref T10010.

- Don't allow milestones to be reordered.
- Hide phantom subproject columns when reodrering.
- Don't allow subproject/milestone columns to be renamed.
- Force milestones to be ordered at the end, and in the correct order.
- Add some missing crumbs.

Test Plan: Reordered columns, renamed columns, made a new column, viewed column details.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D15183

+64 -22
+12 -1
src/applications/project/controller/PhabricatorProjectBoardReorderController.php
··· 97 97 ->setFlush(true); 98 98 99 99 foreach ($columns as $column) { 100 + // Don't allow milestone columns to be reordered. 101 + $proxy = $column->getProxy(); 102 + if ($proxy && $proxy->isMilestone()) { 103 + continue; 104 + } 105 + 106 + // At least for now, don't show subproject column. 107 + if ($proxy) { 108 + continue; 109 + } 110 + 100 111 $item = id(new PHUIObjectItemView()) 101 112 ->setHeader($column->getDisplayName()) 102 - ->addIcon('none', $column->getDisplayType()); 113 + ->addIcon($column->getHeaderIcon(), $column->getDisplayType()); 103 114 104 115 if ($column->isHidden()) { 105 116 $item->setDisabled(true);
+7
src/applications/project/controller/PhabricatorProjectColumnDetailController.php
··· 22 22 } 23 23 $this->setProject($project); 24 24 25 + $project_id = $project->getID(); 26 + 25 27 $column = id(new PhabricatorProjectColumnQuery()) 26 28 ->setViewer($viewer) 27 29 ->withIDs(array($id)) ··· 45 47 $actions = $this->buildActionView($column); 46 48 $properties = $this->buildPropertyView($column, $actions); 47 49 50 + $crumbs = $this->buildApplicationCrumbs(); 51 + $crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$project_id}/"); 52 + $crumbs->addTextCrumb(pht('Column: %s', $title)); 53 + 48 54 $box = id(new PHUIObjectBoxView()) 49 55 ->setHeader($header) 50 56 ->addPropertyList($properties); ··· 54 60 return $this->newPage() 55 61 ->setTitle($title) 56 62 ->setNavigation($nav) 63 + ->setCrumbs($crumbs) 57 64 ->appendChild( 58 65 array( 59 66 $box,
+21 -19
src/applications/project/controller/PhabricatorProjectColumnEditController.php
··· 81 81 82 82 $xactions = array(); 83 83 84 - $type_name = PhabricatorProjectColumnTransaction::TYPE_NAME; 85 - $xactions[] = id(new PhabricatorProjectColumnTransaction()) 86 - ->setTransactionType($type_name) 87 - ->setNewValue($v_name); 84 + if (!$column->getProxy()) { 85 + $type_name = PhabricatorProjectColumnTransaction::TYPE_NAME; 86 + $xactions[] = id(new PhabricatorProjectColumnTransaction()) 87 + ->setTransactionType($type_name) 88 + ->setNewValue($v_name); 89 + } 88 90 89 91 $type_limit = PhabricatorProjectColumnTransaction::TYPE_LIMIT; 90 92 $xactions[] = id(new PhabricatorProjectColumnTransaction()) ··· 105 107 } 106 108 } 107 109 108 - $form = new AphrontFormView(); 109 - $form 110 - ->setUser($request->getUser()) 111 - ->appendChild( 110 + $form = id(new AphrontFormView()) 111 + ->setUser($request->getUser()); 112 + 113 + if (!$column->getProxy()) { 114 + $form->appendChild( 112 115 id(new AphrontFormTextControl()) 113 116 ->setValue($v_name) 114 117 ->setLabel(pht('Name')) 115 118 ->setName('name') 116 - ->setError($e_name) 117 - ->setCaption( 118 - pht('This will be displayed as the header of the column.'))) 119 - ->appendChild( 120 - id(new AphrontFormTextControl()) 121 - ->setValue($v_limit) 122 - ->setLabel(pht('Point Limit')) 123 - ->setName('limit') 124 - ->setError($e_limit) 125 - ->setCaption( 126 - pht('Maximum number of points of tasks allowed in the column.'))); 119 + ->setError($e_name)); 120 + } 127 121 122 + $form->appendChild( 123 + id(new AphrontFormTextControl()) 124 + ->setValue($v_limit) 125 + ->setLabel(pht('Point Limit')) 126 + ->setName('limit') 127 + ->setError($e_limit) 128 + ->setCaption( 129 + pht('Maximum number of points of tasks allowed in the column.'))); 128 130 129 131 if ($is_new) { 130 132 $title = pht('Create Column');
+3 -1
src/applications/project/engine/PhabricatorBoardLayoutEngine.php
··· 317 317 ->setViewer($viewer) 318 318 ->withProjectPHIDs(array_keys($boards)) 319 319 ->execute(); 320 - $columns = msort($columns, 'getSequence'); 320 + $columns = msort($columns, 'getOrderingKey'); 321 321 $columns = mpull($columns, null, 'getPHID'); 322 322 323 323 $need_children = array(); ··· 367 367 $board_columns[$new_column->getPHID()] = $new_column; 368 368 } 369 369 } 370 + 371 + $board_columns = msort($board_columns, 'getOrderingKey'); 370 372 371 373 $columns[$board_phid] = $board_columns; 372 374 }
+21 -1
src/applications/project/storage/PhabricatorProjectColumn.php
··· 27 27 public static function initializeNewColumn(PhabricatorUser $user) { 28 28 return id(new PhabricatorProjectColumn()) 29 29 ->setName('') 30 - ->setStatus(self::STATUS_ACTIVE); 30 + ->setStatus(self::STATUS_ACTIVE) 31 + ->attachProxy(null); 31 32 } 32 33 33 34 protected function getConfiguration() { ··· 155 156 public function setPointLimit($limit) { 156 157 $this->setProperty('pointLimit', $limit); 157 158 return $this; 159 + } 160 + 161 + public function getOrderingKey() { 162 + $proxy = $this->getProxy(); 163 + 164 + // Normal columns and subproject columns go first, in a user-controlled 165 + // order. 166 + 167 + // All the milestone columns go last, in their sequential order. 168 + 169 + if (!$proxy || !$proxy->isMilestone()) { 170 + $group = 'A'; 171 + $sequence = $this->getSequence(); 172 + } else { 173 + $group = 'B'; 174 + $sequence = $proxy->getMilestoneNumber(); 175 + } 176 + 177 + return sprintf('%s%012d', $group, $sequence); 158 178 } 159 179 160 180