Disambiguate isEmpty()
Summary: Fixes T10250. Rename the one I added to `hasAnyProperties()` for clarity. Test Plan: - Viewed a project profile with content. - Viewed a project profile with no properties. - Viewed a workboard with tasks that had a mixture of additional projects and no additional projects. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10250 Differential Revision: https://secure.phabricator.com/D15151
This commit is contained in:
@@ -112,7 +112,7 @@ final class PhabricatorPeopleProfileViewController
|
||||
PhabricatorCustomField::ROLE_VIEW);
|
||||
$field_list->appendFieldsToPropertyList($user, $viewer, $view);
|
||||
|
||||
if ($view->isEmpty()) {
|
||||
if (!$view->hasAnyProperties()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ final class PhabricatorProjectProfileController
|
||||
PhabricatorCustomField::ROLE_VIEW);
|
||||
$field_list->appendFieldsToPropertyList($project, $viewer, $view);
|
||||
|
||||
if ($view->isEmpty()) {
|
||||
if (!$view->hasAnyProperties()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,12 +86,11 @@ final class ProjectBoardTaskCard extends Phobject {
|
||||
$project_phids = array_fuse($task->getProjectPHIDs());
|
||||
unset($project_phids[$this->project->getPHID()]);
|
||||
|
||||
$handle_list = $viewer->loadHandles($project_phids);
|
||||
$tag_list = id(new PHUIHandleTagListView())
|
||||
->setSlim(true)
|
||||
->setHandles($handle_list);
|
||||
|
||||
if (!$tag_list->isEmpty()) {
|
||||
if ($project_phids) {
|
||||
$handle_list = $viewer->loadHandles($project_phids);
|
||||
$tag_list = id(new PHUIHandleTagListView())
|
||||
->setSlim(true)
|
||||
->setHandles($handle_list);
|
||||
$card->addAttribute($tag_list);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,10 +77,6 @@ abstract class AphrontTagView extends AphrontView {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
return empty($this->getTagContent());
|
||||
}
|
||||
|
||||
protected function getTagName() {
|
||||
return 'div';
|
||||
}
|
||||
|
||||
@@ -115,14 +115,14 @@ final class PHUIPropertyListView extends AphrontView {
|
||||
$this->invokedWillRenderEvent = true;
|
||||
}
|
||||
|
||||
public function isEmpty() {
|
||||
public function hasAnyProperties() {
|
||||
$this->invokeWillRenderEvent();
|
||||
|
||||
if ($this->parts) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
Reference in New Issue
Block a user