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-9885 site previewer #16138

Merged
merged 14 commits into from
Nov 27, 2023
Merged

VACMS-9885 site previewer #16138

merged 14 commits into from
Nov 27, 2023

Conversation

tjheffner
Copy link
Contributor

@tjheffner tjheffner commented Nov 15, 2023

Description

Closes #9885. Closes #9891.

This PR creates a feature flag for next preview, some next entity types to enable preview, and refactors the existing preview button logic from va_gov_backend.module to an Event Subscriber inside of va_gov_preview.

Please note: the vets-website assets are not yet correctly symlinked in place for next-build on CMS tugboat (will be a separate PR), so preview pages generated by next-build may take a few seconds to load and appear missing those vets-website-based portions. This will be fixed in a following PR.

Testing done

Enabled the feature flag and then tested a combination of nodes to ensure that next preview worked when enabled and that existing preview logic remained unchanged:

Next preview:
Story:
https://va-gov-cms.ddev.site/butler-health-care/stories/this-suicide-prevention-month-the-butler-va-offers-veterans-support
Screenshot 2023-11-15 at 9 19 59 AM

Story (draft revision):
https://va-gov-cms.ddev.site/node/61531/latest
Screenshot 2023-11-15 at 9 19 52 AM

Existing preview:
VAMC detail page:
https://va-gov-cms.ddev.site/southern-nevada-health-care/work-with-us/internships-and-fellowships/nurse-practitioner-residency
Screenshot 2023-11-15 at 9 20 10 AM

No preview (excluded type):
Events list:
https://va-gov-cms.ddev.site/northport-health-care/events
Screenshot 2023-11-15 at 9 20 04 AM

QA steps

What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

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

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 15, 2023 17:23 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 15, 2023 17:28 Destroyed
@github-actions github-actions bot added Accelerated Publishing CMS Team CMS Product team that manages both editor exp and devops labels Nov 15, 2023
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 15, 2023 21:25 Destroyed
@tjheffner tjheffner marked this pull request as ready for review November 15, 2023 23:42
@tjheffner tjheffner requested review from a team November 15, 2023 23:44
@@ -0,0 +1,40 @@
<?php
Copy link
Contributor Author

@tjheffner tjheffner Nov 15, 2023

Choose a reason for hiding this comment

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

noting this plugin isn't actually used by the PreviewEventSubscriber, but it does provide an drastically-less-experience-altering alternative to the full-page iframe takeover of a node view page that the default plugin provided by drupal/next does.

next.settings.yml has been configured to use it by default, but it should realistically never render to a page in this manner, because we render buttons that handle both versions of preview ourselves in the PreviewEventSubscriber.

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.

Verified QA steps 🙂

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 20, 2023 16:57 Destroyed
timcosgrove

This comment was marked as duplicate.

@timcosgrove
Copy link
Contributor

This is approved; however, we are making a call to hold merging this until after the Thanksgiving holiday.

@ndouglas ndouglas marked this pull request as draft November 20, 2023 20:03
@timcosgrove timcosgrove marked this pull request as ready for review November 21, 2023 23:46
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 21, 2023 23:46 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 27, 2023 16:22 Destroyed
@tjheffner tjheffner enabled auto-merge (squash) November 27, 2023 16:22
@tjheffner tjheffner disabled auto-merge November 27, 2023 17:12
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 27, 2023 18:02 Destroyed
@tjheffner tjheffner merged commit aedc76c into main Nov 27, 2023
18 checks passed
@tjheffner tjheffner deleted the VACMS-9885-site-previewer branch November 27, 2023 20:22
tjheffner added a commit that referenced this pull request Dec 6, 2023
* move existing preview button logic to va_gov_preview and check feature flag for next preview

* modify page with event subscriber

* move existing preview behavior into event subscriber

* update preview event subscriber to generate next preview link

* export updated config for next

* consistent quote marks in services

* use correct var for nextPreviewEnabled

* inject all the dependencies

* use the correct request stack...

---------

Co-authored-by: Tim Cosgrove <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accelerated Publishing 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.

Next-drupal content type entities SitePreviewer plugin for Next.build preview
4 participants