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

VACMS-13639: Fixes content lock operation on Reusable Q&A Content Type #15790

Conversation

tonytaylor
Copy link
Contributor

@tonytaylor tonytaylor commented Oct 23, 2023

Description

The root cause of the issue was the selected widget (Paragraphs(stable)) for the Related Information field. If no value is provided for this field, the form will be forced to re-render up to five times in an effort to resolve the field. The content lock module, however WILL NOT render its messages, unlock button, etc. after the first render attempt. Q&A Records that have a Related Information record present will properly render on the first pass and therefore, not subject to this issue. Changing the widget to Paragraphs Legacy allows for proper operation of the content lock module.

Closes #13639

Testing done

Performed manual testing on ~20 Q&A records w/o Related Information and ~20 Q&A records with it.
Confirmed the This content is now locked by... system message near top of page, as well as the Unlock button near the bottom.
Also, confirmed proper operation -- clicking unlock redirects to Lock Release form.

Screenshots

15637 (Missing Related Information)

VACMS-13639--20231023--1141
VACMS-13639--20231023--1142

47213 (Related Information Populated)

VACMS-13639--20231023--114230
VACMS-13639--20231023--1143

QA steps

What needs to be checked to prove this works?

Navigating to https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/NID/edit substituting NID with a value below should display similar to the screenshots above:

Q&A w/Related Information:
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15710/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15711/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15713/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15718/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15805/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15806/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15807/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15808/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15809/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15855/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15857/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15858/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16009/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16481/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16583/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16584/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16585/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16586/edit

Q&A w/o Related Information:
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15712/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15715/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15803/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15804/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15832/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/15856/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16482/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/16483/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/20486/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/20488/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23233/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23245/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23246/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23248/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23249/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23250/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23251/edit
https://pr15790-g7lgaqxdafmhidbxrj9fq9t1euwnh5tb.ci.cms.va.gov/node/23252/edit

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 23, 2023 17:21 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 23, 2023 17:26 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 23, 2023 17:29 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 23, 2023 17:32 Destroyed
@github-actions github-actions bot added the CMS Team CMS Product team that manages both editor exp and devops label Oct 23, 2023
Copy link
Contributor

@ndouglas ndouglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great detective work! Is this a known issue with Paragraphs?

Do we have any hooks that depend on this being a legacy paragraph?

I did a quick search and I didn't find any references to link_teaser paragraphs that seemed to depend on being a legacy paragraph, or that referred to a q_a node type and depended on being a legacy paragraph. I think this is safe.

Great work!

@jilladams jilladams requested a review from chri5tia October 24, 2023 15:08
@jilladams
Copy link
Contributor

@tonytaylor would like to have @chri5tia take a look at this pre-merge if you can afford to wait.

@tonytaylor
Copy link
Contributor Author

Thanks @ndouglas!

Not a paragraphs expert, but have found widgets to be occasionally fiddly in the past. I believe this is more of a configuration misstep + content lock quirks.

The Paragraphs(stable) widget may be a bit more eager than legacy, which has the form trying to render info that isn't needed in the form. The canary in the coalmine was experiencing form state mutations in debug sessions. I found content lock to do some fairly sus stuff with the one-time render (they have a bail-out clause if $form_state->userInput has data, which can happen if ajax changes the form structure), but at the end of the day, the other widget was actively attempting to transform the link/link_summary part of the form if it was missing, and the legacy widget allows sleeping dogs to lie.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 24, 2023 15:15 Destroyed
Copy link
Contributor

@chri5tia chri5tia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked view and modal when placing a reusable q&a and checked a single q&a, it all looks good.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 24, 2023 22:04 Destroyed
@tonytaylor tonytaylor merged commit ba2b98e into department-of-veterans-affairs:main Oct 24, 2023
14 checks passed
@tonytaylor tonytaylor deleted the VACMS-13639-fix-content-lock-on-q_a-records branch October 24, 2023 22:43
chri5tia pushed a commit that referenced this pull request Oct 25, 2023
#15790)

* Changes Q_A entity form display widget to 'Paragraphs Legacy' for 'Related Information' field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMS Team CMS Product team that manages both editor exp and devops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Q&A content type - Unlock button is disappearing on some nodes
5 participants