Page MenuHomePhabricator

D20411.diff
No OneTemporary

D20411.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -9,7 +9,7 @@
'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 @@
'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 @@
'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',
diff --git a/resources/sql/autopatches/20190412.dashboard.03.dashngrams.sql b/resources/sql/autopatches/20190412.dashboard.03.dashngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.03.dashngrams.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_dashboard_ngrams;
diff --git a/resources/sql/autopatches/20190412.dashboard.04.panelngrams.sql b/resources/sql/autopatches/20190412.dashboard.04.panelngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.04.panelngrams.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_dashboardpanel_ngrams;
diff --git a/resources/sql/autopatches/20190412.dashboard.05.dferret.doc.sql b/resources/sql/autopatches/20190412.dashboard.05.dferret.doc.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.05.dferret.doc.sql
@@ -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};
diff --git a/resources/sql/autopatches/20190412.dashboard.06.dferret.field.sql b/resources/sql/autopatches/20190412.dashboard.06.dferret.field.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.06.dferret.field.sql
@@ -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};
diff --git a/resources/sql/autopatches/20190412.dashboard.07.dferret.ngrams.sql b/resources/sql/autopatches/20190412.dashboard.07.dferret.ngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.07.dferret.ngrams.sql
@@ -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};
diff --git a/resources/sql/autopatches/20190412.dashboard.08.dferret.cngrams.sql b/resources/sql/autopatches/20190412.dashboard.08.dferret.cngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.08.dferret.cngrams.sql
@@ -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};
diff --git a/resources/sql/autopatches/20190412.dashboard.09.pferret.doc.sql b/resources/sql/autopatches/20190412.dashboard.09.pferret.doc.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.09.pferret.doc.sql
@@ -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};
diff --git a/resources/sql/autopatches/20190412.dashboard.10.pferret.field.sql b/resources/sql/autopatches/20190412.dashboard.10.pferret.field.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.10.pferret.field.sql
@@ -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};
diff --git a/resources/sql/autopatches/20190412.dashboard.11.pferret.ngrams.sql b/resources/sql/autopatches/20190412.dashboard.11.pferret.ngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.11.pferret.ngrams.sql
@@ -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};
diff --git a/resources/sql/autopatches/20190412.dashboard.12.pferret.cngrams.sql b/resources/sql/autopatches/20190412.dashboard.12.pferret.cngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190412.dashboard.12.pferret.cngrams.sql
@@ -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};
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2919,7 +2919,9 @@
'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 @@
'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 @@
'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 @@
'PhabricatorFlaggableInterface',
'PhabricatorDestructibleInterface',
'PhabricatorProjectInterface',
- 'PhabricatorNgramsInterface',
+ 'PhabricatorFulltextInterface',
+ 'PhabricatorFerretInterface',
'PhabricatorDashboardPanelContainerInterface',
),
'PhabricatorDashboardAdjustController' => 'PhabricatorDashboardController',
@@ -8916,7 +8919,9 @@
'PhabricatorDashboardEditController' => 'PhabricatorDashboardController',
'PhabricatorDashboardEditEngine' => 'PhabricatorEditEngine',
'PhabricatorDashboardFavoritesInstallWorkflow' => 'PhabricatorDashboardApplicationInstallWorkflow',
+ 'PhabricatorDashboardFerretEngine' => 'PhabricatorFerretEngine',
'PhabricatorDashboardFullLayoutMode' => 'PhabricatorDashboardLayoutMode',
+ 'PhabricatorDashboardFulltextEngine' => 'PhabricatorFulltextEngine',
'PhabricatorDashboardHalfLayoutMode' => 'PhabricatorDashboardLayoutMode',
'PhabricatorDashboardHomeInstallWorkflow' => 'PhabricatorDashboardApplicationInstallWorkflow',
'PhabricatorDashboardIconSet' => 'PhabricatorIconSet',
@@ -8927,7 +8932,6 @@
'PhabricatorDashboardLayoutTransaction' => 'PhabricatorDashboardTransactionType',
'PhabricatorDashboardListController' => 'PhabricatorDashboardController',
'PhabricatorDashboardNameTransaction' => 'PhabricatorDashboardTransactionType',
- 'PhabricatorDashboardNgrams' => 'PhabricatorSearchNgrams',
'PhabricatorDashboardObjectInstallWorkflow' => 'PhabricatorDashboardInstallWorkflow',
'PhabricatorDashboardOneThirdLayoutMode' => 'PhabricatorDashboardLayoutMode',
'PhabricatorDashboardPanel' => array(
@@ -8936,7 +8940,8 @@
'PhabricatorPolicyInterface',
'PhabricatorFlaggableInterface',
'PhabricatorDestructibleInterface',
- 'PhabricatorNgramsInterface',
+ 'PhabricatorFulltextInterface',
+ 'PhabricatorFerretInterface',
'PhabricatorDashboardPanelContainerInterface',
),
'PhabricatorDashboardPanelArchiveController' => 'PhabricatorDashboardController',
@@ -8945,9 +8950,10 @@
'PhabricatorDashboardPanelEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'PhabricatorDashboardPanelEditController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPanelEditEngine' => 'PhabricatorEditEngine',
+ 'PhabricatorDashboardPanelFerretEngine' => 'PhabricatorFerretEngine',
+ 'PhabricatorDashboardPanelFulltextEngine' => 'PhabricatorFulltextEngine',
'PhabricatorDashboardPanelListController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPanelNameTransaction' => 'PhabricatorDashboardPanelTransactionType',
- 'PhabricatorDashboardPanelNgrams' => 'PhabricatorSearchNgrams',
'PhabricatorDashboardPanelPHIDType' => 'PhabricatorPHIDType',
'PhabricatorDashboardPanelPropertyTransaction' => 'PhabricatorDashboardPanelTransactionType',
'PhabricatorDashboardPanelQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardFerretEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardFerretEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/dashboard/engine/PhabricatorDashboardFerretEngine.php
@@ -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();
+ }
+
+}
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php
@@ -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());
+ }
+
+}
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelFerretEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelFerretEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelFerretEngine.php
@@ -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();
+ }
+
+}
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelFulltextEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelFulltextEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelFulltextEngine.php
@@ -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());
+ }
+
+}
diff --git a/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php b/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
--- a/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
@@ -34,12 +34,6 @@
return $this;
}
- public function withNameNgrams($ngrams) {
- return $this->withNgramsConstraint(
- id(new PhabricatorDashboardPanelNgrams()),
- $ngrams);
- }
-
protected function loadPage() {
return $this->loadStandardPage($this->newResultObject());
}
diff --git a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
--- a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
@@ -42,20 +42,12 @@
$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')
diff --git a/src/applications/dashboard/query/PhabricatorDashboardQuery.php b/src/applications/dashboard/query/PhabricatorDashboardQuery.php
--- a/src/applications/dashboard/query/PhabricatorDashboardQuery.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardQuery.php
@@ -34,12 +34,6 @@
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 @@
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);
}
diff --git a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
--- a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
+++ b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
@@ -21,10 +21,6 @@
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 @@
$query->withAuthorPHIDs($map['authorPHIDs']);
}
- if ($map['name'] !== null) {
- $query->withNameNgrams($map['name']);
- }
-
if ($map['editable'] !== null) {
$query->withCanEdit($map['editable']);
}
@@ -121,6 +113,17 @@
$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 @@
->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 @@
$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 @@
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;
- }
-
}
diff --git a/src/applications/dashboard/storage/PhabricatorDashboard.php b/src/applications/dashboard/storage/PhabricatorDashboard.php
--- a/src/applications/dashboard/storage/PhabricatorDashboard.php
+++ b/src/applications/dashboard/storage/PhabricatorDashboard.php
@@ -10,7 +10,8 @@
PhabricatorFlaggableInterface,
PhabricatorDestructibleInterface,
PhabricatorProjectInterface,
- PhabricatorNgramsInterface,
+ PhabricatorFulltextInterface,
+ PhabricatorFerretInterface,
PhabricatorDashboardPanelContainerInterface {
protected $name;
@@ -175,21 +176,22 @@
$this->delete();
}
+/* -( PhabricatorDashboardPanelContainerInterface )------------------------ */
-/* -( PhabricatorNgramInterface )------------------------------------------ */
+ public function getDashboardPanelContainerPanelPHIDs() {
+ return $this->getPanelPHIDs();
+ }
+/* -( PhabricatorFulltextInterface )--------------------------------------- */
- public function newNgrams() {
- return array(
- id(new PhabricatorDashboardNgrams())
- ->setValue($this->getName()),
- );
+ public function newFulltextEngine() {
+ return new PhabricatorDashboardFulltextEngine();
}
-/* -( PhabricatorDashboardPanelContainerInterface )------------------------ */
+/* -( PhabricatorFerretInterface )----------------------------------------- */
- public function getDashboardPanelContainerPanelPHIDs() {
- return $this->getPanelPHIDs();
+ public function newFerretEngine() {
+ return new PhabricatorDashboardFerretEngine();
}
}
diff --git a/src/applications/dashboard/storage/PhabricatorDashboardNgrams.php b/src/applications/dashboard/storage/PhabricatorDashboardNgrams.php
deleted file mode 100644
--- a/src/applications/dashboard/storage/PhabricatorDashboardNgrams.php
+++ /dev/null
@@ -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';
- }
-
-}
diff --git a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
--- a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
+++ b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
@@ -10,7 +10,8 @@
PhabricatorPolicyInterface,
PhabricatorFlaggableInterface,
PhabricatorDestructibleInterface,
- PhabricatorNgramsInterface,
+ PhabricatorFulltextInterface,
+ PhabricatorFerretInterface,
PhabricatorDashboardPanelContainerInterface {
protected $name;
@@ -155,21 +156,22 @@
$this->saveTransaction();
}
+/* -( PhabricatorDashboardPanelContainerInterface )------------------------ */
-/* -( PhabricatorNgramInterface )------------------------------------------ */
+ public function getDashboardPanelContainerPanelPHIDs() {
+ return $this->requireImplementation()->getSubpanelPHIDs($this);
+ }
+/* -( PhabricatorFulltextInterface )--------------------------------------- */
- public function newNgrams() {
- return array(
- id(new PhabricatorDashboardPanelNgrams())
- ->setValue($this->getName()),
- );
+ public function newFulltextEngine() {
+ return new PhabricatorDashboardPanelFulltextEngine();
}
-/* -( PhabricatorDashboardPanelContainerInterface )------------------------ */
+/* -( PhabricatorFerretInterface )----------------------------------------- */
- public function getDashboardPanelContainerPanelPHIDs() {
- return $this->requireImplementation()->getSubpanelPHIDs($this);
+ public function newFerretEngine() {
+ return new PhabricatorDashboardPanelFerretEngine();
}
}
diff --git a/src/applications/dashboard/storage/PhabricatorDashboardPanelNgrams.php b/src/applications/dashboard/storage/PhabricatorDashboardPanelNgrams.php
deleted file mode 100644
--- a/src/applications/dashboard/storage/PhabricatorDashboardPanelNgrams.php
+++ /dev/null
@@ -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';
- }
-
-}
diff --git a/src/applications/dashboard/typeahead/PhabricatorDashboardDatasource.php b/src/applications/dashboard/typeahead/PhabricatorDashboardDatasource.php
--- a/src/applications/dashboard/typeahead/PhabricatorDashboardDatasource.php
+++ b/src/applications/dashboard/typeahead/PhabricatorDashboardDatasource.php
@@ -18,6 +18,12 @@
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) {
diff --git a/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php b/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
--- a/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
+++ b/src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
@@ -33,7 +33,11 @@
$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);
diff --git a/src/applications/phid/view/PHUIHandleTagListView.php b/src/applications/phid/view/PHUIHandleTagListView.php
--- a/src/applications/phid/view/PHUIHandleTagListView.php
+++ b/src/applications/phid/view/PHUIHandleTagListView.php
@@ -122,7 +122,7 @@
private function newPlaceholderTag() {
return id(new PHUITagView())
->setType(PHUITagView::TYPE_SHADE)
- ->setColor(PHUITagView::COLOR_DISABLED)
+ ->setColor(PHUITagView::COLOR_PLACEHOLDER)
->setSlimShady($this->slim);
}
diff --git a/src/view/phui/PHUITagView.php b/src/view/phui/PHUITagView.php
--- a/src/view/phui/PHUITagView.php
+++ b/src/view/phui/PHUITagView.php
@@ -24,6 +24,7 @@
const COLOR_BLUEGREY = 'bluegrey';
const COLOR_CHECKERED = 'checkered';
const COLOR_DISABLED = 'disabled';
+ const COLOR_PLACEHOLDER = 'placeholder';
const COLOR_OBJECT = 'object';
const COLOR_PERSON = 'person';
diff --git a/webroot/rsrc/css/phui/phui-tag-view.css b/webroot/rsrc/css/phui/phui-tag-view.css
--- a/webroot/rsrc/css/phui/phui-tag-view.css
+++ b/webroot/rsrc/css/phui/phui-tag-view.css
@@ -441,6 +441,12 @@
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

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 6:34 AM (12 h, 12 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6788418
Default Alt Text
D20411.diff (28 KB)

Event Timeline