1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +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-preview-branch.css' => 'b7a6f4a5',
'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd',
'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae', '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/slowvote/slowvote.css' => '475b4bd2',
'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
'rsrc/css/application/uiexample/example.css' => '528b19de', 'rsrc/css/application/uiexample/example.css' => '528b19de',
@ -734,7 +734,7 @@ return array(
'phabricator-phtize' => 'd254d646', 'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '6920d200', 'phabricator-prefab' => '6920d200',
'phabricator-remarkup-css' => '1c4ac273', 'phabricator-remarkup-css' => '1c4ac273',
'phabricator-search-results-css' => '586db3a4', 'phabricator-search-results-css' => '7dea472c',
'phabricator-shaped-request' => '7cbe244b', 'phabricator-shaped-request' => '7cbe244b',
'phabricator-side-menu-view-css' => 'bec2458e', 'phabricator-side-menu-view-css' => 'bec2458e',
'phabricator-slowvote-css' => '475b4bd2', 'phabricator-slowvote-css' => '475b4bd2',

View file

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

View file

@ -13,8 +13,7 @@ final class DifferentialRevision extends DifferentialDAO
PhabricatorApplicationTransactionInterface, PhabricatorApplicationTransactionInterface,
PhabricatorMentionableInterface, PhabricatorMentionableInterface,
PhabricatorDestructibleInterface, PhabricatorDestructibleInterface,
PhabricatorProjectInterface, PhabricatorProjectInterface {
PhabricatorSearchSnippetInterface {
protected $title = ''; protected $title = '';
protected $originalTitle; protected $originalTitle;
@ -630,18 +629,4 @@ final class DifferentialRevision extends DifferentialDAO
$this->saveTransaction(); $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, PhabricatorDestructibleInterface,
PhabricatorApplicationTransactionInterface, PhabricatorApplicationTransactionInterface,
PhabricatorProjectInterface, PhabricatorProjectInterface,
PhabricatorSpacesInterface, PhabricatorSpacesInterface {
PhabricatorSearchSnippetInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
@ -391,18 +390,4 @@ final class ManiphestTask extends ManiphestDAO
return $this->spacePHID; 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, PhabricatorFlaggableInterface,
PhabricatorTokenReceiverInterface, PhabricatorTokenReceiverInterface,
PhabricatorDestructibleInterface, PhabricatorDestructibleInterface,
PhabricatorApplicationTransactionInterface, PhabricatorApplicationTransactionInterface {
PhabricatorSearchSnippetInterface {
protected $slug; protected $slug;
protected $depth; protected $depth;
@ -253,19 +252,4 @@ final class PhrictionDocument extends PhrictionDAO
$this->saveTransaction(); $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) { foreach ($results as $phid => $handle) {
$view = id(new PhabricatorSearchResultView()) $view = id(new PhabricatorSearchResultView())
->setUser($viewer)
->setHandle($handle) ->setHandle($handle)
->setQuery($query) ->setQuery($query)
->setObject(idx($objects, $phid)) ->setObject(idx($objects, $phid))

View file

@ -21,13 +21,7 @@ final class PhabricatorSearchResultView extends AphrontView {
return $this; return $this;
} }
public function getObject() {
return $this->object;
}
public function render() { public function render() {
$viewer = $this->getUser();
$handle = $this->handle; $handle = $this->handle;
if (!$handle->isComplete()) { if (!$handle->isComplete()) {
return; return;
@ -52,18 +46,6 @@ final class PhabricatorSearchResultView extends AphrontView {
$item->addAttribute(pht('Closed')); $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; return $item;
} }

View file

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