mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +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:
parent
8c25f0e7a2
commit
710fc0ce7f
2 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue