mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Update search indexes for Dashboards and Panels to Ferret, plus various minor fixes
Summary: Depends on D20410. Ref T13272. Dashboards/Panels currently use older "ngram" indexing, which is a less-powerful precursor to Ferret. Throw away the ngram index and provide a Ferret index instead. Also: - Remove the NUX state, which links to the wrong place now and doesn't seem terribly important. - Add project tags to the search result list. - Make the "No Tags" tag a little less conspicious. Test Plan: - Indexed dashboards and panels. - Searched for dashboards and panels via SearchEngine using Ferret "query" field. - Searched for panels via "Add Existing Panel" datasource typeahead. - Searched for dashboards via "Add Menu Item > Dashboard" on a ProfileMenu via typeahead. - Viewed dashboard NUX state (no special state, but no more bad link to "/create/"). - Viewed dashboard list, saw project tags. - Viewed dashboards with no project tags ("No Tags" is now displayed but less visible). Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13272 Differential Revision: https://secure.phabricator.com/D20411
This commit is contained in:
parent
80b7274e0b
commit
f13709b13b
29 changed files with 232 additions and 124 deletions
|
@ -9,7 +9,7 @@ return array(
|
|||
'names' => array(
|
||||
'conpherence.pkg.css' => '3c8a0668',
|
||||
'conpherence.pkg.js' => '020aebcf',
|
||||
'core.pkg.css' => '4011a01e',
|
||||
'core.pkg.css' => '77c4f199',
|
||||
'core.pkg.js' => '69247edd',
|
||||
'differential.pkg.css' => '8d8360fb',
|
||||
'differential.pkg.js' => '67e02996',
|
||||
|
@ -173,7 +173,7 @@ return array(
|
|||
'rsrc/css/phui/phui-segment-bar-view.css' => '5166b370',
|
||||
'rsrc/css/phui/phui-spacing.css' => 'b05cadc3',
|
||||
'rsrc/css/phui/phui-status.css' => 'e5ff8be0',
|
||||
'rsrc/css/phui/phui-tag-view.css' => '29409667',
|
||||
'rsrc/css/phui/phui-tag-view.css' => '8519160a',
|
||||
'rsrc/css/phui/phui-timeline-view.css' => '1e348e4b',
|
||||
'rsrc/css/phui/phui-two-column-view.css' => '01e6991e',
|
||||
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'e86de308',
|
||||
|
@ -862,7 +862,7 @@ return array(
|
|||
'phui-segment-bar-view-css' => '5166b370',
|
||||
'phui-spacing-css' => 'b05cadc3',
|
||||
'phui-status-list-view-css' => 'e5ff8be0',
|
||||
'phui-tag-view-css' => '29409667',
|
||||
'phui-tag-view-css' => '8519160a',
|
||||
'phui-theme-css' => '35883b37',
|
||||
'phui-timeline-view-css' => '1e348e4b',
|
||||
'phui-two-column-view-css' => '01e6991e',
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_dashboard_ngrams;
|
|
@ -0,0 +1 @@
|
|||
DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_dashboardpanel_ngrams;
|
|
@ -0,0 +1,9 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_fdocument (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
objectPHID VARBINARY(64) NOT NULL,
|
||||
isClosed BOOL NOT NULL,
|
||||
authorPHID VARBINARY(64),
|
||||
ownerPHID VARBINARY(64),
|
||||
epochCreated INT UNSIGNED NOT NULL,
|
||||
epochModified INT UNSIGNED NOT NULL
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,8 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_ffield (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
documentID INT UNSIGNED NOT NULL,
|
||||
fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT},
|
||||
rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
|
||||
termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
|
||||
normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,5 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_fngrams (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
documentID INT UNSIGNED NOT NULL,
|
||||
ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,7 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_fngrams_common (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT},
|
||||
needsCollection BOOL NOT NULL,
|
||||
UNIQUE KEY `key_ngram` (ngram),
|
||||
KEY `key_collect` (needsCollection)
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,9 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_fdocument (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
objectPHID VARBINARY(64) NOT NULL,
|
||||
isClosed BOOL NOT NULL,
|
||||
authorPHID VARBINARY(64),
|
||||
ownerPHID VARBINARY(64),
|
||||
epochCreated INT UNSIGNED NOT NULL,
|
||||
epochModified INT UNSIGNED NOT NULL
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,8 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_ffield (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
documentID INT UNSIGNED NOT NULL,
|
||||
fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT},
|
||||
rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
|
||||
termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
|
||||
normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,5 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_fngrams (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
documentID INT UNSIGNED NOT NULL,
|
||||
ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,7 @@
|
|||
CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_fngrams_common (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT},
|
||||
needsCollection BOOL NOT NULL,
|
||||
UNIQUE KEY `key_ngram` (ngram),
|
||||
KEY `key_collect` (needsCollection)
|
||||
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|
|
@ -2919,7 +2919,9 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDashboardEditController' => 'applications/dashboard/controller/dashboard/PhabricatorDashboardEditController.php',
|
||||
'PhabricatorDashboardEditEngine' => 'applications/dashboard/editor/PhabricatorDashboardEditEngine.php',
|
||||
'PhabricatorDashboardFavoritesInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php',
|
||||
'PhabricatorDashboardFerretEngine' => 'applications/dashboard/engine/PhabricatorDashboardFerretEngine.php',
|
||||
'PhabricatorDashboardFullLayoutMode' => 'applications/dashboard/layoutconfig/PhabricatorDashboardFullLayoutMode.php',
|
||||
'PhabricatorDashboardFulltextEngine' => 'applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php',
|
||||
'PhabricatorDashboardHalfLayoutMode' => 'applications/dashboard/layoutconfig/PhabricatorDashboardHalfLayoutMode.php',
|
||||
'PhabricatorDashboardHomeInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardHomeInstallWorkflow.php',
|
||||
'PhabricatorDashboardIconSet' => 'applications/dashboard/icon/PhabricatorDashboardIconSet.php',
|
||||
|
@ -2930,7 +2932,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDashboardLayoutTransaction' => 'applications/dashboard/xaction/dashboard/PhabricatorDashboardLayoutTransaction.php',
|
||||
'PhabricatorDashboardListController' => 'applications/dashboard/controller/PhabricatorDashboardListController.php',
|
||||
'PhabricatorDashboardNameTransaction' => 'applications/dashboard/xaction/dashboard/PhabricatorDashboardNameTransaction.php',
|
||||
'PhabricatorDashboardNgrams' => 'applications/dashboard/storage/PhabricatorDashboardNgrams.php',
|
||||
'PhabricatorDashboardObjectInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardObjectInstallWorkflow.php',
|
||||
'PhabricatorDashboardOneThirdLayoutMode' => 'applications/dashboard/layoutconfig/PhabricatorDashboardOneThirdLayoutMode.php',
|
||||
'PhabricatorDashboardPanel' => 'applications/dashboard/storage/PhabricatorDashboardPanel.php',
|
||||
|
@ -2941,9 +2942,10 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDashboardPanelEditConduitAPIMethod' => 'applications/dashboard/conduit/PhabricatorDashboardPanelEditConduitAPIMethod.php',
|
||||
'PhabricatorDashboardPanelEditController' => 'applications/dashboard/controller/panel/PhabricatorDashboardPanelEditController.php',
|
||||
'PhabricatorDashboardPanelEditEngine' => 'applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php',
|
||||
'PhabricatorDashboardPanelFerretEngine' => 'applications/dashboard/engine/PhabricatorDashboardPanelFerretEngine.php',
|
||||
'PhabricatorDashboardPanelFulltextEngine' => 'applications/dashboard/engine/PhabricatorDashboardPanelFulltextEngine.php',
|
||||
'PhabricatorDashboardPanelListController' => 'applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php',
|
||||
'PhabricatorDashboardPanelNameTransaction' => 'applications/dashboard/xaction/panel/PhabricatorDashboardPanelNameTransaction.php',
|
||||
'PhabricatorDashboardPanelNgrams' => 'applications/dashboard/storage/PhabricatorDashboardPanelNgrams.php',
|
||||
'PhabricatorDashboardPanelPHIDType' => 'applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php',
|
||||
'PhabricatorDashboardPanelPropertyTransaction' => 'applications/dashboard/xaction/panel/PhabricatorDashboardPanelPropertyTransaction.php',
|
||||
'PhabricatorDashboardPanelQuery' => 'applications/dashboard/query/PhabricatorDashboardPanelQuery.php',
|
||||
|
@ -8900,7 +8902,8 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFlaggableInterface',
|
||||
'PhabricatorDestructibleInterface',
|
||||
'PhabricatorProjectInterface',
|
||||
'PhabricatorNgramsInterface',
|
||||
'PhabricatorFulltextInterface',
|
||||
'PhabricatorFerretInterface',
|
||||
'PhabricatorDashboardPanelContainerInterface',
|
||||
),
|
||||
'PhabricatorDashboardAdjustController' => 'PhabricatorDashboardController',
|
||||
|
@ -8916,7 +8919,9 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDashboardEditController' => 'PhabricatorDashboardController',
|
||||
'PhabricatorDashboardEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhabricatorDashboardFavoritesInstallWorkflow' => 'PhabricatorDashboardApplicationInstallWorkflow',
|
||||
'PhabricatorDashboardFerretEngine' => 'PhabricatorFerretEngine',
|
||||
'PhabricatorDashboardFullLayoutMode' => 'PhabricatorDashboardLayoutMode',
|
||||
'PhabricatorDashboardFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'PhabricatorDashboardHalfLayoutMode' => 'PhabricatorDashboardLayoutMode',
|
||||
'PhabricatorDashboardHomeInstallWorkflow' => 'PhabricatorDashboardApplicationInstallWorkflow',
|
||||
'PhabricatorDashboardIconSet' => 'PhabricatorIconSet',
|
||||
|
@ -8927,7 +8932,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDashboardLayoutTransaction' => 'PhabricatorDashboardTransactionType',
|
||||
'PhabricatorDashboardListController' => 'PhabricatorDashboardController',
|
||||
'PhabricatorDashboardNameTransaction' => 'PhabricatorDashboardTransactionType',
|
||||
'PhabricatorDashboardNgrams' => 'PhabricatorSearchNgrams',
|
||||
'PhabricatorDashboardObjectInstallWorkflow' => 'PhabricatorDashboardInstallWorkflow',
|
||||
'PhabricatorDashboardOneThirdLayoutMode' => 'PhabricatorDashboardLayoutMode',
|
||||
'PhabricatorDashboardPanel' => array(
|
||||
|
@ -8936,7 +8940,8 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorFlaggableInterface',
|
||||
'PhabricatorDestructibleInterface',
|
||||
'PhabricatorNgramsInterface',
|
||||
'PhabricatorFulltextInterface',
|
||||
'PhabricatorFerretInterface',
|
||||
'PhabricatorDashboardPanelContainerInterface',
|
||||
),
|
||||
'PhabricatorDashboardPanelArchiveController' => 'PhabricatorDashboardController',
|
||||
|
@ -8945,9 +8950,10 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDashboardPanelEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'PhabricatorDashboardPanelEditController' => 'PhabricatorDashboardController',
|
||||
'PhabricatorDashboardPanelEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhabricatorDashboardPanelFerretEngine' => 'PhabricatorFerretEngine',
|
||||
'PhabricatorDashboardPanelFulltextEngine' => 'PhabricatorFulltextEngine',
|
||||
'PhabricatorDashboardPanelListController' => 'PhabricatorDashboardController',
|
||||
'PhabricatorDashboardPanelNameTransaction' => 'PhabricatorDashboardPanelTransactionType',
|
||||
'PhabricatorDashboardPanelNgrams' => 'PhabricatorSearchNgrams',
|
||||
'PhabricatorDashboardPanelPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorDashboardPanelPropertyTransaction' => 'PhabricatorDashboardPanelTransactionType',
|
||||
'PhabricatorDashboardPanelQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorDashboardFerretEngine
|
||||
extends PhabricatorFerretEngine {
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'dashboard';
|
||||
}
|
||||
|
||||
public function getScopeName() {
|
||||
return 'dashboard';
|
||||
}
|
||||
|
||||
public function newSearchEngine() {
|
||||
return new PhabricatorDashboardSearchEngine();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorDashboardFulltextEngine
|
||||
extends PhabricatorFulltextEngine {
|
||||
|
||||
protected function buildAbstractDocument(
|
||||
PhabricatorSearchAbstractDocument $document,
|
||||
$object) {
|
||||
|
||||
$dashboard = $object;
|
||||
|
||||
$document->setDocumentTitle($dashboard->getName());
|
||||
|
||||
$document->addRelationship(
|
||||
$dashboard->isArchived()
|
||||
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
|
||||
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
|
||||
$dashboard->getPHID(),
|
||||
PhabricatorDashboardDashboardPHIDType::TYPECONST,
|
||||
PhabricatorTime::getNow());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorDashboardPanelFerretEngine
|
||||
extends PhabricatorFerretEngine {
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'dashboard';
|
||||
}
|
||||
|
||||
public function getScopeName() {
|
||||
return 'panel';
|
||||
}
|
||||
|
||||
public function newSearchEngine() {
|
||||
return new PhabricatorDashboardPanelSearchEngine();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorDashboardPanelFulltextEngine
|
||||
extends PhabricatorFulltextEngine {
|
||||
|
||||
protected function buildAbstractDocument(
|
||||
PhabricatorSearchAbstractDocument $document,
|
||||
$object) {
|
||||
|
||||
$panel = $object;
|
||||
|
||||
$document->setDocumentTitle($panel->getName());
|
||||
|
||||
$document->addRelationship(
|
||||
$panel->getIsArchived()
|
||||
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
|
||||
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
|
||||
$panel->getPHID(),
|
||||
PhabricatorDashboardPanelPHIDType::TYPECONST,
|
||||
PhabricatorTime::getNow());
|
||||
}
|
||||
|
||||
}
|
|
@ -34,12 +34,6 @@ final class PhabricatorDashboardPanelQuery
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function withNameNgrams($ngrams) {
|
||||
return $this->withNgramsConstraint(
|
||||
id(new PhabricatorDashboardPanelNgrams()),
|
||||
$ngrams);
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
return $this->loadStandardPage($this->newResultObject());
|
||||
}
|
||||
|
|
|
@ -42,20 +42,12 @@ final class PhabricatorDashboardPanelSearchEngine
|
|||
$query->withAuthorPHIDs($map['authorPHIDs']);
|
||||
}
|
||||
|
||||
if ($map['name'] !== null) {
|
||||
$query->withNameNgrams($map['name']);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
protected function buildCustomSearchFields() {
|
||||
|
||||
return array(
|
||||
id(new PhabricatorSearchTextField())
|
||||
->setLabel(pht('Name Contains'))
|
||||
->setKey('name')
|
||||
->setDescription(pht('Search for panels by name substring.')),
|
||||
id(new PhabricatorSearchDatasourceField())
|
||||
->setLabel(pht('Authored By'))
|
||||
->setKey('authorPHIDs')
|
||||
|
|
|
@ -34,12 +34,6 @@ final class PhabricatorDashboardQuery
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function withNameNgrams($ngrams) {
|
||||
return $this->withNgramsConstraint(
|
||||
id(new PhabricatorDashboardNgrams()),
|
||||
$ngrams);
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
return $this->loadStandardPage($this->newResultObject());
|
||||
}
|
||||
|
@ -70,28 +64,28 @@ final class PhabricatorDashboardQuery
|
|||
if ($this->ids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'id IN (%Ld)',
|
||||
'dashboard.id IN (%Ld)',
|
||||
$this->ids);
|
||||
}
|
||||
|
||||
if ($this->phids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'phid IN (%Ls)',
|
||||
'dashboard.phid IN (%Ls)',
|
||||
$this->phids);
|
||||
}
|
||||
|
||||
if ($this->statuses !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'status IN (%Ls)',
|
||||
'dashboard.status IN (%Ls)',
|
||||
$this->statuses);
|
||||
}
|
||||
|
||||
if ($this->authorPHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'authorPHID IN (%Ls)',
|
||||
'dashboard.authorPHID IN (%Ls)',
|
||||
$this->authorPHIDs);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,10 +21,6 @@ final class PhabricatorDashboardSearchEngine
|
|||
|
||||
protected function buildCustomSearchFields() {
|
||||
return array(
|
||||
id(new PhabricatorSearchTextField())
|
||||
->setLabel(pht('Name Contains'))
|
||||
->setKey('name')
|
||||
->setDescription(pht('Search for dashboards by name substring.')),
|
||||
id(new PhabricatorSearchDatasourceField())
|
||||
->setLabel(pht('Authored By'))
|
||||
->setKey('authorPHIDs')
|
||||
|
@ -93,10 +89,6 @@ final class PhabricatorDashboardSearchEngine
|
|||
$query->withAuthorPHIDs($map['authorPHIDs']);
|
||||
}
|
||||
|
||||
if ($map['name'] !== null) {
|
||||
$query->withNameNgrams($map['name']);
|
||||
}
|
||||
|
||||
if ($map['editable'] !== null) {
|
||||
$query->withCanEdit($map['editable']);
|
||||
}
|
||||
|
@ -121,6 +113,17 @@ final class PhabricatorDashboardSearchEngine
|
|||
|
||||
$handles = $viewer->loadHandles($phids);
|
||||
|
||||
if ($dashboards) {
|
||||
$edge_query = id(new PhabricatorEdgeQuery())
|
||||
->withSourcePHIDs(mpull($dashboards, 'getPHID'))
|
||||
->withEdgeTypes(
|
||||
array(
|
||||
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
|
||||
));
|
||||
|
||||
$edge_query->execute();
|
||||
}
|
||||
|
||||
$list = id(new PHUIObjectItemListView())
|
||||
->setViewer($viewer);
|
||||
|
||||
|
@ -132,10 +135,11 @@ final class PhabricatorDashboardSearchEngine
|
|||
->setHref($dashboard->getURI())
|
||||
->setObject($dashboard);
|
||||
|
||||
$bg_color = 'bg-dark';
|
||||
if ($dashboard->isArchived()) {
|
||||
$item->setDisabled(true);
|
||||
$bg_color = 'bg-grey';
|
||||
} else {
|
||||
$bg_color = 'bg-dark';
|
||||
}
|
||||
|
||||
$icon = id(new PHUIIconView())
|
||||
|
@ -148,6 +152,17 @@ final class PhabricatorDashboardSearchEngine
|
|||
$author_name = $handles[$author_phid]->renderLink();
|
||||
$item->addByline(pht('Author: %s', $author_name));
|
||||
|
||||
$phid = $dashboard->getPHID();
|
||||
$project_phids = $edge_query->getDestinationPHIDs(array($phid));
|
||||
$project_handles = $viewer->loadHandles($project_phids);
|
||||
|
||||
$item->addAttribute(
|
||||
id(new PHUIHandleTagListView())
|
||||
->setLimit(4)
|
||||
->setNoDataString(pht('No Tags'))
|
||||
->setSlim(true)
|
||||
->setHandles($project_handles));
|
||||
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
||||
|
@ -158,24 +173,4 @@ final class PhabricatorDashboardSearchEngine
|
|||
return $result;
|
||||
}
|
||||
|
||||
protected function getNewUserBody() {
|
||||
$create_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Create a Dashboard'))
|
||||
->setHref('/dashboard/create/')
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
$icon = $this->getApplication()->getIcon();
|
||||
$app_name = $this->getApplication()->getName();
|
||||
$view = id(new PHUIBigInfoView())
|
||||
->setIcon($icon)
|
||||
->setTitle(pht('Welcome to %s', $app_name))
|
||||
->setDescription(
|
||||
pht('Customize your homepage with different panels and '.
|
||||
'search queries.'))
|
||||
->addAction($create_button);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO
|
|||
PhabricatorFlaggableInterface,
|
||||
PhabricatorDestructibleInterface,
|
||||
PhabricatorProjectInterface,
|
||||
PhabricatorNgramsInterface,
|
||||
PhabricatorFulltextInterface,
|
||||
PhabricatorFerretInterface,
|
||||
PhabricatorDashboardPanelContainerInterface {
|
||||
|
||||
protected $name;
|
||||
|
@ -175,21 +176,22 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO
|
|||
$this->delete();
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorNgramInterface )------------------------------------------ */
|
||||
|
||||
|
||||
public function newNgrams() {
|
||||
return array(
|
||||
id(new PhabricatorDashboardNgrams())
|
||||
->setValue($this->getName()),
|
||||
);
|
||||
}
|
||||
|
||||
/* -( PhabricatorDashboardPanelContainerInterface )------------------------ */
|
||||
|
||||
public function getDashboardPanelContainerPanelPHIDs() {
|
||||
return $this->getPanelPHIDs();
|
||||
}
|
||||
|
||||
/* -( PhabricatorFulltextInterface )--------------------------------------- */
|
||||
|
||||
public function newFulltextEngine() {
|
||||
return new PhabricatorDashboardFulltextEngine();
|
||||
}
|
||||
|
||||
/* -( PhabricatorFerretInterface )----------------------------------------- */
|
||||
|
||||
public function newFerretEngine() {
|
||||
return new PhabricatorDashboardFerretEngine();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorDashboardNgrams
|
||||
extends PhabricatorSearchNgrams {
|
||||
|
||||
public function getNgramKey() {
|
||||
return 'dashboard';
|
||||
}
|
||||
|
||||
public function getColumnName() {
|
||||
return 'name';
|
||||
}
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'dashboard';
|
||||
}
|
||||
|
||||
}
|
|
@ -10,7 +10,8 @@ final class PhabricatorDashboardPanel
|
|||
PhabricatorPolicyInterface,
|
||||
PhabricatorFlaggableInterface,
|
||||
PhabricatorDestructibleInterface,
|
||||
PhabricatorNgramsInterface,
|
||||
PhabricatorFulltextInterface,
|
||||
PhabricatorFerretInterface,
|
||||
PhabricatorDashboardPanelContainerInterface {
|
||||
|
||||
protected $name;
|
||||
|
@ -155,21 +156,22 @@ final class PhabricatorDashboardPanel
|
|||
$this->saveTransaction();
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorNgramInterface )------------------------------------------ */
|
||||
|
||||
|
||||
public function newNgrams() {
|
||||
return array(
|
||||
id(new PhabricatorDashboardPanelNgrams())
|
||||
->setValue($this->getName()),
|
||||
);
|
||||
}
|
||||
|
||||
/* -( PhabricatorDashboardPanelContainerInterface )------------------------ */
|
||||
|
||||
public function getDashboardPanelContainerPanelPHIDs() {
|
||||
return $this->requireImplementation()->getSubpanelPHIDs($this);
|
||||
}
|
||||
|
||||
/* -( PhabricatorFulltextInterface )--------------------------------------- */
|
||||
|
||||
public function newFulltextEngine() {
|
||||
return new PhabricatorDashboardPanelFulltextEngine();
|
||||
}
|
||||
|
||||
/* -( PhabricatorFerretInterface )----------------------------------------- */
|
||||
|
||||
public function newFerretEngine() {
|
||||
return new PhabricatorDashboardPanelFerretEngine();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorDashboardPanelNgrams
|
||||
extends PhabricatorSearchNgrams {
|
||||
|
||||
public function getNgramKey() {
|
||||
return 'dashboardpanel';
|
||||
}
|
||||
|
||||
public function getColumnName() {
|
||||
return 'name';
|
||||
}
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'dashboard';
|
||||
}
|
||||
|
||||
}
|
|
@ -18,6 +18,12 @@ final class PhabricatorDashboardDatasource
|
|||
public function loadResults() {
|
||||
$query = id(new PhabricatorDashboardQuery());
|
||||
|
||||
$this->applyFerretConstraints(
|
||||
$query,
|
||||
id(new PhabricatorDashboard())->newFerretEngine(),
|
||||
'title',
|
||||
$this->getRawQuery());
|
||||
|
||||
$dashboards = $this->executeQuery($query);
|
||||
$results = array();
|
||||
foreach ($dashboards as $dashboard) {
|
||||
|
|
|
@ -33,7 +33,11 @@ final class PhabricatorDashboardPanelDatasource
|
|||
$id = (int)$id;
|
||||
$query->withIDs(array($id));
|
||||
} else {
|
||||
$query->withNameNgrams($raw_query);
|
||||
$this->applyFerretConstraints(
|
||||
$query,
|
||||
id(new PhabricatorDashboardPanel())->newFerretEngine(),
|
||||
'title',
|
||||
$this->getRawQuery());
|
||||
}
|
||||
|
||||
$panels = $this->executeQuery($query);
|
||||
|
|
|
@ -122,7 +122,7 @@ final class PHUIHandleTagListView extends AphrontTagView {
|
|||
private function newPlaceholderTag() {
|
||||
return id(new PHUITagView())
|
||||
->setType(PHUITagView::TYPE_SHADE)
|
||||
->setColor(PHUITagView::COLOR_DISABLED)
|
||||
->setColor(PHUITagView::COLOR_PLACEHOLDER)
|
||||
->setSlimShady($this->slim);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ final class PHUITagView extends AphrontTagView {
|
|||
const COLOR_BLUEGREY = 'bluegrey';
|
||||
const COLOR_CHECKERED = 'checkered';
|
||||
const COLOR_DISABLED = 'disabled';
|
||||
const COLOR_PLACEHOLDER = 'placeholder';
|
||||
|
||||
const COLOR_OBJECT = 'object';
|
||||
const COLOR_PERSON = 'person';
|
||||
|
|
|
@ -441,6 +441,12 @@ a.phui-tag-view:hover.phui-tag-disabled .phui-tag-core {
|
|||
border-color: {$sh-disabledborder};
|
||||
}
|
||||
|
||||
.phui-tag-placeholder .phui-tag-core {
|
||||
border-color: transparent;
|
||||
background-color: {$sh-disabledbackground};
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* - Outline Tags --------------------------------------------------------------
|
||||
|
||||
Basic Tag with a bold border and white background
|
||||
|
|
Loading…
Reference in a new issue