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

Replace Differential hard-coded status "<select />" with tokenizer

Summary:
Ref T2543. This updates the UI control in the web UI. Also:

- This implicitly makes this queryable with the API (`differential.revision.search`); it previously was not.
- This does NOT migrate existing saved queries. I'll do those in the next change, and hold this until it happens.
- This will break some existing `/differential/?status=XYZ` links. For example, `status=open` now needs to be `status=open()`. I couldn't find any of these in the upstream, and I suspect these are rare in the wild (users would normally link directly to saved queries, not use URI query construction).

Test Plan: {F5093611}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T2543

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

+26 -8
+5 -1
src/applications/differential/constants/DifferentialLegacyQuery.php
··· 28 28 $status)); 29 29 } 30 30 31 + return self::getLegacyValues($map[$status]); 32 + } 33 + 34 + public static function getLegacyValues(array $modern_values) { 31 35 $values = array(); 32 - foreach ($map[$status] as $status_constant) { 36 + foreach ($modern_values as $status_constant) { 33 37 $status_object = DifferentialRevisionStatus::newForStatus( 34 38 $status_constant); 35 39
+13
src/applications/differential/query/DifferentialRevisionQuery.php
··· 25 25 private $repositoryPHIDs; 26 26 private $updatedEpochMin; 27 27 private $updatedEpochMax; 28 + private $statuses; 28 29 29 30 const ORDER_MODIFIED = 'order-modified'; 30 31 const ORDER_CREATED = 'order-created'; ··· 143 144 */ 144 145 public function withStatus($status_constant) { 145 146 $this->status = $status_constant; 147 + return $this; 148 + } 149 + 150 + public function withStatuses(array $statuses) { 151 + $this->statuses = $statuses; 146 152 return $this; 147 153 } 148 154 ··· 703 709 $conn_r, 704 710 'r.status IN (%Ls)', 705 711 $statuses); 712 + } 713 + 714 + if ($this->statuses !== null) { 715 + $where[] = qsprintf( 716 + $conn_r, 717 + 'r.status in (%Ls)', 718 + DifferentialLegacyQuery::getLegacyValues($this->statuses)); 706 719 } 707 720 708 721 $where[] = $this->buildWhereClauseParts($conn_r);
+8 -7
src/applications/differential/query/DifferentialRevisionSearchEngine.php
··· 41 41 $query->withRepositoryPHIDs($map['repositoryPHIDs']); 42 42 } 43 43 44 - if ($map['status']) { 45 - $query->withStatus($map['status']); 44 + if ($map['statuses']) { 45 + $query->withStatuses($map['statuses']); 46 46 } 47 47 48 48 return $query; ··· 77 77 ->setDatasource(new DiffusionRepositoryFunctionDatasource()) 78 78 ->setDescription( 79 79 pht('Find revisions from specific repositories.')), 80 - id(new PhabricatorSearchSelectField()) 81 - ->setLabel(pht('Status')) 82 - ->setKey('status') 83 - ->setOptions($this->getStatusOptions()) 80 + id(new PhabricatorSearchDatasourceField()) 81 + ->setLabel(pht('Statuses')) 82 + ->setKey('statuses') 83 + ->setAliases(array('status')) 84 + ->setDatasource(new DifferentialRevisionStatusFunctionDatasource()) 84 85 ->setDescription( 85 86 pht('Find revisions with particular statuses.')), 86 87 ); ··· 115 116 116 117 return $query 117 118 ->setParameter('responsiblePHIDs', array($viewer->getPHID())) 118 - ->setParameter('status', DifferentialLegacyQuery::STATUS_OPEN) 119 + ->setParameter('statuses', array('open()')) 119 120 ->setParameter('bucket', $bucket_key); 120 121 case 'authored': 121 122 return $query