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

Make bulk edit <select /> fields a little more natrual and set options for subtype transactions

Summary:
Ref T13025. This is some minor technical stuff: make the "select" bulk edit type a little more consistent with other types by passing data down instead of having it reach up the stack. This simplifies the implementation of a custom field "select" in a future change.

Also, provide an option list to the "select" edit field for object subtypes. This is only accessible via Conduit so it currently never actually renders anything in the UI, but with the bulk edit stuff we get some initialization order issues if we don't set anything. This will also make any future changes which expose subtypes more broadly more straightforward.

Test Plan:
- Bulk edited "select" fields, like "Status" and "Priority".
- No more fatal when trying to `getOptions()` internally on the subtype field.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13025

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

+15 -3
+8 -1
src/applications/transactions/bulk/type/BulkSelectParameterType.php
··· 3 3 final class BulkSelectParameterType 4 4 extends BulkParameterType { 5 5 6 + private $options; 7 + 8 + public function setOptions(array $options) { 9 + $this->options = $options; 10 + return $this; 11 + } 12 + 6 13 public function getOptions() { 7 - return $this->getField()->getOptions(); 14 + return $this->options; 8 15 } 9 16 10 17 public function getPHUIXControlType() {
+2 -1
src/applications/transactions/editfield/PhabricatorSelectEditField.php
··· 55 55 } 56 56 57 57 protected function newBulkParameterType() { 58 - return new BulkSelectParameterType(); 58 + return id(new BulkSelectParameterType()) 59 + ->setOptions($this->getOptions()); 59 60 } 60 61 61 62 private function getCanonicalValue($value) {
+5 -1
src/applications/transactions/engineextension/PhabricatorSubtypeEditEngineExtension.php
··· 30 30 31 31 $subtype_type = PhabricatorTransactions::TYPE_SUBTYPE; 32 32 33 + $map = $object->newEditEngineSubtypeMap(); 34 + $options = mpull($map, 'getName'); 35 + 33 36 $subtype_field = id(new PhabricatorSelectEditField()) 34 37 ->setKey(self::EDITKEY) 35 38 ->setLabel(pht('Subtype')) ··· 41 44 ->setTransactionType($subtype_type) 42 45 ->setConduitDescription(pht('Change the object subtype.')) 43 46 ->setConduitTypeDescription(pht('New object subtype key.')) 44 - ->setValue($object->getEditEngineSubtype()); 47 + ->setValue($object->getEditEngineSubtype()) 48 + ->setOptions($options); 45 49 46 50 return array( 47 51 $subtype_field,