Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13971743
D17153.id41251.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D17153.id41251.diff
View Options
diff --git a/src/applications/project/query/PhabricatorProjectSearchEngine.php b/src/applications/project/query/PhabricatorProjectSearchEngine.php
--- a/src/applications/project/query/PhabricatorProjectSearchEngine.php
+++ b/src/applications/project/query/PhabricatorProjectSearchEngine.php
@@ -13,8 +13,7 @@
public function newQuery() {
return id(new PhabricatorProjectQuery())
- ->needImages(true)
- ->withIsMilestone(false);
+ ->needImages(true);
}
protected function buildCustomSearchFields() {
@@ -34,6 +33,17 @@
->setLabel(pht('Status'))
->setKey('status')
->setOptions($this->getStatusOptions()),
+ id(new PhabricatorSearchThreeStateField())
+ ->setLabel(pht('Milestones'))
+ ->setKey('isMilestone')
+ ->setOptions(
+ pht('(Show All)'),
+ pht('Show Only Milestones'),
+ pht('Hide Milestones'))
+ ->setDescription(
+ pht(
+ 'Pass true to find only milestones, or false to omit '.
+ 'milestones.')),
id(new PhabricatorSearchCheckboxesField())
->setLabel(pht('Icons'))
->setKey('icons')
@@ -77,6 +87,10 @@
$query->withColors($map['colors']);
}
+ if ($map['isMilestone'] !== null) {
+ $query->withIsMilestone($map['isMilestone']);
+ }
+
return $query;
}
@@ -103,6 +117,9 @@
$viewer_phid = $this->requireViewer()->getPHID();
+ // By default, do not show milestones in the list view.
+ $query->setParameter('isMilestone', false);
+
switch ($query_key) {
case 'all':
return $query;
diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php
--- a/src/applications/project/storage/PhabricatorProject.php
+++ b/src/applications/project/storage/PhabricatorProject.php
@@ -742,6 +742,10 @@
->setType('string')
->setDescription(pht('Primary slug/hashtag.')),
id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('milestone')
+ ->setType('int?')
+ ->setDescription(pht('For milestones, milestone sequence number.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
->setKey('icon')
->setType('map<string, wild>')
->setDescription(pht('Information about the project icon.')),
@@ -756,9 +760,16 @@
$color_key = $this->getColor();
$color_name = PhabricatorProjectIconSet::getColorName($color_key);
+ if ($this->isMilestone()) {
+ $milestone = (int)$this->getMilestoneNumber();
+ } else {
+ $milestone = null;
+ }
+
return array(
'name' => $this->getName(),
'slug' => $this->getPrimarySlug(),
+ 'milestone' => $milestone,
'icon' => array(
'key' => $this->getDisplayIconKey(),
'name' => $this->getDisplayIconName(),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 18 2024, 3:06 PM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6727488
Default Alt Text
D17153.id41251.diff (2 KB)
Attached To
Mode
D17153: Return milestone information in project.search
Attached
Detach File
Event Timeline
Log In to Comment