Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14026200
D14782.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D14782.diff
View Options
diff --git a/src/applications/conduit/query/PhabricatorConduitLogQuery.php b/src/applications/conduit/query/PhabricatorConduitLogQuery.php
--- a/src/applications/conduit/query/PhabricatorConduitLogQuery.php
+++ b/src/applications/conduit/query/PhabricatorConduitLogQuery.php
@@ -3,9 +3,15 @@
final class PhabricatorConduitLogQuery
extends PhabricatorCursorPagedPolicyAwareQuery {
+ private $callerPHIDs;
private $methods;
private $methodStatuses;
+ public function withCallerPHIDs(array $phids) {
+ $this->callerPHIDs = $phids;
+ return $this;
+ }
+
public function withMethods(array $methods) {
$this->methods = $methods;
return $this;
@@ -27,6 +33,13 @@
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
$where = parent::buildWhereClauseParts($conn);
+ if ($this->callerPHIDs !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'callerPHID IN (%Ls)',
+ $this->callerPHIDs);
+ }
+
if ($this->methods !== null) {
$where[] = qsprintf(
$conn,
diff --git a/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php b/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php
--- a/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php
+++ b/src/applications/conduit/query/PhabricatorConduitLogSearchEngine.php
@@ -18,6 +18,10 @@
protected function buildQueryFromParameters(array $map) {
$query = $this->newQuery();
+ if ($map['callerPHIDs']) {
+ $query->withCallerPHIDs($map['callerPHIDs']);
+ }
+
if ($map['methods']) {
$query->withMethods($map['methods']);
}
@@ -31,6 +35,11 @@
protected function buildCustomSearchFields() {
return array(
+ id(new PhabricatorUsersSearchField())
+ ->setKey('callerPHIDs')
+ ->setLabel(pht('Methods'))
+ ->setAliases(array('caller', 'callers'))
+ ->setDescription(pht('Find calls by specific users.')),
id(new PhabricatorSearchStringListField())
->setKey('methods')
->setLabel(pht('Methods'))
@@ -39,6 +48,8 @@
->setKey('statuses')
->setLabel(pht('Method Status'))
->setAliases(array('status'))
+ ->setDescription(
+ pht('Find calls to stable, unstable, or deprecated methods.'))
->setOptions(ConduitAPIMethod::getMethodStatusMap()),
);
}
@@ -48,10 +59,16 @@
}
protected function getBuiltinQueryNames() {
- $names = array(
- 'all' => pht('All Logs'),
- 'deprecated' => pht('Deprecated Calls'),
- );
+ $names = array();
+
+ $viewer = $this->requireViewer();
+ if ($viewer->isLoggedIn()) {
+ $names['viewer'] = pht('My Calls');
+ $names['viewerdeprecated'] = pht('My Deprecated Calls');
+ }
+
+ $names['all'] = pht('All Call Logs');
+ $names['deprecated'] = pht('Deprecated Call Logs');
return $names;
}
@@ -60,13 +77,24 @@
$query = $this->newSavedQuery();
$query->setQueryKey($query_key);
+ $viewer = $this->requireViewer();
+ $viewer_phid = $viewer->getPHID();
+
+ $deprecated = array(
+ ConduitAPIMethod::METHOD_STATUS_DEPRECATED,
+ );
+
switch ($query_key) {
+ case 'viewer':
+ return $query
+ ->setParameter('callerPHIDs', array($viewer_phid));
+ case 'viewerdeprecated':
+ return $query
+ ->setParameter('callerPHIDs', array($viewer_phid))
+ ->setParameter('statuses', $deprecated);
case 'deprecated':
- return $query->setParameter(
- 'statuses',
- array(
- ConduitAPIMethod::METHOD_STATUS_DEPRECATED,
- ));
+ return $query
+ ->setParameter('statuses', $deprecated);
case 'all':
return $query;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 12:01 AM (4 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6720673
Default Alt Text
D14782.diff (3 KB)
Attached To
Mode
D14782: Add by-caller lookup to call logs, plus viewer calls
Attached
Detach File
Event Timeline
Log In to Comment