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

Simplify "Tasks" field in Differential

Summary:
Ref T11114. Keep UI, throw everything else away.

Includes an imperfect-but-not-too-awful fix to keep the field actually working.

Test Plan: Edited tasks from CLI.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114

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

+22 -75
-63
src/applications/differential/customfield/DifferentialManiphestTasksField.php
··· 7 7 return 'differential:maniphest-tasks'; 8 8 } 9 9 10 - public function getFieldKeyForConduit() { 11 - return 'maniphestTaskPHIDs'; 12 - } 13 - 14 10 public function canDisableField() { 15 11 return false; 16 12 } ··· 41 37 DifferentialRevisionHasTaskEdgeType::EDGECONST); 42 38 } 43 39 44 - public function getApplicationTransactionType() { 45 - return PhabricatorTransactions::TYPE_EDGE; 46 - } 47 - 48 - public function getApplicationTransactionMetadata() { 49 - return array( 50 - 'edge:type' => DifferentialRevisionHasTaskEdgeType::EDGECONST, 51 - ); 52 - } 53 - 54 - public function getNewValueForApplicationTransactions() { 55 - $edges = array(); 56 - foreach ($this->getValue() as $phid) { 57 - $edges[$phid] = $phid; 58 - } 59 - 60 - return array('=' => $edges); 61 - } 62 - 63 40 public function getRequiredHandlePHIDsForPropertyView() { 64 41 return $this->getValue(); 65 42 } 66 43 67 44 public function renderPropertyViewValue(array $handles) { 68 45 return $this->renderHandleList($handles); 69 - } 70 - 71 - public function shouldAppearInCommitMessage() { 72 - return true; 73 - } 74 - 75 - public function shouldAllowEditInCommitMessage() { 76 - return true; 77 - } 78 - 79 - public function getCommitMessageLabels() { 80 - return array( 81 - 'Maniphest Task', 82 - 'Maniphest Tasks', 83 - ); 84 - } 85 - 86 - public function parseValueFromCommitMessage($value) { 87 - return $this->parseObjectList( 88 - $value, 89 - array( 90 - ManiphestTaskPHIDType::TYPECONST, 91 - )); 92 - } 93 - 94 - public function getRequiredHandlePHIDsForCommitMessage() { 95 - return $this->getRequiredHandlePHIDsForPropertyView(); 96 - } 97 - 98 - public function renderCommitMessageValue(array $handles) { 99 - return $this->renderObjectList($handles); 100 - } 101 - 102 - public function getProTips() { 103 - return array( 104 - pht( 105 - 'Write "%s" in your summary to automatically close the '. 106 - 'corresponding task when this change lands.', 107 - 'Fixes T123'), 108 - ); 109 46 } 110 47 111 48 }
-9
src/applications/differential/customfield/DifferentialProjectReviewersField.php
··· 57 57 return $reviewers; 58 58 } 59 59 60 - public function getProTips() { 61 - return array( 62 - pht( 63 - 'You can add a project as a subscriber or reviewer by writing '. 64 - '"%s" in the appropriate field.', 65 - '#projectname'), 66 - ); 67 - } 68 - 69 60 }
+15
src/applications/differential/editor/DifferentialRevisionEditEngine.php
··· 192 192 ->setConduitTypeDescription(pht('New repository.')) 193 193 ->setSingleValue($object->getRepositoryPHID()); 194 194 195 + // This is a little flimsy, but allows "Maniphest Tasks: ..." to continue 196 + // working properly in commit messages until we fully sort out T5873. 197 + $fields[] = id(new PhabricatorHandlesEditField()) 198 + ->setKey('tasks') 199 + ->setUseEdgeTransactions(true) 200 + ->setIsConduitOnly(true) 201 + ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) 202 + ->setMetadataValue( 203 + 'edge:type', 204 + DifferentialRevisionHasTaskEdgeType::EDGECONST) 205 + ->setDescription(pht('Tasks associated with this revision.')) 206 + ->setConduitDescription(pht('Change associated tasks.')) 207 + ->setConduitTypeDescription(pht('List of tasks.')) 208 + ->setValue(array()); 209 + 195 210 return $fields; 196 211 } 197 212
+1 -1
src/applications/differential/field/DifferentialCommitMessageField.php
··· 182 182 protected function isCustomFieldEnabled($key) { 183 183 $field_list = PhabricatorCustomField::getObjectFields( 184 184 new DifferentialRevision(), 185 - DifferentialCustomField::ROLE_COMMITMESSAGE); 185 + DifferentialCustomField::ROLE_DEFAULT); 186 186 187 187 $fields = $field_list->getFields(); 188 188 return isset($fields[$key]);
+6 -2
src/applications/differential/field/DifferentialTasksCommitMessageField.php
··· 55 55 } 56 56 57 57 public function getFieldTransactions($value) { 58 - // TODO: Implement this! 59 - return array(); 58 + return array( 59 + array( 60 + 'type' => 'tasks.set', 61 + 'value' => $value, 62 + ), 63 + ); 60 64 } 61 65 }