NCIOCPL / cgov-digital-platform

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

Blog series can be deleted while it has posts #4341

Closed blairlearn closed 5 days ago

blairlearn commented 1 month ago

Issue description

Users are able to delete a blog series even if there are still posts that belong to it.

Steps to reproduce the issue

HINT: Perform these steps on a site with the the standard test content.

  1. Login as a user with the site_admin role.
  2. Archive all the posts in RAS blog.
  3. Go to the content view.
  4. Filter for the "Blog Series" content type.
  5. Click the down arrow next to the RAS blog's Edit button.

What's the expected result?

What's the actual result?

Acceptance Criteria

Scenario: A blog manager is editing a blog series that has posts that belong to the series
  Given a blog manager is logged into the CMS
    And is editing a blog series
    And the blog series has posts belonging to the series
    And the blog manager archives the the blog series
  When the blog manager scrolls to the bottom of the blog series editing page
  Then the 'Delete' button will not appear
Scenario: A blog manager is editing a blog series that has all posts archived
  Given a blog manager is logged into the CMS
    And is editing a blog series
    And the blog series has all posts belonging to the series archived
    And the blog manager archives the the blog series
  When the blog manager scrolls to the bottom of the blog series editing page
    Then the 'Delete' button will not appear
Scenario: A blog manager is editing a blog series that has NO posts associated with it ( all archived and deleted, or none added initially)
  Given a blog manager is logged into the CMS
    And is editing a blog series
    And the blog series has no posts belonging to the series
  When the blog manager scrolls to the bottom of the blog series editing page
    And the blog manager archives the the blog series
    Then the 'Delete' button will appear
    And the blog manager can delete the blog series by clicking the 'Delete' button

Additional details / screenshot

Related Tickets

alinai commented 3 weeks ago

@andyvanavery31 , can you please double check the AC and confirm that it is ok? It seems the "Expected Result" under "Steps to reproduce" is not in sync with AC. Currently on ODE 766, no matter blog posts exists under a Blog series or not, the "Delete" option does not appear. cc: @KateMashkinaNIH , @sarinapadilla

image

alinai commented 2 weeks ago

On ODE 766, I archived all Blog posts under "RAS Dialogue Blog" series according to the Steps to Reproduce and noticed that the "Delete" button does not appear under the down arrow next to the RAS blog's Edit button, The "Delete: button does not appear under the down arrow next to any Blog Series no matter the Blog Series has any Blog posts or not.

Then per AC, I archived the "RAS Dialogue Blog" series, still the the "Delete" button does not appear under the down arrow next to the RAS blog's Edit button.

blairlearn commented 2 weeks ago

The delete button should not appear for a blog series until all of the posts belonging to the series have been deleted.

When a blog post is archived, it still exists in the system and still belongs to the series. It should not be possible to manipulate the system in a manner that leaves a blog post without a series.

In the current system (as of June 10, 2024), it is possible to delete a blog series which still has blog posts assigned to it. This leaves the posts without a series.

alinai commented 2 weeks ago

Scenario: A blog manager is editing a blog series that has posts that belong to the series

image

alinai commented 2 weeks ago

Scenario: A blog manager is editing a blog series that has all posts archived

image

alinai commented 2 weeks ago

Scenario: A blog manager is editing a blog series that has NO posts associated with it ( all archived and deleted, or none added initially)

image

image

alinai commented 2 weeks ago

@andyvanavery31 , @sarinapadilla , @blairlearn , @kate-mashkina , For Spanish Blog series, for all 3 scenarios, a non-functional "Delete" button continue to appear on the archived Edit Spanish Blog Series page. The "Delete" button is non-functional means if we click it, the Blog Series is not deleted and user is returned to the Content View page and the Blog Series does not get deleted. The behavior that the "Delete" button is non-functional on blog Series pages is same as dev-ac. Please confirm if you are "ok" with the "Delete" button appearing on the Edit mode of Spanish Blog Series page for the Scenario#1 and Scenario#2. I have confirmed that the "Delete" button does NOT appear for Scenario#1 and Scenario#2 and DOES appear for Scenario#3 under the drop-down for Spanish Blog Series on the Content view page.

image

image

image

andyvanavery31 commented 1 week ago

Product accepts the exception in the Spanish behavior displaying the delete button when it should not. Subsequent ticket will be created to address it.

alinai commented 1 week ago

Created https://github.com/NCIOCPL/cgov-digital-platform/issues/4370 to address the "Delete" button appearing when Editing the Spanish Blog Series page on The CMS. cc: @andyvanavery31 , @blairlearn , @KateMashkinaNIH