Quicksand - make things work correctly with global drag and drop upload

Summary: Fixes T7685. This required making the global drag and drop behavior able to "uninstall" itself so to speak, and then it re-installs it self as necessary.

Test Plan:
Did the following all successfully

 - uploaded a file to homepage
 - homepage -> differential -- no way to upload via drag and drop
 - homepage -> differential -> homepage -- uploaded a file
 - homepage -> differential -> browser back button to homepage -- uploaded a file

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7685

Differential Revision: https://secure.phabricator.com/D12534
This commit is contained in:
Bob Trahan
2015-04-23 15:08:35 -07:00
parent cf154ae9f4
commit e40aa8f782
9 changed files with 179 additions and 87 deletions

View File

@@ -2,19 +2,18 @@
final class PhabricatorHomeMainController extends PhabricatorHomeController {
private $only;
private $minipanels = array();
public function shouldAllowPublic() {
return true;
}
public function willProcessRequest(array $data) {
$this->only = idx($data, 'only');
public function isGlobalDragAndDropUploadEnabled() {
return true;
}
public function processRequest() {
$user = $this->getRequest()->getUser();
public function handleRequest(AphrontRequest $request) {
$user = $request->getUser();
$dashboard = PhabricatorDashboardInstall::getDashboard(
$user,
@@ -42,7 +41,7 @@ final class PhabricatorHomeMainController extends PhabricatorHomeController {
$content = $this->buildMainResponse($projects);
}
if (!$this->only) {
if (!$request->getURIData('only')) {
$nav = $this->buildNav();
$nav->appendChild(
array(