Add draft support to ApplicationTransactions

Summary:
When previewing, save drafts. When loading objects, restore drafts if they are available.

Depends on: D665

Test Plan:
  - Viewed a Mock.
  - Typed text into the comment box.
  - Reloaded the page.
  - Text still there.
  - Hit submit, got my comment.
  - Reloaded the page.
  - Draft correctly deleted.
  - Repeated for Macros.

Reviewers: btrahan, chad, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4252
This commit is contained in:
epriestley
2012-12-21 05:57:14 -08:00
parent 0fd77783a4
commit b116861b16
11 changed files with 243 additions and 127 deletions

View File

@@ -353,7 +353,16 @@ final class AphrontRequest {
* @return dict<string, string> Original request parameters.
*/
public function getPassthroughRequestParameters() {
$data = self::flattenData($this->getRequestData());
return self::flattenData($this->getPassthruRequestData());
}
/**
* Get request data other than "magic" parameters.
*
* @return dict<string, wild> Request data, with magic filtered out.
*/
public function getPassthroughRequestData() {
$data = $this->getRequestData();
// Remove magic parameters like __dialog__ and __ajax__.
foreach ($data as $key => $value) {