@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+228 -120
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '3c8a0668', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '4011a01e', 12 + 'core.pkg.css' => '77c4f199', 13 13 'core.pkg.js' => '69247edd', 14 14 'differential.pkg.css' => '8d8360fb', 15 15 'differential.pkg.js' => '67e02996', ··· 173 173 'rsrc/css/phui/phui-segment-bar-view.css' => '5166b370', 174 174 'rsrc/css/phui/phui-spacing.css' => 'b05cadc3', 175 175 'rsrc/css/phui/phui-status.css' => 'e5ff8be0', 176 - 'rsrc/css/phui/phui-tag-view.css' => '29409667', 176 + 'rsrc/css/phui/phui-tag-view.css' => '8519160a', 177 177 'rsrc/css/phui/phui-timeline-view.css' => '1e348e4b', 178 178 'rsrc/css/phui/phui-two-column-view.css' => '01e6991e', 179 179 'rsrc/css/phui/workboards/phui-workboard-color.css' => 'e86de308', ··· 862 862 'phui-segment-bar-view-css' => '5166b370', 863 863 'phui-spacing-css' => 'b05cadc3', 864 864 'phui-status-list-view-css' => 'e5ff8be0', 865 - 'phui-tag-view-css' => '29409667', 865 + 'phui-tag-view-css' => '8519160a', 866 866 'phui-theme-css' => '35883b37', 867 867 'phui-timeline-view-css' => '1e348e4b', 868 868 'phui-two-column-view-css' => '01e6991e',
+1
resources/sql/autopatches/20190412.dashboard.03.dashngrams.sql
··· 1 + DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_dashboard_ngrams;
+1
resources/sql/autopatches/20190412.dashboard.04.panelngrams.sql
··· 1 + DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_dashboardpanel_ngrams;
+9
resources/sql/autopatches/20190412.dashboard.05.dferret.doc.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_fdocument ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + objectPHID VARBINARY(64) NOT NULL, 4 + isClosed BOOL NOT NULL, 5 + authorPHID VARBINARY(64), 6 + ownerPHID VARBINARY(64), 7 + epochCreated INT UNSIGNED NOT NULL, 8 + epochModified INT UNSIGNED NOT NULL 9 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+8
resources/sql/autopatches/20190412.dashboard.06.dferret.field.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_ffield ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + documentID INT UNSIGNED NOT NULL, 4 + fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT}, 5 + rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}, 6 + termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}, 7 + normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT} 8 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+5
resources/sql/autopatches/20190412.dashboard.07.dferret.ngrams.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_fngrams ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + documentID INT UNSIGNED NOT NULL, 4 + ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT} 5 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+7
resources/sql/autopatches/20190412.dashboard.08.dferret.cngrams.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_dashboard_fngrams_common ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}, 4 + needsCollection BOOL NOT NULL, 5 + UNIQUE KEY `key_ngram` (ngram), 6 + KEY `key_collect` (needsCollection) 7 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+9
resources/sql/autopatches/20190412.dashboard.09.pferret.doc.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_fdocument ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + objectPHID VARBINARY(64) NOT NULL, 4 + isClosed BOOL NOT NULL, 5 + authorPHID VARBINARY(64), 6 + ownerPHID VARBINARY(64), 7 + epochCreated INT UNSIGNED NOT NULL, 8 + epochModified INT UNSIGNED NOT NULL 9 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+8
resources/sql/autopatches/20190412.dashboard.10.pferret.field.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_ffield ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + documentID INT UNSIGNED NOT NULL, 4 + fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT}, 5 + rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}, 6 + termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}, 7 + normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT} 8 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+5
resources/sql/autopatches/20190412.dashboard.11.pferret.ngrams.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_fngrams ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + documentID INT UNSIGNED NOT NULL, 4 + ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT} 5 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+7
resources/sql/autopatches/20190412.dashboard.12.pferret.cngrams.sql
··· 1 + CREATE TABLE {$NAMESPACE}_dashboard.dashboard_panel_fngrams_common ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}, 4 + needsCollection BOOL NOT NULL, 5 + UNIQUE KEY `key_ngram` (ngram), 6 + KEY `key_collect` (needsCollection) 7 + ) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+12 -6
src/__phutil_library_map__.php
··· 2919 2919 'PhabricatorDashboardEditController' => 'applications/dashboard/controller/dashboard/PhabricatorDashboardEditController.php', 2920 2920 'PhabricatorDashboardEditEngine' => 'applications/dashboard/editor/PhabricatorDashboardEditEngine.php', 2921 2921 'PhabricatorDashboardFavoritesInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardFavoritesInstallWorkflow.php', 2922 + 'PhabricatorDashboardFerretEngine' => 'applications/dashboard/engine/PhabricatorDashboardFerretEngine.php', 2922 2923 'PhabricatorDashboardFullLayoutMode' => 'applications/dashboard/layoutconfig/PhabricatorDashboardFullLayoutMode.php', 2924 + 'PhabricatorDashboardFulltextEngine' => 'applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php', 2923 2925 'PhabricatorDashboardHalfLayoutMode' => 'applications/dashboard/layoutconfig/PhabricatorDashboardHalfLayoutMode.php', 2924 2926 'PhabricatorDashboardHomeInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardHomeInstallWorkflow.php', 2925 2927 'PhabricatorDashboardIconSet' => 'applications/dashboard/icon/PhabricatorDashboardIconSet.php', ··· 2930 2932 'PhabricatorDashboardLayoutTransaction' => 'applications/dashboard/xaction/dashboard/PhabricatorDashboardLayoutTransaction.php', 2931 2933 'PhabricatorDashboardListController' => 'applications/dashboard/controller/PhabricatorDashboardListController.php', 2932 2934 'PhabricatorDashboardNameTransaction' => 'applications/dashboard/xaction/dashboard/PhabricatorDashboardNameTransaction.php', 2933 - 'PhabricatorDashboardNgrams' => 'applications/dashboard/storage/PhabricatorDashboardNgrams.php', 2934 2935 'PhabricatorDashboardObjectInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardObjectInstallWorkflow.php', 2935 2936 'PhabricatorDashboardOneThirdLayoutMode' => 'applications/dashboard/layoutconfig/PhabricatorDashboardOneThirdLayoutMode.php', 2936 2937 'PhabricatorDashboardPanel' => 'applications/dashboard/storage/PhabricatorDashboardPanel.php', ··· 2941 2942 'PhabricatorDashboardPanelEditConduitAPIMethod' => 'applications/dashboard/conduit/PhabricatorDashboardPanelEditConduitAPIMethod.php', 2942 2943 'PhabricatorDashboardPanelEditController' => 'applications/dashboard/controller/panel/PhabricatorDashboardPanelEditController.php', 2943 2944 'PhabricatorDashboardPanelEditEngine' => 'applications/dashboard/editor/PhabricatorDashboardPanelEditEngine.php', 2945 + 'PhabricatorDashboardPanelFerretEngine' => 'applications/dashboard/engine/PhabricatorDashboardPanelFerretEngine.php', 2946 + 'PhabricatorDashboardPanelFulltextEngine' => 'applications/dashboard/engine/PhabricatorDashboardPanelFulltextEngine.php', 2944 2947 'PhabricatorDashboardPanelListController' => 'applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php', 2945 2948 'PhabricatorDashboardPanelNameTransaction' => 'applications/dashboard/xaction/panel/PhabricatorDashboardPanelNameTransaction.php', 2946 - 'PhabricatorDashboardPanelNgrams' => 'applications/dashboard/storage/PhabricatorDashboardPanelNgrams.php', 2947 2949 'PhabricatorDashboardPanelPHIDType' => 'applications/dashboard/phid/PhabricatorDashboardPanelPHIDType.php', 2948 2950 'PhabricatorDashboardPanelPropertyTransaction' => 'applications/dashboard/xaction/panel/PhabricatorDashboardPanelPropertyTransaction.php', 2949 2951 'PhabricatorDashboardPanelQuery' => 'applications/dashboard/query/PhabricatorDashboardPanelQuery.php', ··· 8900 8902 'PhabricatorFlaggableInterface', 8901 8903 'PhabricatorDestructibleInterface', 8902 8904 'PhabricatorProjectInterface', 8903 - 'PhabricatorNgramsInterface', 8905 + 'PhabricatorFulltextInterface', 8906 + 'PhabricatorFerretInterface', 8904 8907 'PhabricatorDashboardPanelContainerInterface', 8905 8908 ), 8906 8909 'PhabricatorDashboardAdjustController' => 'PhabricatorDashboardController', ··· 8916 8919 'PhabricatorDashboardEditController' => 'PhabricatorDashboardController', 8917 8920 'PhabricatorDashboardEditEngine' => 'PhabricatorEditEngine', 8918 8921 'PhabricatorDashboardFavoritesInstallWorkflow' => 'PhabricatorDashboardApplicationInstallWorkflow', 8922 + 'PhabricatorDashboardFerretEngine' => 'PhabricatorFerretEngine', 8919 8923 'PhabricatorDashboardFullLayoutMode' => 'PhabricatorDashboardLayoutMode', 8924 + 'PhabricatorDashboardFulltextEngine' => 'PhabricatorFulltextEngine', 8920 8925 'PhabricatorDashboardHalfLayoutMode' => 'PhabricatorDashboardLayoutMode', 8921 8926 'PhabricatorDashboardHomeInstallWorkflow' => 'PhabricatorDashboardApplicationInstallWorkflow', 8922 8927 'PhabricatorDashboardIconSet' => 'PhabricatorIconSet', ··· 8927 8932 'PhabricatorDashboardLayoutTransaction' => 'PhabricatorDashboardTransactionType', 8928 8933 'PhabricatorDashboardListController' => 'PhabricatorDashboardController', 8929 8934 'PhabricatorDashboardNameTransaction' => 'PhabricatorDashboardTransactionType', 8930 - 'PhabricatorDashboardNgrams' => 'PhabricatorSearchNgrams', 8931 8935 'PhabricatorDashboardObjectInstallWorkflow' => 'PhabricatorDashboardInstallWorkflow', 8932 8936 'PhabricatorDashboardOneThirdLayoutMode' => 'PhabricatorDashboardLayoutMode', 8933 8937 'PhabricatorDashboardPanel' => array( ··· 8936 8940 'PhabricatorPolicyInterface', 8937 8941 'PhabricatorFlaggableInterface', 8938 8942 'PhabricatorDestructibleInterface', 8939 - 'PhabricatorNgramsInterface', 8943 + 'PhabricatorFulltextInterface', 8944 + 'PhabricatorFerretInterface', 8940 8945 'PhabricatorDashboardPanelContainerInterface', 8941 8946 ), 8942 8947 'PhabricatorDashboardPanelArchiveController' => 'PhabricatorDashboardController', ··· 8945 8950 'PhabricatorDashboardPanelEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 8946 8951 'PhabricatorDashboardPanelEditController' => 'PhabricatorDashboardController', 8947 8952 'PhabricatorDashboardPanelEditEngine' => 'PhabricatorEditEngine', 8953 + 'PhabricatorDashboardPanelFerretEngine' => 'PhabricatorFerretEngine', 8954 + 'PhabricatorDashboardPanelFulltextEngine' => 'PhabricatorFulltextEngine', 8948 8955 'PhabricatorDashboardPanelListController' => 'PhabricatorDashboardController', 8949 8956 'PhabricatorDashboardPanelNameTransaction' => 'PhabricatorDashboardPanelTransactionType', 8950 - 'PhabricatorDashboardPanelNgrams' => 'PhabricatorSearchNgrams', 8951 8957 'PhabricatorDashboardPanelPHIDType' => 'PhabricatorPHIDType', 8952 8958 'PhabricatorDashboardPanelPropertyTransaction' => 'PhabricatorDashboardPanelTransactionType', 8953 8959 'PhabricatorDashboardPanelQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
+18
src/applications/dashboard/engine/PhabricatorDashboardFerretEngine.php
··· 1 + <?php 2 + 3 + final class PhabricatorDashboardFerretEngine 4 + extends PhabricatorFerretEngine { 5 + 6 + public function getApplicationName() { 7 + return 'dashboard'; 8 + } 9 + 10 + public function getScopeName() { 11 + return 'dashboard'; 12 + } 13 + 14 + public function newSearchEngine() { 15 + return new PhabricatorDashboardSearchEngine(); 16 + } 17 + 18 + }
+23
src/applications/dashboard/engine/PhabricatorDashboardFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PhabricatorDashboardFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $dashboard = $object; 11 + 12 + $document->setDocumentTitle($dashboard->getName()); 13 + 14 + $document->addRelationship( 15 + $dashboard->isArchived() 16 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 17 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 18 + $dashboard->getPHID(), 19 + PhabricatorDashboardDashboardPHIDType::TYPECONST, 20 + PhabricatorTime::getNow()); 21 + } 22 + 23 + }
+18
src/applications/dashboard/engine/PhabricatorDashboardPanelFerretEngine.php
··· 1 + <?php 2 + 3 + final class PhabricatorDashboardPanelFerretEngine 4 + extends PhabricatorFerretEngine { 5 + 6 + public function getApplicationName() { 7 + return 'dashboard'; 8 + } 9 + 10 + public function getScopeName() { 11 + return 'panel'; 12 + } 13 + 14 + public function newSearchEngine() { 15 + return new PhabricatorDashboardPanelSearchEngine(); 16 + } 17 + 18 + }
+23
src/applications/dashboard/engine/PhabricatorDashboardPanelFulltextEngine.php
··· 1 + <?php 2 + 3 + final class PhabricatorDashboardPanelFulltextEngine 4 + extends PhabricatorFulltextEngine { 5 + 6 + protected function buildAbstractDocument( 7 + PhabricatorSearchAbstractDocument $document, 8 + $object) { 9 + 10 + $panel = $object; 11 + 12 + $document->setDocumentTitle($panel->getName()); 13 + 14 + $document->addRelationship( 15 + $panel->getIsArchived() 16 + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED 17 + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, 18 + $panel->getPHID(), 19 + PhabricatorDashboardPanelPHIDType::TYPECONST, 20 + PhabricatorTime::getNow()); 21 + } 22 + 23 + }
-6
src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
··· 34 34 return $this; 35 35 } 36 36 37 - public function withNameNgrams($ngrams) { 38 - return $this->withNgramsConstraint( 39 - id(new PhabricatorDashboardPanelNgrams()), 40 - $ngrams); 41 - } 42 - 43 37 protected function loadPage() { 44 38 return $this->loadStandardPage($this->newResultObject()); 45 39 }
-8
src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php
··· 42 42 $query->withAuthorPHIDs($map['authorPHIDs']); 43 43 } 44 44 45 - if ($map['name'] !== null) { 46 - $query->withNameNgrams($map['name']); 47 - } 48 - 49 45 return $query; 50 46 } 51 47 52 48 protected function buildCustomSearchFields() { 53 49 54 50 return array( 55 - id(new PhabricatorSearchTextField()) 56 - ->setLabel(pht('Name Contains')) 57 - ->setKey('name') 58 - ->setDescription(pht('Search for panels by name substring.')), 59 51 id(new PhabricatorSearchDatasourceField()) 60 52 ->setLabel(pht('Authored By')) 61 53 ->setKey('authorPHIDs')
+4 -10
src/applications/dashboard/query/PhabricatorDashboardQuery.php
··· 34 34 return $this; 35 35 } 36 36 37 - public function withNameNgrams($ngrams) { 38 - return $this->withNgramsConstraint( 39 - id(new PhabricatorDashboardNgrams()), 40 - $ngrams); 41 - } 42 - 43 37 protected function loadPage() { 44 38 return $this->loadStandardPage($this->newResultObject()); 45 39 } ··· 70 64 if ($this->ids !== null) { 71 65 $where[] = qsprintf( 72 66 $conn, 73 - 'id IN (%Ld)', 67 + 'dashboard.id IN (%Ld)', 74 68 $this->ids); 75 69 } 76 70 77 71 if ($this->phids !== null) { 78 72 $where[] = qsprintf( 79 73 $conn, 80 - 'phid IN (%Ls)', 74 + 'dashboard.phid IN (%Ls)', 81 75 $this->phids); 82 76 } 83 77 84 78 if ($this->statuses !== null) { 85 79 $where[] = qsprintf( 86 80 $conn, 87 - 'status IN (%Ls)', 81 + 'dashboard.status IN (%Ls)', 88 82 $this->statuses); 89 83 } 90 84 91 85 if ($this->authorPHIDs !== null) { 92 86 $where[] = qsprintf( 93 87 $conn, 94 - 'authorPHID IN (%Ls)', 88 + 'dashboard.authorPHID IN (%Ls)', 95 89 $this->authorPHIDs); 96 90 } 97 91
+24 -29
src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php
··· 21 21 22 22 protected function buildCustomSearchFields() { 23 23 return array( 24 - id(new PhabricatorSearchTextField()) 25 - ->setLabel(pht('Name Contains')) 26 - ->setKey('name') 27 - ->setDescription(pht('Search for dashboards by name substring.')), 28 24 id(new PhabricatorSearchDatasourceField()) 29 25 ->setLabel(pht('Authored By')) 30 26 ->setKey('authorPHIDs') ··· 93 89 $query->withAuthorPHIDs($map['authorPHIDs']); 94 90 } 95 91 96 - if ($map['name'] !== null) { 97 - $query->withNameNgrams($map['name']); 98 - } 99 - 100 92 if ($map['editable'] !== null) { 101 93 $query->withCanEdit($map['editable']); 102 94 } ··· 121 113 122 114 $handles = $viewer->loadHandles($phids); 123 115 116 + if ($dashboards) { 117 + $edge_query = id(new PhabricatorEdgeQuery()) 118 + ->withSourcePHIDs(mpull($dashboards, 'getPHID')) 119 + ->withEdgeTypes( 120 + array( 121 + PhabricatorProjectObjectHasProjectEdgeType::EDGECONST, 122 + )); 123 + 124 + $edge_query->execute(); 125 + } 126 + 124 127 $list = id(new PHUIObjectItemListView()) 125 128 ->setViewer($viewer); 126 129 ··· 132 135 ->setHref($dashboard->getURI()) 133 136 ->setObject($dashboard); 134 137 135 - $bg_color = 'bg-dark'; 136 138 if ($dashboard->isArchived()) { 137 139 $item->setDisabled(true); 138 140 $bg_color = 'bg-grey'; 141 + } else { 142 + $bg_color = 'bg-dark'; 139 143 } 140 144 141 145 $icon = id(new PHUIIconView()) ··· 148 152 $author_name = $handles[$author_phid]->renderLink(); 149 153 $item->addByline(pht('Author: %s', $author_name)); 150 154 155 + $phid = $dashboard->getPHID(); 156 + $project_phids = $edge_query->getDestinationPHIDs(array($phid)); 157 + $project_handles = $viewer->loadHandles($project_phids); 158 + 159 + $item->addAttribute( 160 + id(new PHUIHandleTagListView()) 161 + ->setLimit(4) 162 + ->setNoDataString(pht('No Tags')) 163 + ->setSlim(true) 164 + ->setHandles($project_handles)); 165 + 151 166 $list->addItem($item); 152 167 } 153 168 ··· 156 171 $result->setNoDataString(pht('No dashboards found.')); 157 172 158 173 return $result; 159 - } 160 - 161 - protected function getNewUserBody() { 162 - $create_button = id(new PHUIButtonView()) 163 - ->setTag('a') 164 - ->setText(pht('Create a Dashboard')) 165 - ->setHref('/dashboard/create/') 166 - ->setColor(PHUIButtonView::GREEN); 167 - 168 - $icon = $this->getApplication()->getIcon(); 169 - $app_name = $this->getApplication()->getName(); 170 - $view = id(new PHUIBigInfoView()) 171 - ->setIcon($icon) 172 - ->setTitle(pht('Welcome to %s', $app_name)) 173 - ->setDescription( 174 - pht('Customize your homepage with different panels and '. 175 - 'search queries.')) 176 - ->addAction($create_button); 177 - 178 - return $view; 179 174 } 180 175 181 176 }
+12 -10
src/applications/dashboard/storage/PhabricatorDashboard.php
··· 10 10 PhabricatorFlaggableInterface, 11 11 PhabricatorDestructibleInterface, 12 12 PhabricatorProjectInterface, 13 - PhabricatorNgramsInterface, 13 + PhabricatorFulltextInterface, 14 + PhabricatorFerretInterface, 14 15 PhabricatorDashboardPanelContainerInterface { 15 16 16 17 protected $name; ··· 175 176 $this->delete(); 176 177 } 177 178 179 + /* -( PhabricatorDashboardPanelContainerInterface )------------------------ */ 178 180 179 - /* -( PhabricatorNgramInterface )------------------------------------------ */ 181 + public function getDashboardPanelContainerPanelPHIDs() { 182 + return $this->getPanelPHIDs(); 183 + } 180 184 185 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 181 186 182 - public function newNgrams() { 183 - return array( 184 - id(new PhabricatorDashboardNgrams()) 185 - ->setValue($this->getName()), 186 - ); 187 + public function newFulltextEngine() { 188 + return new PhabricatorDashboardFulltextEngine(); 187 189 } 188 190 189 - /* -( PhabricatorDashboardPanelContainerInterface )------------------------ */ 191 + /* -( PhabricatorFerretInterface )----------------------------------------- */ 190 192 191 - public function getDashboardPanelContainerPanelPHIDs() { 192 - return $this->getPanelPHIDs(); 193 + public function newFerretEngine() { 194 + return new PhabricatorDashboardFerretEngine(); 193 195 } 194 196 195 197 }
-18
src/applications/dashboard/storage/PhabricatorDashboardNgrams.php
··· 1 - <?php 2 - 3 - final class PhabricatorDashboardNgrams 4 - extends PhabricatorSearchNgrams { 5 - 6 - public function getNgramKey() { 7 - return 'dashboard'; 8 - } 9 - 10 - public function getColumnName() { 11 - return 'name'; 12 - } 13 - 14 - public function getApplicationName() { 15 - return 'dashboard'; 16 - } 17 - 18 - }
+12 -10
src/applications/dashboard/storage/PhabricatorDashboardPanel.php
··· 10 10 PhabricatorPolicyInterface, 11 11 PhabricatorFlaggableInterface, 12 12 PhabricatorDestructibleInterface, 13 - PhabricatorNgramsInterface, 13 + PhabricatorFulltextInterface, 14 + PhabricatorFerretInterface, 14 15 PhabricatorDashboardPanelContainerInterface { 15 16 16 17 protected $name; ··· 155 156 $this->saveTransaction(); 156 157 } 157 158 159 + /* -( PhabricatorDashboardPanelContainerInterface )------------------------ */ 158 160 159 - /* -( PhabricatorNgramInterface )------------------------------------------ */ 161 + public function getDashboardPanelContainerPanelPHIDs() { 162 + return $this->requireImplementation()->getSubpanelPHIDs($this); 163 + } 160 164 165 + /* -( PhabricatorFulltextInterface )--------------------------------------- */ 161 166 162 - public function newNgrams() { 163 - return array( 164 - id(new PhabricatorDashboardPanelNgrams()) 165 - ->setValue($this->getName()), 166 - ); 167 + public function newFulltextEngine() { 168 + return new PhabricatorDashboardPanelFulltextEngine(); 167 169 } 168 170 169 - /* -( PhabricatorDashboardPanelContainerInterface )------------------------ */ 171 + /* -( PhabricatorFerretInterface )----------------------------------------- */ 170 172 171 - public function getDashboardPanelContainerPanelPHIDs() { 172 - return $this->requireImplementation()->getSubpanelPHIDs($this); 173 + public function newFerretEngine() { 174 + return new PhabricatorDashboardPanelFerretEngine(); 173 175 } 174 176 175 177 }
-18
src/applications/dashboard/storage/PhabricatorDashboardPanelNgrams.php
··· 1 - <?php 2 - 3 - final class PhabricatorDashboardPanelNgrams 4 - extends PhabricatorSearchNgrams { 5 - 6 - public function getNgramKey() { 7 - return 'dashboardpanel'; 8 - } 9 - 10 - public function getColumnName() { 11 - return 'name'; 12 - } 13 - 14 - public function getApplicationName() { 15 - return 'dashboard'; 16 - } 17 - 18 - }
+6
src/applications/dashboard/typeahead/PhabricatorDashboardDatasource.php
··· 18 18 public function loadResults() { 19 19 $query = id(new PhabricatorDashboardQuery()); 20 20 21 + $this->applyFerretConstraints( 22 + $query, 23 + id(new PhabricatorDashboard())->newFerretEngine(), 24 + 'title', 25 + $this->getRawQuery()); 26 + 21 27 $dashboards = $this->executeQuery($query); 22 28 $results = array(); 23 29 foreach ($dashboards as $dashboard) {
+5 -1
src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
··· 33 33 $id = (int)$id; 34 34 $query->withIDs(array($id)); 35 35 } else { 36 - $query->withNameNgrams($raw_query); 36 + $this->applyFerretConstraints( 37 + $query, 38 + id(new PhabricatorDashboardPanel())->newFerretEngine(), 39 + 'title', 40 + $this->getRawQuery()); 37 41 } 38 42 39 43 $panels = $this->executeQuery($query);
+1 -1
src/applications/phid/view/PHUIHandleTagListView.php
··· 122 122 private function newPlaceholderTag() { 123 123 return id(new PHUITagView()) 124 124 ->setType(PHUITagView::TYPE_SHADE) 125 - ->setColor(PHUITagView::COLOR_DISABLED) 125 + ->setColor(PHUITagView::COLOR_PLACEHOLDER) 126 126 ->setSlimShady($this->slim); 127 127 } 128 128
+1
src/view/phui/PHUITagView.php
··· 24 24 const COLOR_BLUEGREY = 'bluegrey'; 25 25 const COLOR_CHECKERED = 'checkered'; 26 26 const COLOR_DISABLED = 'disabled'; 27 + const COLOR_PLACEHOLDER = 'placeholder'; 27 28 28 29 const COLOR_OBJECT = 'object'; 29 30 const COLOR_PERSON = 'person';
+6
webroot/rsrc/css/phui/phui-tag-view.css
··· 441 441 border-color: {$sh-disabledborder}; 442 442 } 443 443 444 + .phui-tag-placeholder .phui-tag-core { 445 + border-color: transparent; 446 + background-color: {$sh-disabledbackground}; 447 + opacity: 0.5; 448 + } 449 + 444 450 /* - Outline Tags -------------------------------------------------------------- 445 451 446 452 Basic Tag with a bold border and white background