1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Allow users to add "ProfileMenu" items on mobile

Summary:
Depends on D20337. Fixes T12167. Ref T13272. On this page ("Favorites > Edit Favorites > Personal", for example) the curtain actions aren't available on mobile.

Normally, curtains are built with `Controller->newCurtainView()`, which sets an ID on the action list, which populates the header button. This curtain is built directly because there's no `Controller` handy.

To fix the issue, just set an ID. This could probably be cleaner, but that's likely a much more involved change.

Test Plan: Edited my favorites, narrowed the window, saw an "Actions" button.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13272, T12167

Differential Revision: https://secure.phabricator.com/D20338
This commit is contained in:
epriestley 2019-03-27 14:09:37 -07:00
parent 6648942bc8
commit 6bb9d3ac67

View file

@ -917,15 +917,16 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$list->addItem($view);
}
$action_view = id(new PhabricatorActionListView())
->setUser($viewer);
$item_types = PhabricatorProfileMenuItem::getAllMenuItems();
$object = $this->getProfileObject();
$action_list = id(new PhabricatorActionListView())
->setViewer($viewer);
// See T12167. This makes the "Actions" dropdown button show up in the
// page header.
$action_list->setID(celerity_generate_unique_node_id());
$action_list->addAction(
id(new PhabricatorActionView())
->setLabel(true)
@ -970,9 +971,6 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setObjectList($list);
$panel = id(new PHUICurtainPanelView())
->appendChild($action_view);
$curtain = id(new PHUICurtainView())
->setViewer($viewer)
->setActionList($action_list);