Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14057994
D15105.id36467.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D15105.id36467.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2954,10 +2954,12 @@
'PhabricatorProjectsEditEngineExtension' => 'applications/project/engineextension/PhabricatorProjectsEditEngineExtension.php',
'PhabricatorProjectsEditField' => 'applications/transactions/editfield/PhabricatorProjectsEditField.php',
'PhabricatorProjectsFulltextEngineExtension' => 'applications/project/engineextension/PhabricatorProjectsFulltextEngineExtension.php',
+ 'PhabricatorProjectsMembersSearchEngineAttachment' => 'applications/project/engineextension/PhabricatorProjectsMembersSearchEngineAttachment.php',
'PhabricatorProjectsMembershipIndexEngineExtension' => 'applications/project/engineextension/PhabricatorProjectsMembershipIndexEngineExtension.php',
'PhabricatorProjectsPolicyRule' => 'applications/project/policyrule/PhabricatorProjectsPolicyRule.php',
'PhabricatorProjectsSearchEngineAttachment' => 'applications/project/engineextension/PhabricatorProjectsSearchEngineAttachment.php',
'PhabricatorProjectsSearchEngineExtension' => 'applications/project/engineextension/PhabricatorProjectsSearchEngineExtension.php',
+ 'PhabricatorProjectsWatchersSearchEngineAttachment' => 'applications/project/engineextension/PhabricatorProjectsWatchersSearchEngineAttachment.php',
'PhabricatorProtocolAdapter' => 'infrastructure/daemon/bot/adapter/PhabricatorProtocolAdapter.php',
'PhabricatorPygmentSetupCheck' => 'applications/config/check/PhabricatorPygmentSetupCheck.php',
'PhabricatorQuery' => 'infrastructure/query/PhabricatorQuery.php',
@@ -7370,10 +7372,12 @@
'PhabricatorProjectsEditEngineExtension' => 'PhabricatorEditEngineExtension',
'PhabricatorProjectsEditField' => 'PhabricatorTokenizerEditField',
'PhabricatorProjectsFulltextEngineExtension' => 'PhabricatorFulltextEngineExtension',
+ 'PhabricatorProjectsMembersSearchEngineAttachment' => 'PhabricatorSearchEngineAttachment',
'PhabricatorProjectsMembershipIndexEngineExtension' => 'PhabricatorIndexEngineExtension',
'PhabricatorProjectsPolicyRule' => 'PhabricatorPolicyRule',
'PhabricatorProjectsSearchEngineAttachment' => 'PhabricatorSearchEngineAttachment',
'PhabricatorProjectsSearchEngineExtension' => 'PhabricatorSearchEngineExtension',
+ 'PhabricatorProjectsWatchersSearchEngineAttachment' => 'PhabricatorSearchEngineAttachment',
'PhabricatorProtocolAdapter' => 'Phobject',
'PhabricatorPygmentSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorQuery' => 'Phobject',
diff --git a/src/applications/project/engineextension/PhabricatorProjectsMembersSearchEngineAttachment.php b/src/applications/project/engineextension/PhabricatorProjectsMembersSearchEngineAttachment.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/engineextension/PhabricatorProjectsMembersSearchEngineAttachment.php
@@ -0,0 +1,31 @@
+<?php
+
+final class PhabricatorProjectsMembersSearchEngineAttachment
+ extends PhabricatorSearchEngineAttachment {
+
+ public function getAttachmentName() {
+ return pht('Project Members');
+ }
+
+ public function getAttachmentDescription() {
+ return pht('Get the member list for the project.');
+ }
+
+ public function willLoadAttachmentData($query, $spec) {
+ $query->needMembers(true);
+ }
+
+ public function getAttachmentForObject($object, $data, $spec) {
+ $members = array();
+ foreach ($object->getMemberPHIDs() as $member_phid) {
+ $members[] = array(
+ 'phid' => $member_phid,
+ );
+ }
+
+ return array(
+ 'members' => $members,
+ );
+ }
+
+}
diff --git a/src/applications/project/engineextension/PhabricatorProjectsWatchersSearchEngineAttachment.php b/src/applications/project/engineextension/PhabricatorProjectsWatchersSearchEngineAttachment.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/engineextension/PhabricatorProjectsWatchersSearchEngineAttachment.php
@@ -0,0 +1,31 @@
+<?php
+
+final class PhabricatorProjectsWatchersSearchEngineAttachment
+ extends PhabricatorSearchEngineAttachment {
+
+ public function getAttachmentName() {
+ return pht('Project Watchers');
+ }
+
+ public function getAttachmentDescription() {
+ return pht('Get the watcher list for the project.');
+ }
+
+ public function willLoadAttachmentData($query, $spec) {
+ $query->needWatchers(true);
+ }
+
+ public function getAttachmentForObject($object, $data, $spec) {
+ $watchers = array();
+ foreach ($object->getWatcherPHIDs() as $watcher_phid) {
+ $watchers[] = array(
+ 'phid' => $watcher_phid,
+ );
+ }
+
+ return array(
+ 'watchers' => $watchers,
+ );
+ }
+
+}
diff --git a/src/applications/project/icon/PhabricatorProjectIconSet.php b/src/applications/project/icon/PhabricatorProjectIconSet.php
--- a/src/applications/project/icon/PhabricatorProjectIconSet.php
+++ b/src/applications/project/icon/PhabricatorProjectIconSet.php
@@ -336,6 +336,11 @@
return $list;
}
+ public static function getColorName($color_key) {
+ $map = self::getColorMap();
+ return idx($map, $color_key);
+ }
+
public static function getDefaultColorMap() {
return array(
array(
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
@@ -628,10 +628,17 @@
->setKey('icon')
->setType('map<string, wild>')
->setDescription(pht('Information about the project icon.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('color')
+ ->setType('map<string, wild>')
+ ->setDescription(pht('Information about the project color.')),
);
}
public function getFieldValuesForConduit() {
+ $color_key = $this->getColor();
+ $color_name = PhabricatorProjectIconSet::getColorName($color_key);
+
return array(
'name' => $this->getName(),
'slug' => $this->getPrimarySlug(),
@@ -640,11 +647,20 @@
'name' => $this->getDisplayIconName(),
'icon' => $this->getDisplayIconIcon(),
),
+ 'color' => array(
+ 'key' => $color_key,
+ 'name' => $color_name,
+ ),
);
}
public function getConduitSearchAttachments() {
- return array();
+ return array(
+ id(new PhabricatorProjectsMembersSearchEngineAttachment())
+ ->setAttachmentKey('members'),
+ id(new PhabricatorProjectsWatchersSearchEngineAttachment())
+ ->setAttachmentKey('watchers'),
+ );
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 8:31 AM (19 h, 12 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6716481
Default Alt Text
D15105.id36467.diff (6 KB)
Attached To
Mode
D15105: Add more information (colors, members, watchers) to project.search
Attached
Detach File
Event Timeline
Log In to Comment