1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00

Revert "Allow search results to be snippeted, roughly"

Summary:
This reverts commit 1583738842.

See T8646 for discussion. This version of the feature feels terrible on real data.

Test Plan: Strict revert.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14097
This commit is contained in:
epriestley 2015-09-10 20:57:26 -07:00
parent 6679a85ee1
commit 1c45a7d8e2
9 changed files with 5 additions and 90 deletions

View file

@ -99,7 +99,7 @@ return array(
'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5',
'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd',
'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae',
'rsrc/css/application/search/search-results.css' => '586db3a4',
'rsrc/css/application/search/search-results.css' => '7dea472c',
'rsrc/css/application/slowvote/slowvote.css' => '475b4bd2',
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
'rsrc/css/application/uiexample/example.css' => '528b19de',
@ -734,7 +734,7 @@ return array(
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '6920d200',
'phabricator-remarkup-css' => '1c4ac273',
'phabricator-search-results-css' => '586db3a4',
'phabricator-search-results-css' => '7dea472c',
'phabricator-shaped-request' => '7cbe244b',
'phabricator-side-menu-view-css' => 'bec2458e',
'phabricator-slowvote-css' => '475b4bd2',

View file

@ -2840,7 +2840,6 @@ phutil_register_library_map(array(
'PhabricatorSearchResultView' => 'applications/search/view/PhabricatorSearchResultView.php',
'PhabricatorSearchSelectController' => 'applications/search/controller/PhabricatorSearchSelectController.php',
'PhabricatorSearchSelectField' => 'applications/search/field/PhabricatorSearchSelectField.php',
'PhabricatorSearchSnippetInterface' => 'applications/search/interface/PhabricatorSearchSnippetInterface.php',
'PhabricatorSearchStringListField' => 'applications/search/field/PhabricatorSearchStringListField.php',
'PhabricatorSearchSubscribersField' => 'applications/search/field/PhabricatorSearchSubscribersField.php',
'PhabricatorSearchTextField' => 'applications/search/field/PhabricatorSearchTextField.php',
@ -4133,7 +4132,6 @@ phutil_register_library_map(array(
'PhabricatorMentionableInterface',
'PhabricatorDestructibleInterface',
'PhabricatorProjectInterface',
'PhabricatorSearchSnippetInterface',
),
'DifferentialRevisionAffectedFilesHeraldField' => 'DifferentialRevisionHeraldField',
'DifferentialRevisionAuthorHeraldField' => 'DifferentialRevisionHeraldField',
@ -5027,7 +5025,6 @@ phutil_register_library_map(array(
'PhabricatorApplicationTransactionInterface',
'PhabricatorProjectInterface',
'PhabricatorSpacesInterface',
'PhabricatorSearchSnippetInterface',
),
'ManiphestTaskAssignHeraldAction' => 'HeraldAction',
'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction',
@ -7626,7 +7623,6 @@ phutil_register_library_map(array(
'PhabricatorTokenReceiverInterface',
'PhabricatorDestructibleInterface',
'PhabricatorApplicationTransactionInterface',
'PhabricatorSearchSnippetInterface',
),
'PhrictionDocumentAuthorHeraldField' => 'PhrictionDocumentHeraldField',
'PhrictionDocumentContentHeraldField' => 'PhrictionDocumentHeraldField',

View file

@ -13,8 +13,7 @@ final class DifferentialRevision extends DifferentialDAO
PhabricatorApplicationTransactionInterface,
PhabricatorMentionableInterface,
PhabricatorDestructibleInterface,
PhabricatorProjectInterface,
PhabricatorSearchSnippetInterface {
PhabricatorProjectInterface {
protected $title = '';
protected $originalTitle;
@ -630,18 +629,4 @@ final class DifferentialRevision extends DifferentialDAO
$this->saveTransaction();
}
/* -( PhabricatorSearchSnippetInterface )---------------------------------- */
public function renderSearchResultSnippet(PhabricatorUser $viewer) {
$content = $this->getSummary();
$content = PhabricatorMarkupEngine::summarize($content);
$content = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())->setContent($content),
'default',
$viewer);
return $content;
}
}

View file

@ -13,8 +13,7 @@ final class ManiphestTask extends ManiphestDAO
PhabricatorDestructibleInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorProjectInterface,
PhabricatorSpacesInterface,
PhabricatorSearchSnippetInterface {
PhabricatorSpacesInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
@ -391,18 +390,4 @@ final class ManiphestTask extends ManiphestDAO
return $this->spacePHID;
}
/* -( PhabricatorSearchSnippetInterface )---------------------------------- */
public function renderSearchResultSnippet(PhabricatorUser $viewer) {
$content = $this->getDescription();
$content = PhabricatorMarkupEngine::summarize($content);
$content = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())->setContent($content),
'default',
$viewer);
return $content;
}
}

View file

@ -7,8 +7,7 @@ final class PhrictionDocument extends PhrictionDAO
PhabricatorFlaggableInterface,
PhabricatorTokenReceiverInterface,
PhabricatorDestructibleInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorSearchSnippetInterface {
PhabricatorApplicationTransactionInterface {
protected $slug;
protected $depth;
@ -253,19 +252,4 @@ final class PhrictionDocument extends PhrictionDAO
$this->saveTransaction();
}
/* -( PhabricatorSearchSnippetInterface )---------------------------------- */
public function renderSearchResultSnippet(PhabricatorUser $viewer) {
$content = $this->getContent()->getContent();
$content = PhabricatorMarkupEngine::summarize($content);
$content = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())->setContent($content),
'default',
$viewer);
return $content;
}
}

View file

@ -1,11 +0,0 @@
<?php
/**
* Objects can implement this interface to provide text snippets in search
* result views.
*/
interface PhabricatorSearchSnippetInterface {
public function renderSearchResultSnippet(PhabricatorUser $viewer);
}

View file

@ -251,7 +251,6 @@ final class PhabricatorSearchApplicationSearchEngine
foreach ($results as $phid => $handle) {
$view = id(new PhabricatorSearchResultView())
->setUser($viewer)
->setHandle($handle)
->setQuery($query)
->setObject(idx($objects, $phid))

View file

@ -21,13 +21,7 @@ final class PhabricatorSearchResultView extends AphrontView {
return $this;
}
public function getObject() {
return $this->object;
}
public function render() {
$viewer = $this->getUser();
$handle = $this->handle;
if (!$handle->isComplete()) {
return;
@ -52,18 +46,6 @@ final class PhabricatorSearchResultView extends AphrontView {
$item->addAttribute(pht('Closed'));
}
$object = $this->getObject();
if ($object instanceof PhabricatorSearchSnippetInterface) {
$snippet = $object->renderSearchResultSnippet($viewer);
$snippet = phutil_tag(
'div',
array(
'class' => 'phui-search-snippet',
),
$snippet);
$item->appendChild($snippet);
}
return $item;
}

View file

@ -16,8 +16,3 @@
font-weight: normal;
color: #000;
}
.phui-search-snippet {
margin: 0 8px;
color: {$greytext};
}