1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Make drag-and-drop to upload files work on any Home dashboard, not just "Magic Home"

Summary: Ref T12174. Drag-and-drop-to-upload requires some stuff in the document. Put that stuff on all the content pages (currently: dashboards, magic home), not just the builtin home.

Test Plan:
  - Dragged-and-dropped onto a Home dashbboard to upload.
  - Viewed, and dragged-and-dropped onto "builtin home" to upload.
  - Dragged onto "Edit Menu" for home, no upload.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12174

Differential Revision: https://secure.phabricator.com/D17307
This commit is contained in:
epriestley 2017-02-03 09:20:17 -08:00
parent f54dfe7567
commit d054f87f93
3 changed files with 19 additions and 10 deletions

View file

@ -11,6 +11,24 @@ final class PhabricatorHomeProfileMenuEngine
return "/home/menu/{$path}";
}
protected function buildItemViewContent(
PhabricatorProfileMenuItemConfiguration $item) {
$viewer = $this->getViewer();
// Add content to the document so that you can drag-and-drop files onto
// the home page or any home dashboard to upload them.
$upload = id(new PhabricatorGlobalUploadTargetView())
->setUser($viewer);
$content = parent::buildItemViewContent($item);
return array(
$content,
$upload,
);
}
protected function getBuiltinProfileItems($object) {
$viewer = $this->getViewer();
$items = array();

View file

@ -12,15 +12,6 @@ final class PHUIHomeView
}
protected function getTagContent() {
$viewer = $this->getViewer();
return array(
$this->buildMainResponse(),
id(new PhabricatorGlobalUploadTargetView())->setUser($viewer),
);
}
private function buildMainResponse() {
require_celerity_resource('phabricator-dashboard-css');
$viewer = $this->getViewer();

View file

@ -685,7 +685,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->setURI($this->getConfigureURI());
}
private function buildItemViewContent(
protected function buildItemViewContent(
PhabricatorProfileMenuItemConfiguration $item) {
return $item->newPageContent();
}