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

Add some documentation about how to set paths with owners.edit

Summary:
Ref T9964.

- New mechanism for rich documentation on unusual/complicated edits.
- Add some docs to `paths.set` since it's not self-evident what you're supposed to pass in.

Test Plan: {F1027177}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

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

+59 -2
+31 -1
src/applications/owners/editor/PhabricatorOwnersPackageEditEngine.php
··· 44 44 } 45 45 46 46 protected function buildCustomEditFields($object) { 47 + 48 + $paths_help = pht(<<<EOTEXT 49 + When updating the paths for a package, pass a list of dictionaries like 50 + this as the `value` for the transaction: 51 + 52 + ```lang=json, name="Example Paths Value" 53 + [ 54 + { 55 + "repositoryPHID": "PHID-REPO-1234", 56 + "path": "/path/to/directory/", 57 + "excluded": false 58 + }, 59 + { 60 + "repositoryPHID": "PHID-REPO-1234", 61 + "path": "/another/example/path/", 62 + "excluded": false 63 + } 64 + ] 65 + ``` 66 + 67 + This transaction will set the paths to the list you provide, overwriting any 68 + previous paths. 69 + 70 + Generally, you will call `owners.search` first to get a list of current paths 71 + (which are provided in the same format), make changes, then update them by 72 + applying a transaction of this type. 73 + EOTEXT 74 + ); 75 + 47 76 return array( 48 77 id(new PhabricatorTextEditField()) 49 78 ->setKey('name') ··· 95 124 ->setLabel(pht('Paths')) 96 125 ->setDescription(pht('Set paths for this package.')) 97 126 ->setIsConduitOnly(true) 98 - ->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_PATHS), 127 + ->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_PATHS) 128 + ->setConduitDocumentation($paths_help), 99 129 ); 100 130 } 101 131
+6
src/applications/transactions/editengine/PhabricatorEditEngineAPIMethod.php
··· 173 173 $type->getTransactionType()); 174 174 $section[] = null; 175 175 176 + $type_documentation = $type->getConduitDocumentation(); 177 + if ($type_documentation) { 178 + $section[] = $type_documentation; 179 + $section[] = null; 180 + } 181 + 176 182 $type_description = pht( 177 183 'Use `%s` to select this edit type.', 178 184 $type->getEditType());
+12 -1
src/applications/transactions/editfield/PhabricatorEditField.php
··· 15 15 private $description; 16 16 private $editTypeKey; 17 17 private $isRequired; 18 + private $conduitDocumentation; 18 19 19 20 private $commentActionLabel; 20 21 private $commentActionValue; ··· 553 554 ->setEditType($type_key) 554 555 ->setTransactionType($transaction_type) 555 556 ->setDescription($this->getDescription()) 556 - ->setMetadata($this->getMetadata()); 557 + ->setMetadata($this->getMetadata()) 558 + ->setConduitDocumentation($this->getConduitDocumentation()); 557 559 } 558 560 559 561 public function getConduitEditTypes() { ··· 675 677 } 676 678 677 679 return $edit_type->generateTransactions($template, $spec); 680 + } 681 + 682 + public function setConduitDocumentation($conduit_documentation) { 683 + $this->conduitDocumentation = $conduit_documentation; 684 + return $this; 685 + } 686 + 687 + public function getConduitDocumentation() { 688 + return $this->conduitDocumentation; 678 689 } 679 690 680 691 }
+10
src/applications/transactions/edittype/PhabricatorEditType.php
··· 9 9 private $description; 10 10 private $summary; 11 11 private $metadata = array(); 12 + private $conduitDocumentation; 12 13 13 14 public function setDescription($description) { 14 15 $this->description = $description; ··· 56 57 57 58 public function getEditType() { 58 59 return $this->editType; 60 + } 61 + 62 + public function setConduitDocumentation($conduit_documentation) { 63 + $this->conduitDocumentation = $conduit_documentation; 64 + return $this; 65 + } 66 + 67 + public function getConduitDocumentation() { 68 + return $this->conduitDocumentation; 59 69 } 60 70 61 71 public function setMetadata($metadata) {