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

Allow pastes to be activated/archived via Conduit

Summary: Ref T9964. Add a `setIsConduitOnly()` method so we can mark a field as API-only.

Test Plan:
- Created and edited pastes via web UI (no status field).
- Adjusted status via web UI action.
- Adjusted status via Conduit API.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9964

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

+39 -1
+8
src/applications/paste/editor/PhabricatorPasteEditEngine.php
··· 83 83 ->setMonospaced(true) 84 84 ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) 85 85 ->setValue($object->getRawContent()), 86 + id(new PhabricatorSelectEditField()) 87 + ->setKey('status') 88 + ->setLabel(pht('Status')) 89 + ->setDescription(pht('Active or archive the paste.')) 90 + ->setTransactionType(PhabricatorPasteTransaction::TYPE_STATUS) 91 + ->setIsConduitOnly(true) 92 + ->setValue($object->getStatus()) 93 + ->setOptions(PhabricatorPaste::getStatusNameMap()), 86 94 ); 87 95 } 88 96
+31 -1
src/applications/transactions/editfield/PhabricatorEditField.php
··· 29 29 private $isDefaultable = true; 30 30 private $isLockable = true; 31 31 private $isCopyable = false; 32 + private $isConduitOnly = false; 32 33 33 34 public function setKey($key) { 34 35 $this->key = $key; ··· 111 112 return $this->isReorderable; 112 113 } 113 114 115 + public function setIsConduitOnly($is_conduit_only) { 116 + $this->isConduitOnly = $is_conduit_only; 117 + return $this; 118 + } 119 + 120 + public function getIsConduitOnly() { 121 + return $this->isConduitOnly; 122 + } 123 + 114 124 public function setIsEditDefaults($is_edit_defaults) { 115 125 $this->isEditDefaults = $is_edit_defaults; 116 126 return $this; ··· 197 207 } 198 208 199 209 protected function buildControl() { 210 + if ($this->getIsConduitOnly()) { 211 + return null; 212 + } 213 + 200 214 $control = $this->newControl(); 201 215 if ($control === null) { 202 216 return null; ··· 466 480 } 467 481 468 482 final public function getHTTPParameterType() { 483 + if ($this->getIsConduitOnly()) { 484 + return null; 485 + } 486 + 469 487 $type = $this->newHTTPParameterType(); 470 488 471 489 if ($type) { ··· 492 510 } 493 511 494 512 protected function newEditType() { 513 + // TODO: This could be a little cleaner. 514 + $http_type = $this->getHTTPParameterType(); 515 + if ($http_type) { 516 + $value_type = $http_type->getTypeName(); 517 + } else { 518 + $value_type = 'wild'; 519 + } 520 + 495 521 return id(new PhabricatorSimpleEditType()) 496 - ->setValueType($this->getHTTPParameterType()->getTypeName()); 522 + ->setValueType($value_type); 497 523 } 498 524 499 525 protected function getEditType() { ··· 523 549 } 524 550 525 551 public function getWebEditTypes() { 552 + if ($this->getIsConduitOnly()) { 553 + return array(); 554 + } 555 + 526 556 $edit_type = $this->getEditType(); 527 557 528 558 if ($edit_type === null) {