Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php b/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php
index 09056fe761..8e16051840 100644
--- a/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php
+++ b/src/applications/phriction/typeahead/PhrictionDocumentDatasource.php
@@ -1,66 +1,79 @@
<?php
final class PhrictionDocumentDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Documents');
}
public function getPlaceholderText() {
return pht('Type a document name...');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorPhrictionApplication';
}
public function loadResults() {
$viewer = $this->getViewer();
+ $app_type = pht('Wiki Document');
+ $mid_dot = "\xC2\xB7";
+
$query = id(new PhrictionDocumentQuery())
->setViewer($viewer)
->needContent(true);
$this->applyFerretConstraints(
$query,
id(new PhrictionDocument())->newFerretEngine(),
'title',
$this->getRawQuery());
$documents = $query->execute();
$results = array();
foreach ($documents as $document) {
$content = $document->getContent();
- if (!$document->isActive()) {
- $closed = $document->getStatusDisplayName();
- } else {
+ if ($document->isActive()) {
$closed = null;
+ } else {
+ $closed = $document->getStatusDisplayName();
}
$slug = $document->getSlug();
$title = $content->getTitle();
+ // For some time the search result was
+ // just mentioning the document slug.
+ // Now, it also mentions the application type.
+ // Example: "Wiki Document - /foo/bar"
+ $display_type = sprintf(
+ '%s %s %s',
+ $app_type,
+ $mid_dot,
+ $slug);
+
$sprite = 'phabricator-search-icon phui-font-fa phui-icon-view fa-book';
$autocomplete = '[[ '.$slug.' ]]';
$result = id(new PhabricatorTypeaheadResult())
->setName($title)
->setDisplayName($title)
->setURI($document->getURI())
->setPHID($document->getPHID())
- ->setDisplayType($slug)
+ ->setDisplayType($display_type)
->setPriorityType('wiki')
->setImageSprite($sprite)
->setAutocomplete($autocomplete)
->setClosed($closed);
$results[] = $result;
}
return $results;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Sep 7, 10:38 AM (22 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
220902
Default Alt Text
(2 KB)

Event Timeline