@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.

Allow stacked comment actions to be explicitly ordered

Summary:
Ref T6027. Normally, actions use the same order as the form, but in some cases (like moving stuff on workboards) it makes sense to reorder them explicitly.

Pin "Move on board" near the bottom, and "projects/subscribers" at the bottom. I think these are generally reasonable rules in all cases.

Test Plan: Opened menu, saw slightly better action order.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6027

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

+32 -1
+1
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 163 163 ->setIsDefaultable(false) 164 164 ->setIsLockable(false) 165 165 ->setCommentActionLabel(pht('Move on Workboard')) 166 + ->setCommentActionOrder(2000) 166 167 ->setColumnMap($column_map), 167 168 id(new PhabricatorTextEditField()) 168 169 ->setKey('title')
+1
src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php
··· 50 50 ->setIsCopyable(true) 51 51 ->setUseEdgeTransactions(true) 52 52 ->setCommentActionLabel(pht('Change Project Tags')) 53 + ->setCommentActionOrder(8000) 53 54 ->setDescription(pht('Select project tags for the object.')) 54 55 ->setTransactionType($edge_type) 55 56 ->setMetadataValue('edge:type', $project_edge_type)
+1
src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php
··· 45 45 ->setIsCopyable(true) 46 46 ->setUseEdgeTransactions(true) 47 47 ->setCommentActionLabel(pht('Change Subscribers')) 48 + ->setCommentActionOrder(9000) 48 49 ->setDescription(pht('Choose subscribers.')) 49 50 ->setTransactionType($subscribers_type) 50 51 ->setValue($sub_phids);
+15
src/applications/transactions/commentaction/PhabricatorEditEngineCommentAction.php
··· 6 6 private $label; 7 7 private $value; 8 8 private $initialValue; 9 + private $order; 9 10 10 11 abstract public function getPHUIXControlType(); 11 12 abstract public function getPHUIXControlSpecification(); ··· 35 36 36 37 public function getValue() { 37 38 return $this->value; 39 + } 40 + 41 + public function setOrder($order) { 42 + $this->order = $order; 43 + return $this; 44 + } 45 + 46 + public function getOrder() { 47 + return $this->order; 48 + } 49 + 50 + public function getSortVector() { 51 + return id(new PhutilSortVector()) 52 + ->addInt($this->getOrder()); 38 53 } 39 54 40 55 public function setInitialValue($initial_value) {
+2
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 1382 1382 $comment_actions[$key] = $comment_action; 1383 1383 } 1384 1384 1385 + $comment_actions = msortv($comment_actions, 'getSortVector'); 1386 + 1385 1387 $view->setCommentActions($comment_actions); 1386 1388 1387 1389 return $view;
+12 -1
src/applications/transactions/editfield/PhabricatorEditField.php
··· 24 24 25 25 private $commentActionLabel; 26 26 private $commentActionValue; 27 + private $commentActionOrder = 1000; 27 28 private $hasCommentActionValue; 28 29 29 30 private $isLocked; ··· 241 242 242 243 public function getCommentActionLabel() { 243 244 return $this->commentActionLabel; 245 + } 246 + 247 + public function setCommentActionOrder($order) { 248 + $this->commentActionOrder = $order; 249 + return $this; 250 + } 251 + 252 + public function getCommentActionOrder() { 253 + return $this->commentActionOrder; 244 254 } 245 255 246 256 public function setCommentActionValue($comment_action_value) { ··· 686 696 $action 687 697 ->setKey($this->getKey()) 688 698 ->setLabel($label) 689 - ->setValue($this->getValueForCommentAction($value)); 699 + ->setValue($this->getValueForCommentAction($value)) 700 + ->setOrder($this->getCommentActionOrder()); 690 701 691 702 return $action; 692 703 }