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

Expose column positions via maniphest.edit

Summary: Ref T5214. Fixes T10486. Ref T6027. This exposes the `TYPE_COLUMNS` transaction in a usable way via API, and fixes the interactions via prefilling.

Test Plan:
- Created tasks directly into columns via API.
- Moved tasks between columns via API.
- Used `?column=...` to try to create a template task with valid and bogus column PHIDs.

Reviewers: chad

Reviewed By: chad

Subscribers: AmyLewis

Maniphest Tasks: T5214, T6027, T10486

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

+117 -5
+4
src/__phutil_library_map__.php
··· 253 253 'ConduitBoolParameterType' => 'applications/conduit/parametertype/ConduitBoolParameterType.php', 254 254 'ConduitCall' => 'applications/conduit/call/ConduitCall.php', 255 255 'ConduitCallTestCase' => 'applications/conduit/call/__tests__/ConduitCallTestCase.php', 256 + 'ConduitColumnsParameterType' => 'applications/conduit/parametertype/ConduitColumnsParameterType.php', 256 257 'ConduitConnectConduitAPIMethod' => 'applications/conduit/method/ConduitConnectConduitAPIMethod.php', 257 258 'ConduitEpochParameterType' => 'applications/conduit/parametertype/ConduitEpochParameterType.php', 258 259 'ConduitException' => 'applications/conduit/protocol/exception/ConduitException.php', ··· 1984 1985 'PhabricatorChunkedFileStorageEngine' => 'applications/files/engine/PhabricatorChunkedFileStorageEngine.php', 1985 1986 'PhabricatorClusterConfigOptions' => 'applications/config/option/PhabricatorClusterConfigOptions.php', 1986 1987 'PhabricatorColumnProxyInterface' => 'applications/project/interface/PhabricatorColumnProxyInterface.php', 1988 + 'PhabricatorColumnsEditField' => 'applications/transactions/editfield/PhabricatorColumnsEditField.php', 1987 1989 'PhabricatorCommentEditEngineExtension' => 'applications/transactions/engineextension/PhabricatorCommentEditEngineExtension.php', 1988 1990 'PhabricatorCommentEditField' => 'applications/transactions/editfield/PhabricatorCommentEditField.php', 1989 1991 'PhabricatorCommentEditType' => 'applications/transactions/edittype/PhabricatorCommentEditType.php', ··· 4380 4382 'ConduitBoolParameterType' => 'ConduitListParameterType', 4381 4383 'ConduitCall' => 'Phobject', 4382 4384 'ConduitCallTestCase' => 'PhabricatorTestCase', 4385 + 'ConduitColumnsParameterType' => 'ConduitParameterType', 4383 4386 'ConduitConnectConduitAPIMethod' => 'ConduitAPIMethod', 4384 4387 'ConduitEpochParameterType' => 'ConduitListParameterType', 4385 4388 'ConduitException' => 'Exception', ··· 6383 6386 'PhabricatorChatLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 6384 6387 'PhabricatorChunkedFileStorageEngine' => 'PhabricatorFileStorageEngine', 6385 6388 'PhabricatorClusterConfigOptions' => 'PhabricatorApplicationConfigOptions', 6389 + 'PhabricatorColumnsEditField' => 'PhabricatorPHIDListEditField', 6386 6390 'PhabricatorCommentEditEngineExtension' => 'PhabricatorEditEngineExtension', 6387 6391 'PhabricatorCommentEditField' => 'PhabricatorEditField', 6388 6392 'PhabricatorCommentEditType' => 'PhabricatorEditType',
+38
src/applications/conduit/parametertype/ConduitColumnsParameterType.php
··· 1 + <?php 2 + 3 + final class ConduitColumnsParameterType 4 + extends ConduitParameterType { 5 + 6 + protected function getParameterValue(array $request, $key) { 7 + // We don't do any meaningful validation here because the transaction 8 + // itself validates everything and the input format is flexible. 9 + return parent::getParameterValue($request, $key); 10 + } 11 + 12 + protected function getParameterTypeName() { 13 + return 'columns'; 14 + } 15 + 16 + protected function getParameterDefault() { 17 + return array(); 18 + } 19 + 20 + protected function getParameterFormatDescriptions() { 21 + return array( 22 + pht('Single column PHID.'), 23 + pht('List of column PHIDs.'), 24 + pht('List of position dictionaries.'), 25 + pht('List with a mixture of PHIDs and dictionaries.'), 26 + ); 27 + } 28 + 29 + protected function getParameterExamples() { 30 + return array( 31 + '"PHID-PCOL-1111"', 32 + '["PHID-PCOL-2222", "PHID-PCOL-3333"]', 33 + '[{"columnPHID": "PHID-PCOL-4444", "afterPHID": "PHID-TASK-5555"}]', 34 + '[{"columnPHID": "PHID-PCOL-4444", "beforePHID": "PHID-TASK-6666"}]', 35 + ); 36 + } 37 + 38 + }
+54 -4
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 81 81 $owner_value = array($this->getViewer()->getPHID()); 82 82 } 83 83 84 + $column_documentation = pht(<<<EODOCS 85 + You can use this transaction type to create a task into a particular workboard 86 + column, or move an existing task between columns. 87 + 88 + The transaction value can be specified in several forms. Some are simpler but 89 + less powerful, while others are more complex and more powerful. 90 + 91 + The simplest valid value is a single column PHID: 92 + 93 + ```lang=json 94 + "PHID-PCOL-1111" 95 + ``` 96 + 97 + This will move the task into that column, or create the task into that column 98 + if you are creating a new task. If the task is currently on the board, it will 99 + be moved out of any exclusive columns. If the task is not currently on the 100 + board, it will be added to the board. 101 + 102 + You can also perform multiple moves at the same time by passing a list of 103 + PHIDs: 104 + 105 + ```lang=json 106 + ["PHID-PCOL-2222", "PHID-PCOL-3333"] 107 + ``` 108 + 109 + This is equivalent to performing each move individually. 110 + 111 + The most complex and most powerful form uses a dictionary to provide additional 112 + information about the move, including an optional specific position within the 113 + column. 114 + 115 + The target column should be identified as `columnPHID`, and you may select a 116 + position by passing either `beforePHID` or `afterPHID`, specifying the PHID of 117 + a task currently in the column that you want to move this task before or after: 118 + 119 + ```lang=json 120 + [ 121 + { 122 + "columnPHID": "PHID-PCOL-4444", 123 + "beforePHID": "PHID-TASK-5555" 124 + } 125 + ] 126 + ``` 127 + 128 + Note that this affects only the "natural" position of the task. The task 129 + position when the board is sorted by some other attribute (like priority) 130 + depends on that attribute value: change a task's priority to move it on 131 + priority-sorted boards. 132 + EODOCS 133 + ); 134 + 84 135 $fields = array( 85 136 id(new PhabricatorHandlesEditField()) 86 137 ->setKey('parent') ··· 95 146 ->setIsReorderable(false) 96 147 ->setIsDefaultable(false) 97 148 ->setIsLockable(false), 98 - id(new PhabricatorHandlesEditField()) 149 + id(new PhabricatorColumnsEditField()) 99 150 ->setKey('column') 100 151 ->setLabel(pht('Column')) 101 152 ->setDescription(pht('Create a task in a workboard column.')) 102 153 ->setConduitDescription( 103 154 pht('Move a task to one or more workboard columns.')) 104 155 ->setConduitTypeDescription( 105 - pht('PHID or PHIDs of workboard columns.')) 156 + pht('List of columns to move the task to.')) 157 + ->setConduitDocumentation($column_documentation) 106 158 ->setAliases(array('columnPHID', 'columns', 'columnPHIDs')) 107 159 ->setTransactionType(PhabricatorTransactions::TYPE_COLUMNS) 108 - ->setSingleValue(null) 109 - ->setIsInvisible(true) 110 160 ->setIsReorderable(false) 111 161 ->setIsDefaultable(false) 112 162 ->setIsLockable(false),
+21
src/applications/transactions/editfield/PhabricatorColumnsEditField.php
··· 1 + <?php 2 + 3 + final class PhabricatorColumnsEditField 4 + extends PhabricatorPHIDListEditField { 5 + 6 + protected function newControl() { 7 + $control = id(new AphrontFormHandlesControl()); 8 + $control->setIsInvisible(true); 9 + 10 + return $control; 11 + } 12 + 13 + protected function newHTTPParameterType() { 14 + return new AphrontPHIDListHTTPParameterType(); 15 + } 16 + 17 + protected function newConduitParameterType() { 18 + return new ConduitColumnsParameterType(); 19 + } 20 + 21 + }
-1
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 504 504 case PhabricatorTransactions::TYPE_EDIT_POLICY: 505 505 case PhabricatorTransactions::TYPE_JOIN_POLICY: 506 506 case PhabricatorTransactions::TYPE_SPACE: 507 - case PhabricatorTransactions::TYPE_COLUMNS: 508 507 break; 509 508 default: 510 509 $old = $this->getOldValue();