NCIOCPL / cgov-digital-platform

The Cancer.gov Digital Communications Platform
GNU General Public License v2.0
11 stars 33 forks source link

If unpublished items are added to a published CTHP, they should not be visible to anonymous, non-logged in users #1739

Open lburack opened 5 years ago

lburack commented 5 years ago

If unpublished items (e.g., unpublished cancer research list page; unpublished video) are added to a (published) CTHP, users who are not logged into the CMS should not see the card (which links to an unpublished page).

How did I find this issue?

  1. I created a cancer research list page, but did not publish it. I also created a video, but did not publish it.
  2. I added the unpublished item(s) to a cancer type homepage. I published the CTHP.
  3. Being logged into the CMS, I'm able to view the video card and research card with its list of links. This is what users who are logged in should see.
  4. When I view the CTHP in incognito mode (a non-logged in user), I see the card title, but the card is empty. (see screenshot below)
Screen Shot 2019-05-16 at 12 41 43 PM

Screen Shot 2019-05-16 at 2 52 09 PM

daquinohd commented 5 years ago

This isn't technically a bug because the user needs to create and publish an empty card even if the referenced entity is not published.

If we don't want to display an empty heading, we need to go through each CTHP card type to figure out what the "required" fields are. Then, In the templates, only draw cards whose required fields have values.