Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17740594
D10953.id26303.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
D10953.id26303.diff
View Options
diff --git a/src/applications/passphrase/query/PassphraseCredentialQuery.php b/src/applications/passphrase/query/PassphraseCredentialQuery.php
--- a/src/applications/passphrase/query/PassphraseCredentialQuery.php
+++ b/src/applications/passphrase/query/PassphraseCredentialQuery.php
@@ -9,6 +9,8 @@
private $providesTypes;
private $isDestroyed;
private $allowConduit;
+ private $nameContains;
+ private $descriptionContains;
private $needSecrets;
@@ -42,6 +44,16 @@
return $this;
}
+ public function withNameContains($name_contains) {
+ $this->nameContains = $name_contains;
+ return $this;
+ }
+
+ public function withDescriptionContains($description_contains) {
+ $this->descriptionContains = $description_contains;
+ return $this;
+ }
+
public function needSecrets($need_secrets) {
$this->needSecrets = $need_secrets;
return $this;
@@ -140,6 +152,20 @@
(int)$this->allowConduit);
}
+ if (strlen($this->nameContains)) {
+ $where[] = qsprintf(
+ $conn_r,
+ 'name LIKE %~',
+ $this->nameContains);
+ }
+
+ if (strlen($this->descriptionContains)) {
+ $where[] = qsprintf(
+ $conn_r,
+ 'description LIKE %~',
+ $this->descriptionContains);
+ }
+
return $this->formatWhereClause($where);
}
diff --git a/src/applications/passphrase/query/PassphraseCredentialSearchEngine.php b/src/applications/passphrase/query/PassphraseCredentialSearchEngine.php
--- a/src/applications/passphrase/query/PassphraseCredentialSearchEngine.php
+++ b/src/applications/passphrase/query/PassphraseCredentialSearchEngine.php
@@ -17,6 +17,8 @@
$saved->setParameter(
'isDestroyed',
$this->readBoolFromRequest($request, 'isDestroyed'));
+ $saved->setParameter('name', $request->getStr('name'));
+ $saved->setParameter('description', $request->getStr('description'));
return $saved;
}
@@ -29,6 +31,16 @@
$query->withIsDestroyed($destroyed);
}
+ $name = $saved->getParameter('name');
+ if (strlen($name)) {
+ $query->withNameContains($name);
+ }
+
+ $description = $saved->getParameter('description');
+ if (strlen($description)) {
+ $query->withDescriptionContains($description);
+ }
+
return $query;
}
@@ -36,7 +48,11 @@
AphrontFormView $form,
PhabricatorSavedQuery $saved_query) {
- $form->appendChild(
+ $name = $saved_query->getParameter('name');
+ $description = $saved_query->getParameter('description');
+
+ $form
+ ->appendChild(
id(new AphrontFormSelectControl())
->setName('isDestroyed')
->setLabel(pht('Status'))
@@ -46,7 +62,17 @@
'' => pht('Show All Credentials'),
'false' => pht('Show Only Active Credentials'),
'true' => pht('Show Only Destroyed Credentials'),
- )));
+ )))
+ ->appendChild(
+ id(new AphrontFormTextControl())
+ ->setName('name')
+ ->setLabel(pht('Name Contains'))
+ ->setValue($name))
+ ->appendChild(
+ id(new AphrontFormTextControl())
+ ->setName('description')
+ ->setLabel(pht('Description Contains'))
+ ->setValue($description));
}
protected function getURI($path) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 22 2025, 6:35 AM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8553646
Default Alt Text
D10953.id26303.diff (3 KB)
Attached To
Mode
D10953: Title/Description quering for Passphrase credential
Attached
Detach File
Event Timeline
Log In to Comment