Don't render anything on project homepages if there are no properties at all
Summary: Ref T10054.
Test Plan:
{F1068420}
Also looked at a project which did have stuff to make sure the stuff still worked.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T10054
Differential Revision: https://secure.phabricator.com/D15102
This commit is contained in:
@@ -31,6 +31,7 @@ final class PhabricatorProjectProfileController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$properties = $this->buildPropertyListView($project);
|
$properties = $this->buildPropertyListView($project);
|
||||||
|
|
||||||
$watch_action = $this->renderWatchAction($project);
|
$watch_action = $this->renderWatchAction($project);
|
||||||
$header->addActionLink($watch_action);
|
$header->addActionLink($watch_action);
|
||||||
|
|
||||||
@@ -119,6 +120,10 @@ final class PhabricatorProjectProfileController
|
|||||||
PhabricatorCustomField::ROLE_VIEW);
|
PhabricatorCustomField::ROLE_VIEW);
|
||||||
$field_list->appendFieldsToPropertyList($project, $viewer, $view);
|
$field_list->appendFieldsToPropertyList($project, $viewer, $view);
|
||||||
|
|
||||||
|
if ($view->isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$view = id(new PHUIBoxView())
|
$view = id(new PHUIBoxView())
|
||||||
->setColor(PHUIBoxView::GREY)
|
->setColor(PHUIBoxView::GREY)
|
||||||
->appendChild($view)
|
->appendChild($view)
|
||||||
|
|||||||
@@ -115,6 +115,16 @@ final class PHUIPropertyListView extends AphrontView {
|
|||||||
$this->invokedWillRenderEvent = true;
|
$this->invokedWillRenderEvent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isEmpty() {
|
||||||
|
$this->invokeWillRenderEvent();
|
||||||
|
|
||||||
|
if ($this->parts) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function render() {
|
public function render() {
|
||||||
$this->invokeWillRenderEvent();
|
$this->invokeWillRenderEvent();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user