2015-01-12 10:04:01 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
final class PhabricatorProjectViewController
|
|
|
|
|
extends PhabricatorProjectController {
|
|
|
|
|
|
|
|
|
|
public function shouldAllowPublic() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
|
$request = $this->getRequest();
|
2015-08-08 10:34:55 -07:00
|
|
|
$viewer = $request->getViewer();
|
2015-01-12 10:04:01 -08:00
|
|
|
|
2015-12-27 02:04:37 -08:00
|
|
|
$response = $this->loadProject();
|
|
|
|
|
if ($response) {
|
|
|
|
|
return $response;
|
2015-01-12 10:04:01 -08:00
|
|
|
}
|
2015-12-27 02:04:37 -08:00
|
|
|
$project = $this->getProject();
|
2015-01-12 10:04:01 -08:00
|
|
|
|
2016-12-11 09:00:44 -08:00
|
|
|
$engine = $this->getProfileMenuEngine();
|
2016-12-11 10:08:26 -08:00
|
|
|
$default = $engine->getDefaultItem();
|
2015-01-12 10:04:01 -08:00
|
|
|
|
2016-01-22 05:33:21 -08:00
|
|
|
switch ($default->getBuiltinKey()) {
|
2016-12-11 10:08:26 -08:00
|
|
|
case PhabricatorProject::ITEM_WORKBOARD:
|
2015-01-12 10:04:01 -08:00
|
|
|
$controller_object = new PhabricatorProjectBoardViewController();
|
|
|
|
|
break;
|
2016-12-11 10:08:26 -08:00
|
|
|
case PhabricatorProject::ITEM_PROFILE:
|
2015-01-12 10:04:01 -08:00
|
|
|
$controller_object = new PhabricatorProjectProfileController();
|
|
|
|
|
break;
|
Allow menu items to render their own content; make Dashboard items render on-page
Summary:
Ref T11957. When you click a dashboard item, it now sends you to `/<app>/item/view/123/`, which renders the proper crumbs, navigation, etc., with the dashboard as page content.
This works as you'd expect in Projects:
{F2508568}
It's sliiiightly odd in Favorites since we nuke the nav menu, but seems basically fine?
{F2508571}
Test Plan:
- Created a dashboard panel on a project.
- Clicked it, saw it render.
- Made it the default panel, viewed project default screen, saw dashboard.
- Disabled every panel I could, still saw reasonable behavior (this is silly anyway).
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T11957
Differential Revision: https://secure.phabricator.com/D17255
2017-01-26 12:14:02 -08:00
|
|
|
default:
|
|
|
|
|
return $engine->buildResponse();
|
2015-01-12 10:04:01 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $this->delegateToController($controller_object);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|