mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-25 21:19:21 +01:00
Summary: Ref T10144. This isn't comprehensive, but we can give it a try and see how it feels? - EditEngine forms now say "Tags" instead of "Projects". - Modern SearchEngine forms now say "Tags" instead of "Projects". - For clarity, replaced as much "in project" language as I could find with "tagged with project" language. Test Plan: reading / grepping + used "not tagged with any project" token Reviewers: chad Reviewed By: chad Maniphest Tasks: T10144 Differential Revision: https://secure.phabricator.com/D15108
60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
|
|
final class PhabricatorProjectsSearchEngineExtension
|
|
extends PhabricatorSearchEngineExtension {
|
|
|
|
const EXTENSIONKEY = 'projects';
|
|
|
|
public function isExtensionEnabled() {
|
|
return PhabricatorApplication::isClassInstalled(
|
|
'PhabricatorProjectApplication');
|
|
}
|
|
|
|
public function getExtensionName() {
|
|
return pht('Support for Projects');
|
|
}
|
|
|
|
public function getExtensionOrder() {
|
|
return 3000;
|
|
}
|
|
|
|
public function supportsObject($object) {
|
|
return ($object instanceof PhabricatorProjectInterface);
|
|
}
|
|
|
|
public function applyConstraintsToQuery(
|
|
$object,
|
|
$query,
|
|
PhabricatorSavedQuery $saved,
|
|
array $map) {
|
|
|
|
if (!empty($map['projectPHIDs'])) {
|
|
$query->withEdgeLogicConstraints(
|
|
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
|
|
$map['projectPHIDs']);
|
|
}
|
|
}
|
|
|
|
public function getSearchFields($object) {
|
|
$fields = array();
|
|
|
|
$fields[] = id(new PhabricatorProjectSearchField())
|
|
->setKey('projectPHIDs')
|
|
->setConduitKey('projects')
|
|
->setAliases(array('project', 'projects', 'tag', 'tags'))
|
|
->setLabel(pht('Tags'))
|
|
->setDescription(
|
|
pht('Search for objects tagged with given projects.'));
|
|
|
|
return $fields;
|
|
}
|
|
|
|
public function getSearchAttachments($object) {
|
|
return array(
|
|
id(new PhabricatorProjectsSearchEngineAttachment())
|
|
->setAttachmentKey('projects'),
|
|
);
|
|
}
|
|
|
|
|
|
}
|