1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 05:42:40 +01:00

Don't hide action lists if there are no property list properties

Summary:
Fixes T5108. If we render a property list with no properties, it doesn't render anything. This hides any attached action list.

Instead, insert an empty property if we have an action list but no properties.

(This could use some cleanup eventually, but resolve the issue for now.)

Test Plan: Viewed a property list with actions but no properties; saw actions.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5108

Differential Revision: https://secure.phabricator.com/D9201
This commit is contained in:
epriestley 2014-05-19 12:40:30 -07:00
parent 3b7a781f12
commit edd8242008

View file

@ -109,7 +109,28 @@ final class PHUIPropertyListView extends AphrontView {
require_celerity_resource('phui-property-list-view-css');
$items = array();
$parts = $this->parts;
// If we have an action list, make sure we render a property part, even
// if there are no properties. Otherwise, the action list won't render.
if ($this->actionList) {
$have_property_part = false;
foreach ($this->parts as $part) {
if ($part['type'] == 'property') {
$have_property_part = true;
break;
}
}
if (!$have_property_part) {
$parts[] = array(
'type' => 'property',
'list' => array(),
);
}
}
foreach ($parts as $part) {
$type = $part['type'];
switch ($type) {
case 'property':