mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 12:30:56 +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:
parent
3b7a781f12
commit
edd8242008
1 changed files with 27 additions and 6 deletions
|
@ -109,7 +109,28 @@ final class PHUIPropertyListView extends AphrontView {
|
|||
require_celerity_resource('phui-property-list-view-css');
|
||||
|
||||
$items = array();
|
||||
foreach ($this->parts as $part) {
|
||||
|
||||
$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':
|
||||
|
@ -200,11 +221,11 @@ final class PHUIPropertyListView extends AphrontView {
|
|||
}
|
||||
|
||||
return phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-property-list-container grouped',
|
||||
),
|
||||
array($action_list, $list));
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-property-list-container grouped',
|
||||
),
|
||||
array($action_list, $list));
|
||||
}
|
||||
|
||||
private function renderSectionPart(array $part) {
|
||||
|
|
Loading…
Reference in a new issue