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

Support "parentPHIDs" and "ancestorPHIDs" as constraints in project.search API

Summary:
Ref T12074. Allows querying for project by direct parent (find only immediate children) or any ancestor (find all descendants) using the API.

There's no proper web UI for this since I'm not sure how useful it is, but you can `/project/?parent=PHID-PROJ-...` or `/project/?ancestor=...` for now. We can add UI later if/when use cases arise, but it's not immediately clear to me that this is useful to do from the web.

Test Plan:
- From API, queried with `parentPHIDs` and `ancestorPHIDs`, finding direct children only and all descendants, respectively.
- From web UI, fiddled with `?parent=...` and `?ancestor=...` to make sure they work too. This isn't intended to be a user-facing feature.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12074

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

+19
+19
src/applications/project/query/PhabricatorProjectSearchEngine.php
··· 52 52 ->setLabel(pht('Colors')) 53 53 ->setKey('colors') 54 54 ->setOptions($this->getColorOptions()), 55 + id(new PhabricatorPHIDsSearchField()) 56 + ->setLabel(pht('Parent Projects')) 57 + ->setKey('parentPHIDs') 58 + ->setAliases(array('parent', 'parents', 'parentPHID')) 59 + ->setDescription(pht('Find direct subprojects of specified parents.')), 60 + id(new PhabricatorPHIDsSearchField()) 61 + ->setLabel(pht('Ancestor Projects')) 62 + ->setKey('ancestorPHIDs') 63 + ->setAliases(array('ancestor', 'ancestors', 'ancestorPHID')) 64 + ->setDescription( 65 + pht('Find all subprojects beneath specified ancestors.')), 55 66 ); 56 67 } 57 68 ··· 89 100 90 101 if ($map['isMilestone'] !== null) { 91 102 $query->withIsMilestone($map['isMilestone']); 103 + } 104 + 105 + if ($map['parentPHIDs']) { 106 + $query->withParentProjectPHIDs($map['parentPHIDs']); 107 + } 108 + 109 + if ($map['ancestorPHIDs']) { 110 + $query->withAncestorProjectPHIDs($map['ancestorPHIDs']); 92 111 } 93 112 94 113 return $query;