mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 07:11:04 +01:00
Make Portals reachable without knowing the URI
Summary: Depends on D20360. Ref T13275. This makes the "Dashboards" application start on a Drydock-like console page where you pick portals, dashboards, or panels. Probably the "Dashboards" application should either be renamed to "IntelliknowledgePro" or Portals should be split off into a separate application eventually, but let's see how things go like this for now, since restructuring probably breaks some URIs at least a little bit so I'd like more confidence that we're headed in the right direction before we do it. Test Plan: - Visited Dashboards via typeahead, got options for Dashboards/Portals/Panels. - Visited Portals pages, got simplified crumbs. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13275 Differential Revision: https://secure.phabricator.com/D20361
This commit is contained in:
parent
c9d3fb2ac5
commit
18732a0d2f
6 changed files with 89 additions and 6 deletions
|
@ -2907,6 +2907,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorDashboardApplication' => 'applications/dashboard/application/PhabricatorDashboardApplication.php',
|
'PhabricatorDashboardApplication' => 'applications/dashboard/application/PhabricatorDashboardApplication.php',
|
||||||
'PhabricatorDashboardArchiveController' => 'applications/dashboard/controller/PhabricatorDashboardArchiveController.php',
|
'PhabricatorDashboardArchiveController' => 'applications/dashboard/controller/PhabricatorDashboardArchiveController.php',
|
||||||
'PhabricatorDashboardArrangeController' => 'applications/dashboard/controller/PhabricatorDashboardArrangeController.php',
|
'PhabricatorDashboardArrangeController' => 'applications/dashboard/controller/PhabricatorDashboardArrangeController.php',
|
||||||
|
'PhabricatorDashboardConsoleController' => 'applications/dashboard/controller/PhabricatorDashboardConsoleController.php',
|
||||||
'PhabricatorDashboardController' => 'applications/dashboard/controller/PhabricatorDashboardController.php',
|
'PhabricatorDashboardController' => 'applications/dashboard/controller/PhabricatorDashboardController.php',
|
||||||
'PhabricatorDashboardDAO' => 'applications/dashboard/storage/PhabricatorDashboardDAO.php',
|
'PhabricatorDashboardDAO' => 'applications/dashboard/storage/PhabricatorDashboardDAO.php',
|
||||||
'PhabricatorDashboardDashboardHasPanelEdgeType' => 'applications/dashboard/edge/PhabricatorDashboardDashboardHasPanelEdgeType.php',
|
'PhabricatorDashboardDashboardHasPanelEdgeType' => 'applications/dashboard/edge/PhabricatorDashboardDashboardHasPanelEdgeType.php',
|
||||||
|
@ -8867,6 +8868,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorDashboardApplication' => 'PhabricatorApplication',
|
'PhabricatorDashboardApplication' => 'PhabricatorApplication',
|
||||||
'PhabricatorDashboardArchiveController' => 'PhabricatorDashboardController',
|
'PhabricatorDashboardArchiveController' => 'PhabricatorDashboardController',
|
||||||
'PhabricatorDashboardArrangeController' => 'PhabricatorDashboardProfileController',
|
'PhabricatorDashboardArrangeController' => 'PhabricatorDashboardProfileController',
|
||||||
|
'PhabricatorDashboardConsoleController' => 'PhabricatorDashboardController',
|
||||||
'PhabricatorDashboardController' => 'PhabricatorController',
|
'PhabricatorDashboardController' => 'PhabricatorController',
|
||||||
'PhabricatorDashboardDAO' => 'PhabricatorLiskDAO',
|
'PhabricatorDashboardDAO' => 'PhabricatorLiskDAO',
|
||||||
'PhabricatorDashboardDashboardHasPanelEdgeType' => 'PhabricatorEdgeType',
|
'PhabricatorDashboardDashboardHasPanelEdgeType' => 'PhabricatorEdgeType',
|
||||||
|
|
|
@ -10,6 +10,10 @@ final class PhabricatorDashboardApplication extends PhabricatorApplication {
|
||||||
return '/dashboard/';
|
return '/dashboard/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTypeaheadURI() {
|
||||||
|
return '/dashboard/console/';
|
||||||
|
}
|
||||||
|
|
||||||
public function getShortDescription() {
|
public function getShortDescription() {
|
||||||
return pht('Create Custom Pages');
|
return pht('Create Custom Pages');
|
||||||
}
|
}
|
||||||
|
@ -42,6 +46,7 @@ final class PhabricatorDashboardApplication extends PhabricatorApplication {
|
||||||
'create/' => 'PhabricatorDashboardEditController',
|
'create/' => 'PhabricatorDashboardEditController',
|
||||||
'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorDashboardEditController',
|
'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorDashboardEditController',
|
||||||
'install/(?:(?P<id>\d+)/)?' => 'PhabricatorDashboardInstallController',
|
'install/(?:(?P<id>\d+)/)?' => 'PhabricatorDashboardInstallController',
|
||||||
|
'console/' => 'PhabricatorDashboardConsoleController',
|
||||||
'addpanel/(?P<id>\d+)/' => 'PhabricatorDashboardAddPanelController',
|
'addpanel/(?P<id>\d+)/' => 'PhabricatorDashboardAddPanelController',
|
||||||
'movepanel/(?P<id>\d+)/' => 'PhabricatorDashboardMovePanelController',
|
'movepanel/(?P<id>\d+)/' => 'PhabricatorDashboardMovePanelController',
|
||||||
'removepanel/(?P<id>\d+)/'
|
'removepanel/(?P<id>\d+)/'
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class PhabricatorDashboardConsoleController
|
||||||
|
extends PhabricatorDashboardController {
|
||||||
|
|
||||||
|
public function shouldAllowPublic() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
$viewer = $request->getViewer();
|
||||||
|
|
||||||
|
$menu = id(new PHUIObjectItemListView())
|
||||||
|
->setUser($viewer)
|
||||||
|
->setBig(true);
|
||||||
|
|
||||||
|
$menu->addItem(
|
||||||
|
id(new PHUIObjectItemView())
|
||||||
|
->setHeader(pht('Portals'))
|
||||||
|
->setImageIcon('fa-compass')
|
||||||
|
->setHref('/portal/')
|
||||||
|
->setClickable(true)
|
||||||
|
->addAttribute(
|
||||||
|
pht(
|
||||||
|
'Portals are collections of dashboards, links, and other '.
|
||||||
|
'resources that can provide a high-level overview of a '.
|
||||||
|
'project.')));
|
||||||
|
|
||||||
|
$menu->addItem(
|
||||||
|
id(new PHUIObjectItemView())
|
||||||
|
->setHeader(pht('Dashboards'))
|
||||||
|
->setImageIcon('fa-dashboard')
|
||||||
|
->setHref($this->getApplicationURI('/'))
|
||||||
|
->setClickable(true)
|
||||||
|
->addAttribute(
|
||||||
|
pht(
|
||||||
|
'Dashboards organize panels, creating a cohesive page for '.
|
||||||
|
'analysis or action.')));
|
||||||
|
|
||||||
|
$menu->addItem(
|
||||||
|
id(new PHUIObjectItemView())
|
||||||
|
->setHeader(pht('Panels'))
|
||||||
|
->setImageIcon('fa-line-chart')
|
||||||
|
->setHref($this->getApplicationURI('panel/'))
|
||||||
|
->setClickable(true)
|
||||||
|
->addAttribute(
|
||||||
|
pht(
|
||||||
|
'Panels show queries, charts, and other information to provide '.
|
||||||
|
'insight on a particular topic.')));
|
||||||
|
|
||||||
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
|
$crumbs->addTextCrumb(pht('Console'));
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
|
$title = pht('Dashboard Console');
|
||||||
|
|
||||||
|
$box = id(new PHUIObjectBoxView())
|
||||||
|
->setHeaderText($title)
|
||||||
|
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
|
||||||
|
->setObjectList($menu);
|
||||||
|
|
||||||
|
$view = id(new PHUITwoColumnView())
|
||||||
|
->setFixed(true)
|
||||||
|
->setFooter($box);
|
||||||
|
|
||||||
|
return $this->newPage()
|
||||||
|
->setTitle($title)
|
||||||
|
->setCrumbs($crumbs)
|
||||||
|
->appendChild($view);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -28,9 +28,6 @@ final class PhabricatorDashboardListController
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->addNavigationItems($nav->getMenu());
|
->addNavigationItems($nav->getMenu());
|
||||||
|
|
||||||
$nav->addLabel(pht('Panels'));
|
|
||||||
$nav->addFilter('panel/', pht('Manage Panels'));
|
|
||||||
|
|
||||||
$nav->selectFilter(null);
|
$nav->selectFilter(null);
|
||||||
|
|
||||||
return $nav;
|
return $nav;
|
||||||
|
|
|
@ -4,9 +4,13 @@ abstract class PhabricatorDashboardPortalController
|
||||||
extends PhabricatorDashboardController {
|
extends PhabricatorDashboardController {
|
||||||
|
|
||||||
protected function buildApplicationCrumbs() {
|
protected function buildApplicationCrumbs() {
|
||||||
$crumbs = parent::buildApplicationCrumbs();
|
$crumbs = new PHUICrumbsView();
|
||||||
|
|
||||||
$crumbs->addTextCrumb(pht('Portals'), '/portal/');
|
$crumbs->addCrumb(
|
||||||
|
id(new PHUICrumbView())
|
||||||
|
->setHref('/portal/')
|
||||||
|
->setName(pht('Portals'))
|
||||||
|
->setIcon('fa-compass'));
|
||||||
|
|
||||||
return $crumbs;
|
return $crumbs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -872,7 +872,10 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView
|
||||||
// mobile navigation menu from.
|
// mobile navigation menu from.
|
||||||
$application_menu = $controller->buildApplicationMenu();
|
$application_menu = $controller->buildApplicationMenu();
|
||||||
if (!$application_menu) {
|
if (!$application_menu) {
|
||||||
$application_menu = $this->getNavigation()->getMenu();
|
$navigation = $this->getNavigation();
|
||||||
|
if ($navigation) {
|
||||||
|
$application_menu = $navigation->getMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->applicationMenu = $application_menu;
|
$this->applicationMenu = $application_menu;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue