Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange Node View behavior for optional segments on CLP that have been enabled and then disabled #19165

Closed
13 tasks
davidmpickett opened this issue Sep 9, 2024 · 5 comments
Assignees
Labels
Campaign Landing Page Marketing campaign oriented, CMS-managed product owned by Public Websites team Defect Something isn't working (issue type) Drupal engineering CMS team practice area Public Websites Scrum team in the Sitewide crew sitewide UX debt Known issues with the user experience

Comments

@davidmpickett
Copy link
Contributor

davidmpickett commented Sep 9, 2024

Statuses

[2024-09-12] [Fran] Decision log added identifying Option 1 as the desired solution; AC added; moved to the bottom of Next Refinement.

Description

When sections are unchecked/disabled, clear out any text/values previously entered.

Background

This came up during Q&A for #18954 and was deemed out of scope.

Note that there are two distinct, but related related errors you might encounter while reproducing this issue

Reproduction steps

  1. Go to staging.cms.va.gov (or a Tugboat)
  2. Create a new Campaign Landing Page
    • Only fill in the required fields in the Hero banner, Why this matters, What you can do, and VA benefits sections
    • Save the node
    • Validate that the Node View matches the fields populated on Node Edit
  3. Edit the node and add an optional section
    • Enable one of the following optional sections, Video, Spotlight, Stories, Downloadable resources, Events, FAQs
    • Fill out required fields for the optional section
    • Save the node
    • Validate that the Node View updates with the new section
  4. Edit the node and disable the optional section
    • Uncheck the "Enable this page segment" box on the section you just added
    • Save the node
    • Notice that Node View still shows the content from the subfields of the section you disabled

Product-preferred solution path (previously: Option 1)

  • We should clear out any content entered the sub-fields (on Save?) if the enabled box is unchecked
  • Consider the Banner alert fieldset on VBA Facility content type. It clears out all content in sub-fields once the "Display a banner alert on this facility box" is unchecked and the node is saved.

Decision Log

Option 1 will be implemented, mimicking existing CMS functionality (e.g. Events).

Testing & QA

Scope / Impact analysis

What, if anything, could break as a result of this change?
Engineer should assess this when approaching PR.

Roles / assignments

After functional testing, code review, accessibility review, and design review can happen in parallel.

Acceptance Criteria

  • Editing a Campaign Landing Page that has one or more optional sections enabled (e.g. Video, Spotlight, Stories, Downloadable resources, Events, FAQsA) by unchecking an optional section results in clearing out the previously entered content (mimicking current behavior in CMS e.g. events)
  • Does this product have an existing regression test plan? No, regression test plan will be created as part of the work / points in this ticket
  • Accessibility review
@davidmpickett davidmpickett added Enhancement Issue type: New feature or request Needs refining Issue status Campaign Landing Page Marketing campaign oriented, CMS-managed product owned by Public Websites team Public Websites Scrum team in the Sitewide crew sitewide UX debt Known issues with the user experience labels Sep 9, 2024
@davidmpickett davidmpickett changed the title [Consider] Node View for optional segments on CLP that have been enable and then disabled [Consider] Node View for optional segments on CLP that have been enabled and then disabled Sep 9, 2024
@davidmpickett davidmpickett changed the title [Consider] Node View for optional segments on CLP that have been enabled and then disabled [Consider] Node View behavior for optional segments on CLP that have been enabled and then disabled Sep 9, 2024
@davidmpickett davidmpickett changed the title [Consider] Node View behavior for optional segments on CLP that have been enabled and then disabled Strange Node View behavior for optional segments on CLP that have been enabled and then disabled Sep 9, 2024
@FranECross
Copy link

@davidmpickett @dsasser I'm looking at the options and thinking #2 would be a good solution, IF we have situations where an editor might follow the following scenario when entering information: They enter information into a CLP that they want to publish right away, but info they enter into a sub-field they want to get further approval on. They uncheck the box so it doesn't display, but they don't want their information to be cleared out because when they get approval, they will then edit, uncheck the box so that it WILL display, and then republish. Thoughts on feasibility and effort?

@dsasser
Copy link
Contributor

dsasser commented Sep 12, 2024

In other areas of the CMS, Events for instance, we clear the data from fields that are hidden when making form selections.

They enter information into a CLP that they want to publish right away, but info they enter into a sub-field they want to get further approval on. They uncheck the box so it doesn't display, but they don't want their information to be cleared out because when they get approval, they will then edit, uncheck the box so that it WILL display, and then republish. Thoughts on feasibility and effort?

I would use a node revision in this case. Here the user would create the publish-able version and publish it. Then create a draft of the new changes that need approval.

In my opinion we should (always?) be clearing data when it is hidden dynamically.

@davidmpickett
Copy link
Contributor Author

I agree with @dsasser that option 1 / clearing out the data is generally the more robust/performant option with dynamically hidden fields. It prevents weird validation glitches like #19161. It's also an established pattern within the CMS so would be relatively straightforward to implement.

Option 2 would be a whole new paradigm and would in someways us fighting against the grain to accommodate a small, hypothetical use case

There's also Option 0, which is to leave it as is. This is not breaking any functionality, just leading to possible confusion.

@FranECross
Copy link

  • When creating a Campaign Landing Page with one or more optional sections enabled, and during creation an optional section is unchecked, the content is cleared out. (mimicking current behavior in CMS e.g. events)

@FranECross to create a spike to look at other fields and this ticket is restricted to this particular issue.

@jilladams jilladams added Defect Something isn't working (issue type) and removed Enhancement Issue type: New feature or request labels Nov 13, 2024
@dsasser
Copy link
Contributor

dsasser commented Nov 18, 2024

Findings

BLUF: This issue is a no-op.

As discussed in scrum, the issue with data from unselected panels/segments (video, spotlight, etc) appearing on Drupal node view pages is complex to resolve, mostly due to the nested paragraph situations we have in some segments. In order to resolve this on the Drupal side would take significant engineering effort. As a result, we determined that we should confirm if there were any controls on the FE that would prevent showing panel information for unselected panels. If such controls were in place, and there is no risk to exposing unwanted data to the FE, this issue would become a no-op.

On the FE, in content-build, the CLP templates all have a conditional check to determine if the panel/segment is enabled first before rendering any of the panel's fields. This results in preventing the unwanted data from appearing in unselected panels. Here are a few screenshots demonstrating the safety mechanisms:

Image
Image
Image
Image
Image
Image

@dsasser dsasser closed this as completed Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Campaign Landing Page Marketing campaign oriented, CMS-managed product owned by Public Websites team Defect Something isn't working (issue type) Drupal engineering CMS team practice area Public Websites Scrum team in the Sitewide crew sitewide UX debt Known issues with the user experience
Projects
None yet
Development

No branches or pull requests

4 participants