@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+27 -6
+27 -6
src/view/phui/PHUIPropertyListView.php
··· 109 109 require_celerity_resource('phui-property-list-view-css'); 110 110 111 111 $items = array(); 112 - foreach ($this->parts as $part) { 112 + 113 + $parts = $this->parts; 114 + 115 + // If we have an action list, make sure we render a property part, even 116 + // if there are no properties. Otherwise, the action list won't render. 117 + if ($this->actionList) { 118 + $have_property_part = false; 119 + foreach ($this->parts as $part) { 120 + if ($part['type'] == 'property') { 121 + $have_property_part = true; 122 + break; 123 + } 124 + } 125 + if (!$have_property_part) { 126 + $parts[] = array( 127 + 'type' => 'property', 128 + 'list' => array(), 129 + ); 130 + } 131 + } 132 + 133 + foreach ($parts as $part) { 113 134 $type = $part['type']; 114 135 switch ($type) { 115 136 case 'property': ··· 200 221 } 201 222 202 223 return phutil_tag( 203 - 'div', 204 - array( 205 - 'class' => 'phui-property-list-container grouped', 206 - ), 207 - array($action_list, $list)); 224 + 'div', 225 + array( 226 + 'class' => 'phui-property-list-container grouped', 227 + ), 228 + array($action_list, $list)); 208 229 } 209 230 210 231 private function renderSectionPart(array $part) {