Settings History

Summary:
Shows a timeline of all modified settings Fixes T6545
Will show all settings (no pagination, should be not so difficult to add if needed but most installs won't have hundreds of settings changes)
I'm not happy by how the PhabricatorConfigTransaction object is instructed to render the config keys but i don't see any other reasonable way.
We could always show the keys though.

Test Plan: Changed settings and called the history page

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6545

Differential Revision: https://secure.phabricator.com/D11088
This commit is contained in:
Fabian Stelzer
2015-01-01 06:51:44 -08:00
committed by epriestley
parent 1ff6972f7e
commit 86eb7c0ec4
6 changed files with 103 additions and 1 deletions

View File

@@ -0,0 +1,50 @@
<?php
final class PhabricatorConfigHistoryController
extends PhabricatorConfigController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$xactions = id(new PhabricatorConfigTransactionQuery())
->setViewer($user)
->needComments(true)
->setReversePaging(false)
->execute();
$object = new PhabricatorConfigEntry();
$xaction = $object->getApplicationTransactionTemplate();
$view = $xaction->getApplicationTransactionViewObject();
$timeline = $view
->setUser($user)
->setTransactions($xactions)
->setRenderAsFeed(true)
->setObjectPHID(PhabricatorPHIDConstants::PHID_VOID);
$timeline->setShouldTerminate(true);
$object->willRenderTimeline($timeline, $this->getRequest());
$title = pht('Settings History');
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb('Config', $this->getApplicationURI());
$crumbs->addTextCrumb($title, '/config/history/');
return $this->buildApplicationPage(
array(
$crumbs,
$timeline,
),
array(
'title' => $title,
));
}
}