Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14355892
D15639.id37678.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D15639.id37678.diff
View Options
diff --git a/src/applications/maniphest/editor/ManiphestEditEngine.php b/src/applications/maniphest/editor/ManiphestEditEngine.php
--- a/src/applications/maniphest/editor/ManiphestEditEngine.php
+++ b/src/applications/maniphest/editor/ManiphestEditEngine.php
@@ -163,6 +163,7 @@
->setIsDefaultable(false)
->setIsLockable(false)
->setCommentActionLabel(pht('Move on Workboard'))
+ ->setCommentActionOrder(2000)
->setColumnMap($column_map),
id(new PhabricatorTextEditField())
->setKey('title')
diff --git a/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php b/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php
--- a/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php
+++ b/src/applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php
@@ -50,6 +50,7 @@
->setIsCopyable(true)
->setUseEdgeTransactions(true)
->setCommentActionLabel(pht('Change Project Tags'))
+ ->setCommentActionOrder(8000)
->setDescription(pht('Select project tags for the object.'))
->setTransactionType($edge_type)
->setMetadataValue('edge:type', $project_edge_type)
diff --git a/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php b/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php
--- a/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php
+++ b/src/applications/subscriptions/engineextension/PhabricatorSubscriptionsEditEngineExtension.php
@@ -45,6 +45,7 @@
->setIsCopyable(true)
->setUseEdgeTransactions(true)
->setCommentActionLabel(pht('Change Subscribers'))
+ ->setCommentActionOrder(9000)
->setDescription(pht('Choose subscribers.'))
->setTransactionType($subscribers_type)
->setValue($sub_phids);
diff --git a/src/applications/transactions/commentaction/PhabricatorEditEngineCommentAction.php b/src/applications/transactions/commentaction/PhabricatorEditEngineCommentAction.php
--- a/src/applications/transactions/commentaction/PhabricatorEditEngineCommentAction.php
+++ b/src/applications/transactions/commentaction/PhabricatorEditEngineCommentAction.php
@@ -6,6 +6,7 @@
private $label;
private $value;
private $initialValue;
+ private $order;
abstract public function getPHUIXControlType();
abstract public function getPHUIXControlSpecification();
@@ -37,6 +38,20 @@
return $this->value;
}
+ public function setOrder($order) {
+ $this->order = $order;
+ return $this;
+ }
+
+ public function getOrder() {
+ return $this->order;
+ }
+
+ public function getSortVector() {
+ return id(new PhutilSortVector())
+ ->addInt($this->getOrder());
+ }
+
public function setInitialValue($initial_value) {
$this->initialValue = $initial_value;
return $this;
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -1382,6 +1382,8 @@
$comment_actions[$key] = $comment_action;
}
+ $comment_actions = msortv($comment_actions, 'getSortVector');
+
$view->setCommentActions($comment_actions);
return $view;
diff --git a/src/applications/transactions/editfield/PhabricatorEditField.php b/src/applications/transactions/editfield/PhabricatorEditField.php
--- a/src/applications/transactions/editfield/PhabricatorEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorEditField.php
@@ -24,6 +24,7 @@
private $commentActionLabel;
private $commentActionValue;
+ private $commentActionOrder = 1000;
private $hasCommentActionValue;
private $isLocked;
@@ -243,6 +244,15 @@
return $this->commentActionLabel;
}
+ public function setCommentActionOrder($order) {
+ $this->commentActionOrder = $order;
+ return $this;
+ }
+
+ public function getCommentActionOrder() {
+ return $this->commentActionOrder;
+ }
+
public function setCommentActionValue($comment_action_value) {
$this->hasCommentActionValue = true;
$this->commentActionValue = $comment_action_value;
@@ -686,7 +696,8 @@
$action
->setKey($this->getKey())
->setLabel($label)
- ->setValue($this->getValueForCommentAction($value));
+ ->setValue($this->getValueForCommentAction($value))
+ ->setOrder($this->getCommentActionOrder());
return $action;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 6:53 PM (6 h, 47 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6911643
Default Alt Text
D15639.id37678.diff (4 KB)
Attached To
Mode
D15639: Allow stacked comment actions to be explicitly ordered
Attached
Detach File
Event Timeline
Log In to Comment