diff --git a/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php b/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php index 1eab148261..c9cefca707 100644 --- a/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php +++ b/src/applications/dashboard/controller/panel/PhabricatorDashboardPanelListController.php @@ -48,23 +48,4 @@ final class PhabricatorDashboardPanelListController return $crumbs; } - protected function getNewUserBody() { - $create_button = id(new PHUIButtonView()) - ->setTag('a') - ->setText(pht('Create a Panel')) - ->setHref('/dashboard/panel/edit/') - ->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('Build individual panels to display on your homepage dashboard.')) - ->addAction($create_button); - - return $view; - } - } diff --git a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php index be59345aaa..c4b30652b9 100644 --- a/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php +++ b/src/applications/dashboard/query/PhabricatorDashboardPanelSearchEngine.php @@ -147,4 +147,22 @@ final class PhabricatorDashboardPanelSearchEngine return $result; } + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Panel')) + ->setHref('/dashboard/panel/edit/') + ->setColor(PHUIButtonView::GREEN); + + $app_name = pht('Panels'); + $view = id(new PHUIBigInfoView()) + ->setIcon('fa-line-chart') + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht('Build individual panels to display on your homepage dashboard.')) + ->addAction($create_button); + + return $view; + } + } diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 9094ead227..489dd08065 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -1454,6 +1454,12 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { return $attachments; } + /** + * Render a content body (if available) to onboard new users. + * This body is usually visible when you have no elements in a list, + * or when you force the rendering on a list with the `?nux=1` URL. + * @return wild|PhutilSafeHTML|null + */ final public function renderNewUserView() { $body = $this->getNewUserBody(); @@ -1464,6 +1470,12 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { return $body; } + /** + * Get a content body to onboard new users. + * Traditionally this content is shown from an empty list, to explain + * what a certain entity does, and how to create a new one. + * @return wild|PhutilSafeHTML|null + */ protected function getNewUserHeader() { return null; }