Page MenuHomePhabricator

D9280.id22045.diff
No OneTemporary

D9280.id22045.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1467,6 +1467,7 @@
'PhabricatorDashboardController' => 'applications/dashboard/controller/PhabricatorDashboardController.php',
'PhabricatorDashboardDAO' => 'applications/dashboard/storage/PhabricatorDashboardDAO.php',
'PhabricatorDashboardEditController' => 'applications/dashboard/controller/PhabricatorDashboardEditController.php',
+ 'PhabricatorDashboardHistoryController' => 'applications/dashboard/controller/PhabricatorDashboardHistoryController.php',
'PhabricatorDashboardInstall' => 'applications/dashboard/storage/PhabricatorDashboardInstall.php',
'PhabricatorDashboardInstallController' => 'applications/dashboard/controller/PhabricatorDashboardInstallController.php',
'PhabricatorDashboardLayoutConfig' => 'applications/dashboard/layoutconfig/PhabricatorDashboardLayoutConfig.php',
@@ -4266,6 +4267,7 @@
'PhabricatorDashboardController' => 'PhabricatorController',
'PhabricatorDashboardDAO' => 'PhabricatorLiskDAO',
'PhabricatorDashboardEditController' => 'PhabricatorDashboardController',
+ 'PhabricatorDashboardHistoryController' => 'PhabricatorDashboardController',
'PhabricatorDashboardInstall' => 'PhabricatorDashboardDAO',
'PhabricatorDashboardInstallController' => 'PhabricatorDashboardController',
'PhabricatorDashboardListController' => 'PhabricatorDashboardController',
diff --git a/src/applications/dashboard/application/PhabricatorApplicationDashboard.php b/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
--- a/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
+++ b/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
@@ -22,6 +22,7 @@
=> 'PhabricatorDashboardListController',
'view/(?P<id>\d+)/' => 'PhabricatorDashboardViewController',
'manage/(?P<id>\d+)/' => 'PhabricatorDashboardManageController',
+ 'history/(?P<id>\d+)/' => 'PhabricatorDashboardHistoryController',
'create/' => 'PhabricatorDashboardEditController',
'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorDashboardEditController',
'install/(?P<id>\d+)/' => 'PhabricatorDashboardInstallController',
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php b/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
@@ -0,0 +1,68 @@
+<?php
+
+final class PhabricatorDashboardHistoryController
+ extends PhabricatorDashboardController {
+
+ private $id;
+
+ public function willProcessRequest(array $data) {
+ $this->id = $data['id'];
+ }
+
+ public function processRequest() {
+ $request = $this->getRequest();
+ $viewer = $request->getUser();
+ $id = $this->id;
+ $dashboard_view_uri = $this->getApplicationURI('view/'.$id.'/');
+ $dashboard_manage_uri = $this->getApplicationURI('manage/'.$id.'/');
+
+ $dashboard = id(new PhabricatorDashboardQuery())
+ ->setViewer($viewer)
+ ->withIDs(array($this->id))
+ ->executeOne();
+ if (!$dashboard) {
+ return new Aphront404Response();
+ }
+
+ $title = $dashboard->getName();
+
+ $crumbs = $this->buildApplicationCrumbs();
+ $crumbs->addTextCrumb(
+ pht('Dashboard %d', $dashboard->getID()),
+ $dashboard_view_uri);
+ $crumbs->addTextCrumb(
+ pht('Manage'),
+ $dashboard_manage_uri);
+ $crumbs->addTextCrumb(pht('History'));
+
+ $timeline = $this->buildTransactions($dashboard);
+
+ return $this->buildApplicationPage(
+ array(
+ $crumbs,
+ $timeline,
+ ),
+ array(
+ 'title' => $title,
+ 'device' => true,
+ ));
+ }
+
+ private function buildTransactions(PhabricatorDashboard $dashboard) {
+ $viewer = $this->getRequest()->getUser();
+
+ $xactions = id(new PhabricatorDashboardTransactionQuery())
+ ->setViewer($viewer)
+ ->withObjectPHIDs(array($dashboard->getPHID()))
+ ->execute();
+
+ $timeline = id(new PhabricatorApplicationTransactionView())
+ ->setUser($viewer)
+ ->setShouldTerminate(true)
+ ->setObjectPHID($dashboard->getPHID())
+ ->setTransactions($xactions);
+
+ return $timeline;
+ }
+
+}
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php b/src/applications/dashboard/controller/PhabricatorDashboardManageController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardManageController.php
@@ -35,7 +35,6 @@
$header = $this->buildHeaderView($dashboard);
$actions = $this->buildActionView($dashboard);
$properties = $this->buildPropertyView($dashboard);
- $timeline = $this->buildTransactions($dashboard);
$properties->setActionList($actions);
$box = id(new PHUIObjectBoxView())
@@ -52,7 +51,6 @@
array(
$crumbs,
$box,
- $timeline,
$rendered_dashboard,
),
array(
@@ -111,6 +109,12 @@
->setHref($this->getApplicationURI($href_install))
->setWorkflow(true));
+ $actions->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('View History'))
+ ->setIcon('fa-history')
+ ->setHref($this->getApplicationURI("history/{$id}/")));
+
return $actions;
}
@@ -138,24 +142,4 @@
return $properties;
}
-
- private function buildTransactions(PhabricatorDashboard $dashboard) {
- $viewer = $this->getRequest()->getUser();
-
- $xactions = id(new PhabricatorDashboardTransactionQuery())
- ->setViewer($viewer)
- ->withObjectPHIDs(array($dashboard->getPHID()))
- ->execute();
-
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($viewer);
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($viewer)
- ->setObjectPHID($dashboard->getPHID())
- ->setTransactions($xactions);
-
- return $timeline;
- }
-
}
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
@@ -47,14 +47,15 @@
$view = id(new PHUIBoxView())
->addMargin(PHUI::MARGIN_LARGE_LEFT)
->addMargin(PHUI::MARGIN_LARGE_RIGHT)
+ ->addMargin(PHUI::MARGIN_LARGE_TOP)
->appendChild($rendered_panel);
return $this->buildApplicationPage(
array(
$crumbs,
$box,
- $timeline,
$view,
+ $timeline,
),
array(
'title' => $title,
@@ -155,6 +156,7 @@
$timeline = id(new PhabricatorApplicationTransactionView())
->setUser($viewer)
+ ->setShouldTerminate(true)
->setObjectPHID($panel->getPHID())
->setTransactions($xactions);

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 6:34 AM (2 h, 57 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6726874
Default Alt Text
D9280.id22045.diff (7 KB)

Event Timeline