1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-02 15:38:18 +02:00

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('projects', 'My Projects');
$nav->appendChild($subnav);
$filter = $subnav->selectFilter($this->subfilter, 'all');
switch ($filter) {
case 'all':
$phids = array();
$view = $this->buildFeedView(array());
break;
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;
}
$view = $this->buildFeedView($phids);
$subnav->appendChild($view);
$nav->appendChild($subnav);
return $this->buildStandardPageResponse(
$nav,
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/javelin/api');
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/panel');
phutil_require_module('phabricator', 'view/layout/sidenavfilter');