Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15400519
D9312.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9312.id.diff
View Options
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php b/src/applications/dashboard/controller/PhabricatorDashboardViewController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardViewController.php
@@ -26,10 +26,14 @@
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Dashboard %d', $dashboard->getID()));
- $rendered_dashboard = id(new PhabricatorDashboardRenderingEngine())
- ->setViewer($viewer)
- ->setDashboard($dashboard)
- ->renderDashboard();
+ if ($dashboard->getPanelPHIDs()) {
+ $rendered_dashboard = id(new PhabricatorDashboardRenderingEngine())
+ ->setViewer($viewer)
+ ->setDashboard($dashboard)
+ ->renderDashboard();
+ } else {
+ $rendered_dashboard = $this->buildEmptyView();
+ }
return $this->buildApplicationPage(
array(
@@ -50,9 +54,24 @@
id(new PHUIListItemView())
->setIcon('fa-th')
->setName(pht('Manage Dashboard'))
- ->setHref($this->getApplicationURI()."manage/{$id}/"));
+ ->setHref($this->getApplicationURI("manage/{$id}/")));
return $crumbs;
}
+ public function buildEmptyView() {
+ $id = $this->id;
+ $manage_uri = $this->getApplicationURI("manage/{$id}/");
+
+ return id(new AphrontErrorView())
+ ->setSeverity(AphrontErrorView::SEVERITY_NODATA)
+ ->appendChild(
+ pht('This dashboard has no panels '.
+ 'yet. Use %s to add panels.',
+ phutil_tag(
+ 'a',
+ array('href'=>$manage_uri),
+ pht('Manage Dashboard'))));
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 12:14 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7447552
Default Alt Text
D9312.id.diff (1 KB)
Attached To
Mode
D9312: Create an empty state for dashboards
Attached
Detach File
Event Timeline
Log In to Comment