1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

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:
epriestley 2016-01-23 17:14:26 -08:00
parent 8c25f0e7a2
commit 710fc0ce7f
2 changed files with 15 additions and 0 deletions

View file

@ -31,6 +31,7 @@ final class PhabricatorProjectProfileController
}
$properties = $this->buildPropertyListView($project);
$watch_action = $this->renderWatchAction($project);
$header->addActionLink($watch_action);
@ -119,6 +120,10 @@ final class PhabricatorProjectProfileController
PhabricatorCustomField::ROLE_VIEW);
$field_list->appendFieldsToPropertyList($project, $viewer, $view);
if ($view->isEmpty()) {
return null;
}
$view = id(new PHUIBoxView())
->setColor(PHUIBoxView::GREY)
->appendChild($view)

View file

@ -115,6 +115,16 @@ final class PHUIPropertyListView extends AphrontView {
$this->invokedWillRenderEvent = true;
}
public function isEmpty() {
$this->invokeWillRenderEvent();
if ($this->parts) {
return false;
}
return true;
}
public function render() {
$this->invokeWillRenderEvent();