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,17 @@
final class PhabricatorFileListController extends PhabricatorFileController {
private $key;
public function shouldAllowPublic() {
return true;
}
public function willProcessRequest(array $data) {
$this->key = idx($data, 'key');
public function isGlobalDragAndDropUploadEnabled() {
return true;
}
public function processRequest() {
public function handleRequest(AphrontRequest $request) {
$controller = id(new PhabricatorApplicationSearchController())
->setQueryKey($this->key)
->setQueryKey($request->getURIData('key'))
->setSearchEngine(new PhabricatorFileSearchEngine())
->setNavigation($this->buildSideNavView());

View File

@@ -2,8 +2,11 @@
final class PhabricatorFileUploadController extends PhabricatorFileController {
public function processRequest() {
$request = $this->getRequest();
public function isGlobalDragAndDropUploadEnabled() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getUser();
$file = PhabricatorFile::initializeNewFile();