Show user a notice when they view "My Projects" for feed but haven't joined any projects

Summary: Currently, we show them everything. Instead, show them an explicit notice.

Test Plan: Looked at "My Projects" feed with no projects.

Reviewers: btrahan, vrana, jungejason

Reviewed By: jungejason

CC: aran

Maniphest Tasks: T1015

Differential Revision: https://secure.phabricator.com/D2143
This commit is contained in:
epriestley
2012-04-07 17:25:24 -07:00
parent ee278a302e
commit 780da42126
2 changed files with 13 additions and 5 deletions

View File

@@ -142,22 +142,29 @@ final class PhabricatorDirectoryMainController
$subnav->addFilter('all', 'All Activity', '/feed/'); $subnav->addFilter('all', 'All Activity', '/feed/');
$subnav->addFilter('projects', 'My Projects'); $subnav->addFilter('projects', 'My Projects');
$nav->appendChild($subnav);
$filter = $subnav->selectFilter($this->subfilter, 'all'); $filter = $subnav->selectFilter($this->subfilter, 'all');
switch ($filter) { switch ($filter) {
case 'all': case 'all':
$phids = array(); $view = $this->buildFeedView(array());
break; break;
case 'projects': case 'projects':
$phids = mpull($projects, 'getPHID'); if ($projects) {
$phids = mpull($projects, 'getPHID');
$view = $this->buildFeedView($phids);
} else {
$view = new AphrontErrorView();
$view->setSeverity(AphrontErrorView::SEVERITY_NODATA);
$view->setTitle('No Projects');
$view->appendChild('You have not joined any projects.');
}
break; break;
} }
$view = $this->buildFeedView($phids);
$subnav->appendChild($view); $subnav->appendChild($view);
$nav->appendChild($subnav);
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
$nav, $nav,
array( array(

View File

@@ -30,6 +30,7 @@ phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phabricator', 'infrastructure/javelin/api'); phutil_require_module('phabricator', 'infrastructure/javelin/api');
phutil_require_module('phabricator', 'infrastructure/javelin/markup'); phutil_require_module('phabricator', 'infrastructure/javelin/markup');
phutil_require_module('phabricator', 'view/form/error');
phutil_require_module('phabricator', 'view/layout/minipanel'); phutil_require_module('phabricator', 'view/layout/minipanel');
phutil_require_module('phabricator', 'view/layout/panel'); phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phabricator', 'view/layout/sidenavfilter'); phutil_require_module('phabricator', 'view/layout/sidenavfilter');