Homec4science

Provide hasChildren() to replace isEmptyContent()

Authored by epriestley <git@epriestley.com> on Aug 12 2013, 16:51.

Description

Provide hasChildren() to replace isEmptyContent()

Summary:
Fixes T3698. Sometimes views need to render differently depending on whether they contain content or not. The existing approach for this is isEmptyContent(), which doesn't work well and is sort of hacky (it implies double-rendering content, which is not always free or side-effect free).

Instead, provide a test for an element without children. This test is powerful enough to catch the easy cases of null, etc., and just do the expected thing, but will not catch a View which is reduced upon rendering. Since this is rare and we have no actual need for it today, just accept that as a limitation.

Test Plan:
Viewed Timeline and Feed UI examples. Viewed Feed (feed), Pholio (timelineview), and Differential (old transactionview).

{F53915}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T3698

Differential Revision: https://secure.phabricator.com/D6718

Details

Committed
epriestley <git@epriestley.com>Aug 12 2013, 16:51
Pushed
aubortJan 31 2017, 17:16
Parents
rPH52225f7eb987: Fix bug with macros search being global.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH8ac2da9850b0: Provide hasChildren() to replace isEmptyContent() (authored by epriestley <git@epriestley.com>).Aug 12 2013, 16:51