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-15791 next preview functionality #227

Merged
merged 6 commits into from
Nov 7, 2023
Merged

Conversation

tjheffner
Copy link
Contributor

@tjheffner tjheffner commented Nov 1, 2023

Description

Relates to #15791.

This PR puts some env vars in place for preview functionality. Existing routes should be unaffected, as they don't actually require authentication.

There is a companion PR on the CMS side: department-of-veterans-affairs/va.gov-cms#15936

This PR should merge first, so that these env vars are in place for when next-build is cloned & built in CMS tugboat envs. Then we can test the CMS PR properly.

This PR's additional functionality cannot be tested on this tugboat environment!
The CMS endpoint our tugboat hits by default doesn't have preview capability merged yet.
The CMS PR cannot be tested on its respective tugboat environment until this PR is merged and next can handle generating previews.

Testing done

Locally, with a local CMS endpoint using the branch above configured as described in the QA steps below.

I was successfully able to render previews for:

  • Published content ✅
  • new Draft content (never published) ✅
  • Draft revision of published content ✅

Also verified that existing pages generated as normal on this PR's tugboat environment.

QA steps

in next-build repo:

.env.local needs these environment variables with the correct values:

DRUPAL_CLIENT_ID=Retrieve this from AWS SSM /cms/consumers/next-build/client_id
DRUPAL_CLIENT_SECRET=Retrieve this from AWS SSM /cms/consumers/next-build/client_secret

afterwards, run yarn dev to start the webserver (yarn build:preview && yarn start also works, but yarn dev is fine)

in the va.gov-cms repo:

Store these keys in the repo root, outside of the docroot folder. If you are on the branch from the CMS PR specified above, these files will be .gitignored.

After the keys are in place, navigate to https://va-gov-cms.ddev.site/admin/config/services/next/entity-types and configure Story and Story Listing to use the preview server. You can leave the On-demand Validation settings blank for now.

Screenshot 2023-11-02 at 4 56 13 PM

All of the setup is now in place! These are intentionally not enabled in the CMS PR. They will be set in a follow-up PR focused on the UI experience (no iframe takeover, etc), and using feature flags.

Navigate to a Story Listing node ( https://va-gov-cms.ddev.site/erie-health-care/stories ) and see that the site loads in the iframe. There may be some CORS errors due to the iframe, these will be sorted out in a follow-up.

Navigate to a published Story node ( https://va-gov-cms.ddev.site/providence-health-care/stories/va-providence-veterans-day-observance ) and see that the site loads in the iframe.

Edit that story node with some new content and save it as a Draft. There should now be a "latest revision" tab ( https://va-gov-cms.ddev.site/node/62962/latest ), and the site should load in the iframe with the updated content.

Create a new Story node ( https://va-gov-cms.ddev.site/node/add/news_story ) and save it without publishing (Draft). The page should still render in the iframe.

Tasks

Preview Give feedback

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2023 16:55 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2023 17:05 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2023 17:10 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 1, 2023 19:46 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 2, 2023 22:42 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 2, 2023 23:26 Destroyed
@tjheffner tjheffner marked this pull request as ready for review November 2, 2023 23:40
@tjheffner tjheffner mentioned this pull request Nov 3, 2023
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 6, 2023 18:17 Destroyed
@tjheffner tjheffner merged commit 0b92746 into main Nov 7, 2023
3 checks passed
@tjheffner tjheffner deleted the VACMS-15791-next-preview branch November 7, 2023 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants