mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-04 20:52:43 +01:00
6300955661
Summary: This gets us the ability to specify a "layout mode" and which column a panel should appear in at panel add time. Changing the layout mode from a multi column view to a single column view or vice versa will reset all panels to the left most column. You can also drag and drop where columns appear via the "arrange" mode. We also have a new dashboard create flow. Create dashboard -> arrange mode. (As opposed to view mode.) This could all possibly use massaging. Fixes T4996. Test Plan: made a dashboard with panels in multiple columns. verified correct widths for various layout modes re-arranged collumns like whoa. Reviewers: chad, epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T4996 Differential Revision: https://secure.phabricator.com/D9031
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
final class PhabricatorDashboardArrangeController
|
|
extends PhabricatorDashboardController {
|
|
|
|
private $id;
|
|
|
|
public function willProcessRequest(array $data) {
|
|
$this->id = $data['id'];
|
|
}
|
|
|
|
public function processRequest() {
|
|
$request = $this->getRequest();
|
|
$viewer = $request->getUser();
|
|
|
|
$dashboard = id(new PhabricatorDashboardQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($this->id))
|
|
->needPanels(true)
|
|
->requireCapabilities(
|
|
array(
|
|
PhabricatorPolicyCapability::CAN_VIEW,
|
|
PhabricatorPolicyCapability::CAN_EDIT,
|
|
))
|
|
->executeOne();
|
|
if (!$dashboard) {
|
|
return new Aphront404Response();
|
|
}
|
|
|
|
$title = $dashboard->getName();
|
|
$crumbs = $this->buildApplicationCrumbs();
|
|
$crumbs->addTextCrumb(
|
|
pht('Dashboard %d', $dashboard->getID()),
|
|
$this->getApplicationURI('view/'.$dashboard->getID().'/'));
|
|
$crumbs->addTextCrumb(pht('Arrange'));
|
|
|
|
$rendered_dashboard = id(new PhabricatorDashboardRenderingEngine())
|
|
->setViewer($viewer)
|
|
->setDashboard($dashboard)
|
|
->setArrangeMode(true)
|
|
->renderDashboard();
|
|
|
|
return $this->buildApplicationPage(
|
|
array(
|
|
$crumbs,
|
|
$rendered_dashboard,
|
|
),
|
|
array(
|
|
'title' => $title,
|
|
'device' => true,
|
|
));
|
|
}
|
|
|
|
}
|