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

Restore "Change Status" and "Change Priority" comment actions to Maniphest

Summary: Ref T9132. Supports selects in stacked actions and adds "Change Status" + "Change Priority".

Test Plan: Changed status and priority from stacked actions.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

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

+111 -32
+16 -16
resources/celerity/map.php
··· 427 427 'rsrc/js/application/repository/repository-crossreference.js' => 'e5339c43', 428 428 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 429 429 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', 430 - 'rsrc/js/application/transactions/behavior-comment-actions.js' => 'dd5cae21', 430 + 'rsrc/js/application/transactions/behavior-comment-actions.js' => '2ada1547', 431 431 'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96', 432 432 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6', 433 433 'rsrc/js/application/transactions/behavior-transaction-comment-form.js' => 'b23b49e6', ··· 506 506 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 507 507 'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262', 508 508 'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca', 509 - 'rsrc/js/phuix/PHUIXFormControl.js' => 'f9fba5ee', 509 + 'rsrc/js/phuix/PHUIXFormControl.js' => '7e1dc09e', 510 510 'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b', 511 511 ), 512 512 'symbols' => array( ··· 571 571 'javelin-behavior-audit-preview' => 'd835b03a', 572 572 'javelin-behavior-bulk-job-reload' => 'edf8a145', 573 573 'javelin-behavior-choose-control' => '6153c708', 574 - 'javelin-behavior-comment-actions' => 'dd5cae21', 574 + 'javelin-behavior-comment-actions' => '2ada1547', 575 575 'javelin-behavior-config-reorder-fields' => 'b6993408', 576 576 'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a', 577 577 'javelin-behavior-conpherence-menu' => '1d45c74d', ··· 831 831 'phuix-action-list-view' => 'b5c256b8', 832 832 'phuix-action-view' => '8cf6d262', 833 833 'phuix-dropdown-menu' => 'bd4c8dca', 834 - 'phuix-form-control-view' => 'f9fba5ee', 834 + 'phuix-form-control-view' => '7e1dc09e', 835 835 'phuix-icon-view' => 'bff6884b', 836 836 'policy-css' => '957ea14c', 837 837 'policy-edit-css' => '815c66f7', ··· 1026 1026 '29274e2b' => array( 1027 1027 'javelin-install', 1028 1028 'javelin-util', 1029 + ), 1030 + '2ada1547' => array( 1031 + 'javelin-behavior', 1032 + 'javelin-stratcom', 1033 + 'javelin-workflow', 1034 + 'javelin-dom', 1035 + 'phuix-form-control-view', 1036 + 'phuix-icon-view', 1029 1037 ), 1030 1038 '2b8de964' => array( 1031 1039 'javelin-install', ··· 1422 1430 'phuix-action-view', 1423 1431 'javelin-workflow', 1424 1432 ), 1433 + '7e1dc09e' => array( 1434 + 'javelin-install', 1435 + 'javelin-dom', 1436 + ), 1425 1437 '7e41274a' => array( 1426 1438 'javelin-install', 1427 1439 ), ··· 1867 1879 'javelin-dom', 1868 1880 'phabricator-busy', 1869 1881 ), 1870 - 'dd5cae21' => array( 1871 - 'javelin-behavior', 1872 - 'javelin-stratcom', 1873 - 'javelin-workflow', 1874 - 'javelin-dom', 1875 - 'phuix-form-control-view', 1876 - 'phuix-icon-view', 1877 - ), 1878 1882 'de2e896f' => array( 1879 1883 'javelin-behavior', 1880 1884 'javelin-dom', ··· 2031 2035 'javelin-mask', 2032 2036 'javelin-util', 2033 2037 'phabricator-busy', 2034 - ), 2035 - 'f9fba5ee' => array( 2036 - 'javelin-install', 2037 - 'javelin-dom', 2038 2038 ), 2039 2039 'fa0f4fc2' => array( 2040 2040 'javelin-behavior',
+13 -4
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 62 62 63 63 // TODO: Restore these or toss them: 64 64 // - Default owner to viewer. 65 - // - Don't show "change status" for closed tasks. 66 65 // - Don't show "change owner" for closed tasks. 67 - // - Don't let users change a task status to "Duplicate". 68 66 // - When closing an unassigned task, assign the closing user. 69 67 // - Make sure implicit CCs on actions are working reasonably. 70 68 69 + if ($object->isClosed()) { 70 + $priority_label = null; 71 + $default_status = ManiphestTaskStatus::getDefaultStatus(); 72 + } else { 73 + $priority_label = pht('Change Priority'); 74 + $default_status = ManiphestTaskStatus::getDefaultClosedStatus(); 75 + } 76 + 71 77 return array( 72 78 id(new PhabricatorTextEditField()) 73 79 ->setKey('title') ··· 82 88 ->setDescription(pht('Status of the task.')) 83 89 ->setTransactionType(ManiphestTransaction::TYPE_STATUS) 84 90 ->setValue($object->getStatus()) 85 - ->setOptions($status_map), 91 + ->setOptions($status_map) 92 + ->setCommentActionLabel(pht('Change Status')) 93 + ->setCommentActionDefaultValue($default_status), 86 94 id(new PhabricatorUsersEditField()) 87 95 ->setKey('owner') 88 96 ->setAliases(array('ownerPHID', 'assign', 'assigned')) ··· 96 104 ->setDescription(pht('Priority of the task.')) 97 105 ->setTransactionType(ManiphestTransaction::TYPE_PRIORITY) 98 106 ->setValue($object->getPriority()) 99 - ->setOptions($priority_map), 107 + ->setOptions($priority_map) 108 + ->setCommentActionLabel($priority_label), 100 109 id(new PhabricatorRemarkupEditField()) 101 110 ->setKey('description') 102 111 ->setLabel(pht('Description'))
+11
src/applications/transactions/editfield/PhabricatorEditField.php
··· 15 15 private $description; 16 16 private $editTypeKey; 17 17 private $isRequired; 18 + private $commentActionLabel; 18 19 19 20 private $isLocked; 20 21 private $isHidden; ··· 171 172 public function getControlError() { 172 173 return $this->controlError; 173 174 } 175 + 176 + public function setCommentActionLabel($label) { 177 + $this->commentActionLabel = $label; 178 + return $this; 179 + } 180 + 181 + public function getCommentActionLabel() { 182 + return $this->commentActionLabel; 183 + } 184 + 174 185 175 186 protected function newControl() { 176 187 throw new PhutilMethodNotImplementedException();
+33
src/applications/transactions/editfield/PhabricatorSelectEditField.php
··· 4 4 extends PhabricatorEditField { 5 5 6 6 private $options; 7 + private $commentActionDefaultValue; 7 8 8 9 public function setOptions(array $options) { 9 10 $this->options = $options; ··· 17 18 return $this->options; 18 19 } 19 20 21 + public function setCommentActionDefaultValue($default) { 22 + $this->commentActionDefaultValue = $default; 23 + return $this; 24 + } 25 + 26 + public function getCommentActionDefaultValue() { 27 + return $this->commentActionDefaultValue; 28 + } 29 + 20 30 protected function newControl() { 21 31 return id(new AphrontFormSelectControl()) 22 32 ->setOptions($this->getOptions()); ··· 24 34 25 35 protected function newHTTPParameterType() { 26 36 return new AphrontSelectHTTPParameterType(); 37 + } 38 + 39 + public function getCommentEditTypes() { 40 + $label = $this->getCommentActionLabel(); 41 + if ($label === null) { 42 + return array(); 43 + } 44 + 45 + $default_value = $this->getCommentActionDefaultValue(); 46 + if ($default_value === null) { 47 + $default_value = $this->getValue(); 48 + } 49 + 50 + $edit = $this->getEditType() 51 + ->setLabel($label) 52 + ->setPHUIXControlType('select') 53 + ->setPHUIXControlSpecification( 54 + array( 55 + 'options' => $this->getOptions(), 56 + 'value' => $default_value, 57 + )); 58 + 59 + return array($edit); 27 60 } 28 61 29 62 }
-11
src/applications/transactions/editfield/PhabricatorTokenizerEditField.php
··· 3 3 abstract class PhabricatorTokenizerEditField 4 4 extends PhabricatorPHIDListEditField { 5 5 6 - private $commentActionLabel; 7 - 8 6 abstract protected function newDatasource(); 9 - 10 - public function setCommentActionLabel($label) { 11 - $this->commentActionLabel = $label; 12 - return $this; 13 - } 14 - 15 - public function getCommentActionLabel() { 16 - return $this->commentActionLabel; 17 - } 18 7 19 8 protected function newControl() { 20 9 $control = id(new AphrontFormTokenizerControl())
+20
src/applications/transactions/edittype/PhabricatorSimpleEditType.php
··· 4 4 5 5 private $valueType; 6 6 private $valueDescription; 7 + private $phuixControlType; 8 + private $phuixControlSpecification = array(); 7 9 8 10 public function setValueType($value_type) { 9 11 $this->valueType = $value_type; ··· 31 33 32 34 public function getValueDescription() { 33 35 return $this->valueDescription; 36 + } 37 + 38 + public function setPHUIXControlType($type) { 39 + $this->phuixControlType = $type; 40 + return $this; 41 + } 42 + 43 + public function getPHUIXControlType() { 44 + return $this->phuixControlType; 45 + } 46 + 47 + public function setPHUIXControlSpecification(array $spec) { 48 + $this->phuixControlSpecification = $spec; 49 + return $this; 50 + } 51 + 52 + public function getPHUIXControlSpecification() { 53 + return $this->phuixControlSpecification; 34 54 } 35 55 36 56 }
+1 -1
webroot/rsrc/js/application/transactions/behavior-comment-actions.js
··· 62 62 var control = new JX.PHUIXFormControl() 63 63 .setLabel(action.label) 64 64 .setError(remove) 65 - .setControl('tokenizer', action.spec); 65 + .setControl(action.type, action.spec); 66 66 var node = control.getNode(); 67 67 68 68 rows[action.key] = control;
+17
webroot/rsrc/js/phuix/PHUIXFormControl.js
··· 32 32 case 'tokenizer': 33 33 input = this._newTokenizer(spec); 34 34 break; 35 + case 'select': 36 + input = this._newSelect(spec); 37 + break; 35 38 default: 36 39 // TODO: Default or better error? 37 40 JX.$E('Bad Input Type'); ··· 124 127 for (var k in map) { 125 128 build.tokenizer.addToken(k, map[k]); 126 129 } 130 + } 131 + }; 132 + }, 133 + 134 + _newSelect: function(spec) { 135 + var node = JX.Prefab.renderSelect(spec.options, spec.value); 136 + 137 + return { 138 + node: node, 139 + get: function() { 140 + return node.value; 141 + }, 142 + set: function(value) { 143 + node.value = value; 127 144 } 128 145 }; 129 146 }