Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14720514
D17157.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D17157.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
@@ -3427,6 +3427,7 @@
'PhabricatorProjectColumnPosition' => 'applications/project/storage/PhabricatorProjectColumnPosition.php',
'PhabricatorProjectColumnPositionQuery' => 'applications/project/query/PhabricatorProjectColumnPositionQuery.php',
'PhabricatorProjectColumnQuery' => 'applications/project/query/PhabricatorProjectColumnQuery.php',
+ 'PhabricatorProjectColumnSearchEngine' => 'applications/project/query/PhabricatorProjectColumnSearchEngine.php',
'PhabricatorProjectColumnTransaction' => 'applications/project/storage/PhabricatorProjectColumnTransaction.php',
'PhabricatorProjectColumnTransactionEditor' => 'applications/project/editor/PhabricatorProjectColumnTransactionEditor.php',
'PhabricatorProjectColumnTransactionQuery' => 'applications/project/query/PhabricatorProjectColumnTransactionQuery.php',
@@ -4454,6 +4455,7 @@
'ProjectAddProjectsEmailCommand' => 'applications/project/command/ProjectAddProjectsEmailCommand.php',
'ProjectBoardTaskCard' => 'applications/project/view/ProjectBoardTaskCard.php',
'ProjectCanLockProjectsCapability' => 'applications/project/capability/ProjectCanLockProjectsCapability.php',
+ 'ProjectColumnSearchConduitAPIMethod' => 'applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php',
'ProjectConduitAPIMethod' => 'applications/project/conduit/ProjectConduitAPIMethod.php',
'ProjectCreateConduitAPIMethod' => 'applications/project/conduit/ProjectCreateConduitAPIMethod.php',
'ProjectCreateProjectsCapability' => 'applications/project/capability/ProjectCreateProjectsCapability.php',
@@ -8565,6 +8567,7 @@
'PhabricatorPolicyInterface',
'PhabricatorDestructibleInterface',
'PhabricatorExtendedPolicyInterface',
+ 'PhabricatorConduitResultInterface',
),
'PhabricatorProjectColumnDetailController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectColumnEditController' => 'PhabricatorProjectBoardController',
@@ -8576,6 +8579,7 @@
),
'PhabricatorProjectColumnPositionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorProjectColumnQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
+ 'PhabricatorProjectColumnSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorProjectColumnTransaction' => 'PhabricatorApplicationTransaction',
'PhabricatorProjectColumnTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorProjectColumnTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
@@ -9849,6 +9853,7 @@
'ProjectAddProjectsEmailCommand' => 'MetaMTAEmailTransactionCommand',
'ProjectBoardTaskCard' => 'Phobject',
'ProjectCanLockProjectsCapability' => 'PhabricatorPolicyCapability',
+ 'ProjectColumnSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
'ProjectConduitAPIMethod' => 'ConduitAPIMethod',
'ProjectCreateConduitAPIMethod' => 'ProjectConduitAPIMethod',
'ProjectCreateProjectsCapability' => 'PhabricatorPolicyCapability',
diff --git a/src/applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php b/src/applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/conduit/ProjectColumnSearchConduitAPIMethod.php
@@ -0,0 +1,18 @@
+<?php
+
+final class ProjectColumnSearchConduitAPIMethod
+ extends PhabricatorSearchEngineAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'project.column.search';
+ }
+
+ public function newSearchEngine() {
+ return new PhabricatorProjectColumnSearchEngine();
+ }
+
+ public function getMethodSummary() {
+ return pht('Read information about workboard columns.');
+ }
+
+}
diff --git a/src/applications/project/query/PhabricatorProjectColumnSearchEngine.php b/src/applications/project/query/PhabricatorProjectColumnSearchEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/query/PhabricatorProjectColumnSearchEngine.php
@@ -0,0 +1,74 @@
+<?php
+
+final class PhabricatorProjectColumnSearchEngine
+ extends PhabricatorApplicationSearchEngine {
+
+ public function getResultTypeDescription() {
+ return pht('Workboard Columns');
+ }
+
+ public function getApplicationClassName() {
+ return 'PhabricatorProjectApplication';
+ }
+
+ public function newQuery() {
+ return new PhabricatorProjectColumnQuery();
+ }
+
+ protected function buildCustomSearchFields() {
+ return array(
+ id(new PhabricatorPHIDsSearchField())
+ ->setLabel(pht('Projects'))
+ ->setKey('projectPHIDs')
+ ->setAliases(array('project', 'projects', 'projectPHID')),
+ );
+ }
+
+
+ protected function buildQueryFromParameters(array $map) {
+ $query = $this->newQuery();
+
+ if ($map['projectPHIDs']) {
+ $query->withProjectPHIDs($map['projectPHIDs']);
+ }
+
+ return $query;
+ }
+
+ protected function getURI($path) {
+ // NOTE: There's no way to query columns in the web UI, at least for
+ // the moment.
+ return null;
+ }
+
+ protected function getBuiltinQueryNames() {
+ $names = array();
+
+ $names['all'] = pht('All');
+
+ return $names;
+ }
+
+ public function buildSavedQueryFromBuiltin($query_key) {
+ $query = $this->newSavedQuery();
+ $query->setQueryKey($query_key);
+
+ switch ($query_key) {
+ case 'all':
+ return $query;
+ }
+
+ return parent::buildSavedQueryFromBuiltin($query_key);
+ }
+
+ protected function renderResultList(
+ array $projects,
+ PhabricatorSavedQuery $query,
+ array $handles) {
+ assert_instances_of($projects, 'PhabricatorProjectColumn');
+ $viewer = $this->requireViewer();
+
+ return null;
+ }
+
+}
diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php
--- a/src/applications/project/storage/PhabricatorProjectColumn.php
+++ b/src/applications/project/storage/PhabricatorProjectColumn.php
@@ -6,7 +6,8 @@
PhabricatorApplicationTransactionInterface,
PhabricatorPolicyInterface,
PhabricatorDestructibleInterface,
- PhabricatorExtendedPolicyInterface {
+ PhabricatorExtendedPolicyInterface,
+ PhabricatorConduitResultInterface {
const STATUS_ACTIVE = 0;
const STATUS_HIDDEN = 1;
@@ -183,6 +184,40 @@
return sprintf('%s%012d', $group, $sequence);
}
+/* -( PhabricatorConduitResultInterface )---------------------------------- */
+
+ public function getFieldSpecificationsForConduit() {
+ return array(
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('name')
+ ->setType('string')
+ ->setDescription(pht('The display name of the column.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('project')
+ ->setType('map<string, wild>')
+ ->setDescription(pht('The project the column belongs to.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('proxyPHID')
+ ->setType('phid?')
+ ->setDescription(
+ pht(
+ 'For columns that proxy another object (like a subproject or '.
+ 'milestone), the PHID of the object they proxy.')),
+ );
+ }
+
+ public function getFieldValuesForConduit() {
+ return array(
+ 'name' => $this->getDisplayName(),
+ 'proxyPHID' => $this->getProxyPHID(),
+ 'project' => $this->getProject()->getRefForConduit(),
+ );
+ }
+
+ public function getConduitSearchAttachments() {
+ return array();
+ }
+
public function getRefForConduit() {
return array(
'id' => (int)$this->getID(),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 10:00 PM (14 h, 9 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7011597
Default Alt Text
D17157.diff (7 KB)
Attached To
Mode
D17157: Add "project.column.search" for querying workboard column information
Attached
Detach File
Event Timeline
Log In to Comment