Add initial skeleton for Dashboard application
Summary:
Ref T3583. General idea here is:
- Users will be able to create `DashboardPanel`s, which are things like the jump nav, or a minifeed, or recent assigned tasks, or recent tokens given, or whatever else.
- The `DashboardPanel`s can be combined into `Dashboard`s, which select specific panels and arrange them in some layout (and maybe have a few other options eventually).
- Then, you'll be able to set a specific `Dashboard` for your home page, and maybe for project home pages. But you can also use `Dashboard`s on their own if you just like dashboards.
My plan is pretty much:
- Put in basic infrastructure for dashboards (this diff).
- Add basic create/edit (next few diffs).
- Once dashboards sort of work, do the homepage integration.
This diff does very little: you can't create dashboards or panels yet, and thus there are no dashboards to look at. This is all skeleton code, pretty much.
IMPORTANT: We need an icon bwahahahahaha
Test Plan:
omg si purrfect
{F106367}
Reviewers: chad, btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T3583
Differential Revision: https://secure.phabricator.com/D8109
2014-01-30 11:43:24 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
final class PhabricatorDashboardListController
|
|
|
|
|
extends PhabricatorDashboardController
|
|
|
|
|
implements PhabricatorApplicationSearchResultsControllerInterface {
|
|
|
|
|
|
|
|
|
|
private $queryKey;
|
|
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
|
$this->queryKey = idx($data, 'queryKey');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$controller = id(new PhabricatorApplicationSearchController($request))
|
|
|
|
|
->setQueryKey($this->queryKey)
|
|
|
|
|
->setSearchEngine(new PhabricatorDashboardSearchEngine())
|
|
|
|
|
->setNavigation($this->buildSideNavView());
|
|
|
|
|
return $this->delegateToController($controller);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function buildSideNavView() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
|
|
|
|
|
id(new PhabricatorDashboardSearchEngine())
|
|
|
|
|
->setViewer($user)
|
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
2014-04-30 14:28:20 -07:00
|
|
|
$nav->addLabel(pht('Panels'));
|
|
|
|
|
$nav->addFilter('panel/', pht('Manage Panels'));
|
|
|
|
|
|
Add initial skeleton for Dashboard application
Summary:
Ref T3583. General idea here is:
- Users will be able to create `DashboardPanel`s, which are things like the jump nav, or a minifeed, or recent assigned tasks, or recent tokens given, or whatever else.
- The `DashboardPanel`s can be combined into `Dashboard`s, which select specific panels and arrange them in some layout (and maybe have a few other options eventually).
- Then, you'll be able to set a specific `Dashboard` for your home page, and maybe for project home pages. But you can also use `Dashboard`s on their own if you just like dashboards.
My plan is pretty much:
- Put in basic infrastructure for dashboards (this diff).
- Add basic create/edit (next few diffs).
- Once dashboards sort of work, do the homepage integration.
This diff does very little: you can't create dashboards or panels yet, and thus there are no dashboards to look at. This is all skeleton code, pretty much.
IMPORTANT: We need an icon bwahahahahaha
Test Plan:
omg si purrfect
{F106367}
Reviewers: chad, btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T3583
Differential Revision: https://secure.phabricator.com/D8109
2014-01-30 11:43:24 -08:00
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-03 10:52:15 -08:00
|
|
|
public function buildApplicationCrumbs() {
|
|
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
|
|
|
|
|
|
$crumbs->addAction(
|
|
|
|
|
id(new PHUIListItemView())
|
|
|
|
|
->setIcon('create')
|
|
|
|
|
->setName(pht('Create Dashboard'))
|
|
|
|
|
->setHref($this->getApplicationURI().'create/'));
|
|
|
|
|
|
|
|
|
|
return $crumbs;
|
|
|
|
|
}
|
|
|
|
|
|
Add initial skeleton for Dashboard application
Summary:
Ref T3583. General idea here is:
- Users will be able to create `DashboardPanel`s, which are things like the jump nav, or a minifeed, or recent assigned tasks, or recent tokens given, or whatever else.
- The `DashboardPanel`s can be combined into `Dashboard`s, which select specific panels and arrange them in some layout (and maybe have a few other options eventually).
- Then, you'll be able to set a specific `Dashboard` for your home page, and maybe for project home pages. But you can also use `Dashboard`s on their own if you just like dashboards.
My plan is pretty much:
- Put in basic infrastructure for dashboards (this diff).
- Add basic create/edit (next few diffs).
- Once dashboards sort of work, do the homepage integration.
This diff does very little: you can't create dashboards or panels yet, and thus there are no dashboards to look at. This is all skeleton code, pretty much.
IMPORTANT: We need an icon bwahahahahaha
Test Plan:
omg si purrfect
{F106367}
Reviewers: chad, btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T3583
Differential Revision: https://secure.phabricator.com/D8109
2014-01-30 11:43:24 -08:00
|
|
|
public function renderResultsList(
|
|
|
|
|
array $dashboards,
|
|
|
|
|
PhabricatorSavedQuery $query) {
|
2014-02-03 10:52:15 -08:00
|
|
|
$viewer = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
|
|
$list = new PHUIObjectItemListView();
|
|
|
|
|
$list->setUser($viewer);
|
|
|
|
|
foreach ($dashboards as $dashboard) {
|
|
|
|
|
$id = $dashboard->getID();
|
|
|
|
|
|
|
|
|
|
$item = id(new PHUIObjectItemView())
|
|
|
|
|
->setObjectName(pht('Dashboard %d', $id))
|
|
|
|
|
->setHeader($dashboard->getName())
|
|
|
|
|
->setHref($this->getApplicationURI("view/{$id}/"))
|
|
|
|
|
->setObject($dashboard);
|
|
|
|
|
|
|
|
|
|
$list->addItem($item);
|
|
|
|
|
}
|
Add initial skeleton for Dashboard application
Summary:
Ref T3583. General idea here is:
- Users will be able to create `DashboardPanel`s, which are things like the jump nav, or a minifeed, or recent assigned tasks, or recent tokens given, or whatever else.
- The `DashboardPanel`s can be combined into `Dashboard`s, which select specific panels and arrange them in some layout (and maybe have a few other options eventually).
- Then, you'll be able to set a specific `Dashboard` for your home page, and maybe for project home pages. But you can also use `Dashboard`s on their own if you just like dashboards.
My plan is pretty much:
- Put in basic infrastructure for dashboards (this diff).
- Add basic create/edit (next few diffs).
- Once dashboards sort of work, do the homepage integration.
This diff does very little: you can't create dashboards or panels yet, and thus there are no dashboards to look at. This is all skeleton code, pretty much.
IMPORTANT: We need an icon bwahahahahaha
Test Plan:
omg si purrfect
{F106367}
Reviewers: chad, btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T3583
Differential Revision: https://secure.phabricator.com/D8109
2014-01-30 11:43:24 -08:00
|
|
|
|
2014-02-03 10:52:15 -08:00
|
|
|
return $list;
|
Add initial skeleton for Dashboard application
Summary:
Ref T3583. General idea here is:
- Users will be able to create `DashboardPanel`s, which are things like the jump nav, or a minifeed, or recent assigned tasks, or recent tokens given, or whatever else.
- The `DashboardPanel`s can be combined into `Dashboard`s, which select specific panels and arrange them in some layout (and maybe have a few other options eventually).
- Then, you'll be able to set a specific `Dashboard` for your home page, and maybe for project home pages. But you can also use `Dashboard`s on their own if you just like dashboards.
My plan is pretty much:
- Put in basic infrastructure for dashboards (this diff).
- Add basic create/edit (next few diffs).
- Once dashboards sort of work, do the homepage integration.
This diff does very little: you can't create dashboards or panels yet, and thus there are no dashboards to look at. This is all skeleton code, pretty much.
IMPORTANT: We need an icon bwahahahahaha
Test Plan:
omg si purrfect
{F106367}
Reviewers: chad, btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T3583
Differential Revision: https://secure.phabricator.com/D8109
2014-01-30 11:43:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|