diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 25e9d125c..93d2868fc 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -42,7 +42,7 @@ jobs: # Certs added for the self hosted runner env: NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt - APP_ENV: gha + APP_ENV: test ports: - 80 volumes: diff --git a/envs/.env.dev b/envs/.env.dev index 77d7dc457..23dce881e 100644 --- a/envs/.env.dev +++ b/envs/.env.dev @@ -1,11 +1,19 @@ -# This is the standard lower environment for Content API. +# Domain for the CMS Content API NEXT_PUBLIC_DRUPAL_BASE_URL=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov + +# Domain for retrieving CMS images; likely unused NEXT_IMAGE_DOMAIN=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov -# Prod bucket for vets-website assets -# NEXT_PUBLIC_ASSETS_URL=https://prod-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/ -NEXT_PUBLIC_ASSETS_URL=/generated/ +# Standard VA.gov build type +NEXT_PUBLIC_BUILD_TYPE=vagovdev + +# Location to load vets-website assets +NEXT_PUBLIC_ASSETS_URL=https://dev-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/ + +# Domain for the static output SITE_URL=https://dev.va.gov + +# Domain for the static output; likely unused NEXT_PUBLIC_SITE_URL=https://dev.va.gov # for Drupal preview diff --git a/envs/.env.example b/envs/.env.example index 00f3f12cb..1dea8468f 100644 --- a/envs/.env.example +++ b/envs/.env.example @@ -1,30 +1,39 @@ -# This is the standard lower environment for Content API. +# Domain for the CMS Content API NEXT_PUBLIC_DRUPAL_BASE_URL=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov + +# Domain for retrieving CMS images; likely unused NEXT_IMAGE_DOMAIN=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov -# If running va.gov-cms locally +# If running va.gov-cms locally, comment the above out and uncomment the following. # NEXT_PUBLIC_DRUPAL_BASE_URL=https://va-gov-cms.ddev.site # NEXT_IMAGE_DOMAIN=https://va-gov-cms.ddev.site -# for Drupal preview -DRUPAL_PREVIEW_SECRET=secret -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 +# Standard VA.gov build type +NEXT_PUBLIC_BUILD_TYPE=localhost -# for local sitemap generation +# Location to load vets-website assets +NEXT_PUBLIC_ASSETS_URL=/generated/ + +# Domain for the static output SITE_URL=http://localhost:8001 + +# Domain for the static output; likely unused NEXT_PUBLIC_SITE_URL=http://localhost:8001 -# for local redis server -REDIS_URL=redis://127.0.0.1:6379 -# for local assets from vets-website -NEXT_PUBLIC_ASSETS_URL=/generated/ +# Drupal preview +DRUPAL_PREVIEW_SECRET=secret +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 -# Google Analytics (These are the dev environment credentials) +# Google Analytics +# These are the dev environment credentials. NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=GTM-WFJWBD NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=N9BisSDKAwJENFQtQIEvXQ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423 +# for local redis server +REDIS_URL=redis://127.0.0.1:6379 + # Configure the localhost port for the Next.js dev server PORT=3999 diff --git a/envs/.env.gha b/envs/.env.gha deleted file mode 100644 index bd94cb999..000000000 --- a/envs/.env.gha +++ /dev/null @@ -1,14 +0,0 @@ -# This is the standard lower environment for Content API. -NEXT_PUBLIC_DRUPAL_BASE_URL=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov -NEXT_IMAGE_DOMAIN=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov - -# for Drupal preview -DRUPAL_PREVIEW_SECRET=secret -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 - - -# Google Analytics (These are the dev environment credentials) -NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=GTM-WFJWBD -NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=N9BisSDKAwJENFQtQIEvXQ -NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423 diff --git a/envs/.env.prod b/envs/.env.prod index 03334a046..60dcb9d18 100644 --- a/envs/.env.prod +++ b/envs/.env.prod @@ -1,14 +1,22 @@ -# This is the standard lower environment for Content API. +# Domain for the CMS Content API NEXT_PUBLIC_DRUPAL_BASE_URL=https://prod.cms.va.gov + +# Domain for retrieving CMS images; likely unused NEXT_IMAGE_DOMAIN=https://prod.cms.va.gov -# Prod bucket for vets-website assets -# NEXT_PUBLIC_ASSETS_URL=https://prod-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/ -NEXT_PUBLIC_ASSETS_URL=/generated/ +# Standard VA.gov build type +NEXT_PUBLIC_BUILD_TYPE=vagovprod + +# Location to load vets-website assets +NEXT_PUBLIC_ASSETS_URL=https://prod-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/ + +# Domain for the static output SITE_URL=https://www.va.gov + +# Domain for the static output; likely unused NEXT_PUBLIC_SITE_URL=https://www.va.gov -# for Drupal preview +# Drupal preview DRUPAL_PREVIEW_SECRET=secret # store these securely in the build pipeline env #DRUPAL_CLIENT_ID=Retrieve this from AWS SSM /cms/consumers/next-build/client_id @@ -25,3 +33,5 @@ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-1 # For example, never add and enable a variable like the following to this file: # FEATURE_NEXT_BUILD_CONTENT_EVENT=true # Again, do NOT add these here. +FEATURE_NEXT_BUILD_CONTENT_EVENT_LISTING=true +FEATURE_NEXT_BUILD_CONTENT_EVENT=true diff --git a/envs/.env.staging b/envs/.env.staging index fc60dd8c5..48d4121e2 100644 --- a/envs/.env.staging +++ b/envs/.env.staging @@ -1,15 +1,26 @@ -# This is the standard lower environment for Content API. +# Domain for the CMS Content API NEXT_PUBLIC_DRUPAL_BASE_URL=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov + +# Domain for retrieving CMS images; likely unused NEXT_IMAGE_DOMAIN=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov -NEXT_PUBLIC_ASSETS_URL=/generated/ +# Standard VA.gov build type +NEXT_PUBLIC_BUILD_TYPE=vagovstaging + +# Location to load vets-website assets +NEXT_PUBLIC_ASSETS_URL=https://staging-va-gov-assets.s3-us-gov-west-1.amazonaws.com/generated/ + +# Domain for the static output SITE_URL=https://staging.va.gov -# for Drupal preview + +# Domain for the static output; likely unused +NEXT_PUBLIC_SITE_URL=https://staging.va.gov + +# Drupal preview DRUPAL_PREVIEW_SECRET=secret # store these securely in the build pipeline env #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 -NEXT_PUBLIC_SITE_URL=https://staging.va.gov # Google Analytics # These print directly to the page so do not need to store in SSM. diff --git a/envs/.env.test b/envs/.env.test index 578a40c1f..8a8c8e8ec 100644 --- a/envs/.env.test +++ b/envs/.env.test @@ -1,18 +1,23 @@ -# This is the standard lower environment for Content API. +# Domain for the CMS Content API NEXT_PUBLIC_DRUPAL_BASE_URL=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov + +# Domain for retrieving CMS images; likely unused NEXT_IMAGE_DOMAIN=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov -DRUPAL_PREVIEW_SECRET=secret -DRUPAL_CLIENT_ID=foo -DRUPAL_CLIENT_SECRET=bar -GOOGLE_TAG_MANAGER_AUTH= -GOOGLE_TAG_MANAGER_PREVIEW= -GOOGLE_TAG_MANAGER_ID= -# for cypress +# Domain for the static output SITE_URL=http://127.0.0.1:8001 + +# Domain for the static output; likely unused NEXT_PUBLIC_SITE_URL=http://127.0.0.1:8001 -# Configure the localhost port for the next.js dev server +# Drupal preview +# For testing these are only here to instantiate the Drupal client +# These are not secret or protected values. +DRUPAL_PREVIEW_SECRET=secret +DRUPAL_CLIENT_ID=clientId +DRUPAL_CLIENT_SECRET=clientSecret + +# Configure the localhost port for the Next.js dev server PORT=3999 # The Testing environment file list of flags should always match .env.tugboat's list. diff --git a/envs/.env.tugboat b/envs/.env.tugboat index 95f17100a..31a3f9039 100644 --- a/envs/.env.tugboat +++ b/envs/.env.tugboat @@ -1,23 +1,35 @@ +# Domain for the CMS Content API. NEXT_PUBLIC_DRUPAL_BASE_URL=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov + +# Domain for retrieving CMS images; likely unused. NEXT_IMAGE_DOMAIN=https://content-build-medc0xjkxm4jmpzxl3tfbcs7qcddsivh.ci.cms.va.gov -# Used for sitemap generation + Cypress tests +# Standard VA.gov build type +NEXT_PUBLIC_BUILD_TYPE=tugboat + +# Location to load vets-website assets. +NEXT_PUBLIC_ASSETS_URL=/generated/ + +# Domain for the static output. SITE_URL=${TUGBOAT_DEFAULT_SERVICE_URL} -# for connecting to a tugboat env's redis server -REDIS_URL=redis://redis:6379 +# Domain for the static output; likely unused. +NEXT_PUBLIC_SITE_URL=https://www.va.gov -# Where to source vets-website assets from -NEXT_PUBLIC_ASSETS_URL=/generated/ +# For Drupal preview +DRUPAL_PREVIEW_SECRET=secret +# DRUPAL_CLIENT_ID & DRUPAL_CLIENT_SECRET are made available through Tugboat UI settings. +#DRUPAL_CLIENT_ID=Managed in Tugboat UI. +#DRUPAL_CLIENT_SECRET=Managed in Tugboat UI. -# Google Analytics (These are the dev environment credentials) +# Google Analytics +# These are the dev environment credentials. NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=GTM-WFJWBD NEXT_PUBLIC_GOOGLE_TAG_MANAGER_AUTH=N9BisSDKAwJENFQtQIEvXQ NEXT_PUBLIC_GOOGLE_TAG_MANAGER_PREVIEW=env-423 -# For Drupal preview -DRUPAL_PREVIEW_SECRET=secret -# DRUPAL_CLIENT_ID & DRUPAL_CLIENT_SECRET are made available through Tugboat UI settings. +# for connecting to a tugboat env's redis server +REDIS_URL=redis://redis:6379 # Configure the localhost port for the Next.js server. This is used for Preview Servers on CMS Tugboats. https://tugboat.vfs.va.gov/5fd3b8ee7b4657022b5722d6 # Tugboat PR environments for next-build https://tugboat.vfs.va.gov/64d5537c2d3036648da7c7ff do not use this, as they build static files served via nginx. diff --git a/src/templates/common/mediaImage/index.tsx b/src/templates/common/mediaImage/index.tsx index e9746830c..cc992ac25 100644 --- a/src/templates/common/mediaImage/index.tsx +++ b/src/templates/common/mediaImage/index.tsx @@ -67,6 +67,7 @@ export const MediaImage = ( title={props.title} className={props.className} style={props.style} + loading={props.loading} /> ) } diff --git a/src/templates/layouts/event/index.tsx b/src/templates/layouts/event/index.tsx index 95aeb2bc8..05e3cccba 100644 --- a/src/templates/layouts/event/index.tsx +++ b/src/templates/layouts/event/index.tsx @@ -88,6 +88,7 @@ export const Event = ({ className="event-detail-img vads-u-margin-bottom--3 medium-screen:vads-u-margin-bottom--4" {...image} imageStyle="7_2_medium_thumbnail" + loading="eager" /> )} diff --git a/src/types/formatted/media.ts b/src/types/formatted/media.ts index 4b6912b14..b7808f713 100644 --- a/src/types/formatted/media.ts +++ b/src/types/formatted/media.ts @@ -17,6 +17,7 @@ export type MediaImage = { width: number height: number links: MediaImageLinks + loading?: 'eager' | 'lazy' } export type MediaVideo = {