Skip to content

Commit

Permalink
Merge branch 'main' into VACMS-15838-breadcrumbs-followup
Browse files Browse the repository at this point in the history
  • Loading branch information
tjheffner authored Oct 25, 2023
2 parents ab9515f + d38a023 commit 94399b0
Show file tree
Hide file tree
Showing 31 changed files with 665 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ datadog-setup.php
# web
# @TODO: Installer paths is not working. Leaving symlink for now.

# Ignore Next (next-build)
next

# Temporary .deb packages
*.deb

Expand Down
51 changes: 51 additions & 0 deletions .next/403-error-document.j2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!-- This is a Jinja2 template without a *.j2 extension because it isn't testable in a browser with *.j2. -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Next-build Preview not built yet</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="2" />

<style>
body {
/* VA.gov dark blue */
background: #112e51;
text-align: center;
color: white;
}

p {
font-size: large;
}

a {
text-decoration: underline;
color: white;
}

.hero {
margin-top: 25px;
width: 70%;
height: 20%;
object-fit: cover;
object-position: 0 80%;
}

.container-info {
margin-bottom: 100px;
}
</style>
</head>

<body>
<img class="hero" src="/.next/artur-pokusin-unsplash.jpg">
<h1>Next-build not ready yet</h1>
<div class="container-info">
<p>The next-build server is not built & running yet.</p>
<p>Check the status of the <code>composer va:next:start</code> command in the logs to learn more.</p>
</div>
<footer>Photo by <a href="https://unsplash.com/@arturpokusin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Artur Pokusin</a> on <a href="https://unsplash.com/s/photos/void?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
</footer>
</body>

</html>
51 changes: 51 additions & 0 deletions .next/503-error-document.j2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!-- This is a Jinja2 template without a *.j2 extension because it isn't testable in a browser with *.j2. -->
<html lang="en">
<head>
<meta charset="utf-8">
<title>Next-build Preview Server 503 Error</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="2" />

<style>
body {
/* VA.gov dark blue */
background: #112e51;
text-align: center;
color: white;
}

p {
font-size: large;
}

a {
text-decoration: underline;
color: white;
}

.hero {
margin-top: 25px;
width: 70%;
height: 20%;
object-fit: cover;
object-position: 0 80%;
}

.container-info {
margin-bottom: 100px;
}
</style>
</head>

<body>
<img class="hero" src="/.next/artur-pokusin-unsplash.jpg">
<h1>Next-build server 503 response</h1>
<div class="container-info">
<p>There was a 503 error returned from the next-build server when it asked for this route.</p>
<p>Check the status of the <code>composer va:next:start</code> command in the logs to learn more.</p>
</div>
<footer>Photo by <a href="https://unsplash.com/@arturpokusin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Artur Pokusin</a> on <a href="https://unsplash.com/s/photos/void?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
</footer>
</body>

</html>
1 change: 1 addition & 0 deletions .next/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See /.tugboat/vhost-next.conf.
Binary file added .next/artur-pokusin-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 13 additions & 2 deletions .tugboat/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
- cms
- web
- storybook
- next

# Set this as the default service. This does a few things
# 1. Clones the git repository into the service container
Expand Down Expand Up @@ -49,7 +50,7 @@ services:

# Install opcache, and Apache modules
- docker-php-ext-install opcache
- a2enmod headers rewrite vhost_alias
- a2enmod headers rewrite vhost_alias proxy proxy_http
# Install datadog agent for application tracing and profiling.
- DD_API_KEY=" " DD_INSTALL_ONLY=true DD_SITE="ddog-gov.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"

Expand All @@ -62,6 +63,9 @@ services:
# Setup storybook-*. vhost to serve static website.
- cp "${TUGBOAT_ROOT}"/.tugboat/vhost-storybook.conf /etc/apache2/sites-enabled/

# Setup next-*. vhost to serve static website.
- cp "${TUGBOAT_ROOT}"/.tugboat/vhost-next.conf /etc/apache2/sites-enabled/

# Configure KeepAliveTimeout in apache2.conf. This is set 5 seconds longer than the internal tools ALB.
# The internal tools ALB idle timeout is set to longer than a typical GQL query takes.
- sed -e 's/KeepAliveTimeout 5/KeepAliveTimeout 185/' -i /etc/apache2/apache2.conf
Expand Down Expand Up @@ -184,11 +188,14 @@ services:
# This command is shared by the clone and build stages, make sure to update both stages.
- j2 "${TUGBOAT_ROOT}/.web/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.web/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.storybook/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.storybook/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/503-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/503-error-document.html"
- composer install
- bash -lc 'nvm install'
- bash -lc 'npm install'
- bash -lc 'composer va:theme:compile'
- bash -lc 'composer va:web:install'
- bash -lc 'composer va:next:install'
# https://www.drush.org/latest/deploycommand/ (updatedb, cache:rebuild, config:import, deploy:hook)
- drush deploy

Expand All @@ -212,6 +219,8 @@ services:
# This command is shared by the clone and build stages, make sure to update both stages.
- j2 "${TUGBOAT_ROOT}/.web/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.web/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.storybook/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.storybook/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/503-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/503-error-document.html"

online:
# We only want tests running on PRs, not branches like the base preview build of main.
Expand All @@ -224,8 +233,10 @@ services:
- find -L "${DOCROOT}/vendor/va-gov/content-build/node_modules/.bin" -type f -exec chmod +x {} \+
- find "${DOCROOT}/vendor/va-gov/content-build/script" -type f -exec chmod +x {} \+

# Build storybook and the frontend in parallel
# Build storybook and the frontends in parallel
- bash -lc 'time task --taskfile=tugboat.yml'
# Build next build server
- bash -lc 'composer va:next:start'

memcache:
image: tugboatqa/memcached:1.6
Expand Down
48 changes: 48 additions & 0 deletions .tugboat/vhost-next.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# If testing changes to this file on the tugboatqa/php:7.1-apache image (current),
# use `apache2ctl -S` to check for syntax issues then `killall apache2` to get changes to take.
# Or "Stop" then "Start" the preview as that will restart apache2 too. Worth noting that
# `service apache2 reload|restart` doesn't work on this image as `runit` is used.
# Also `sv restart apache` acts like it works but it doesn't and doesn't bubble up any errors.

<VirtualHost *:80>

ServerName next-wildcard
# Route preview URLs with prefix of `next-` to folder where the generated site output is symlinked.
# e.g. https://next-msecydk1vl7ncmpkgh8vevjhzq25vacv.ci.cms.va.gov/
ServerAlias next-*
VirtualDocumentRoot /var/lib/tugboat/docroot/next/.next

Alias "/.next" "/var/lib/tugboat/.next"
ErrorDocument 403 /.next/403-error-document.html
ErrorDocument 503 /.next/503-error-document.html

<Directory /var/lib/tugboat/docroot/next/.next/>
Options FollowSymLinks
Require all granted
</Directory>

<Directory /var/lib/tugboat/.next/>
Require all granted
</Directory>

ProxyPreserveHost on
# Ignore redirecting error doc directory
ProxyPass /.next/ !
# Redirect requests to the running node server from next-build
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel debug

# On Tugboat these are symlinks to /dev/null by default.
# `rm /var/log/apache2/*.log` and they will be generated.
# Then `tail -f /var/log/apache2/*` will work.
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

SetEnvIf X-Forwarded-Proto "^https" HTTPS=on
</VirtualHost>
20 changes: 19 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@
"va:theme:watch": "Watch VA.gov Claro theme source and compile as needed.",
"va:web:build": "Perform a content build.",
"va:web:install": "Prepare the content-build project.",
"va:web:prepare-dotenv": "Prepare the ./web/.env file."
"va:web:prepare-dotenv": "Prepare the ./web/.env file.",
"va:next:install": "Prepare the next-build project",
"va:next:build": "Build the next-build server for preview",
"va:next:start": "Start the next-build server for preview"
},
"scripts": {
"pre-install-cmd": [
Expand Down Expand Up @@ -817,6 +820,21 @@
"# Prepare the ./web/.env file.",
"! ./scripts/should-run-directly.sh || ./scripts/web-prepare-dotenv.sh",
"./scripts/should-run-directly.sh || ddev composer va:web:prepare-dotenv --"
],
"va:next:install": [
"# Prepare the next build project",
"! ./scripts/should-run-directly.sh || ./scripts/next-install.sh",
"./scripts/should-run-directly.sh || ddev composer va:next:install --"
],
"va:next:build": [
"# Prepare the next build server",
"! ./scripts/should-run-directly.sh || ./scripts/next-build.sh",
"./scripts/should-run-directly.sh || ddev composer va:next:build --"
],
"va:next:start": [
"# Start the next build server",
"! ./scripts/should-run-directly.sh || ./scripts/next-start.sh",
"./scripts/should-run-directly.sh || ddev composer va:next:start --"
]
}
}
17 changes: 9 additions & 8 deletions config/sync/core.entity_form_display.node.q_a.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,25 +254,20 @@ content:
field_widget_replace: 0
open: 0
field_widget_display_settings: { }
additional_fields:
options: null
third_party_settings: { }
field_related_information:
type: paragraphs
type: entity_reference_paragraphs
weight: 7
region: content
settings:
title: 'Link teaser'
title_plural: 'Link teasers'
edit_mode: open
closed_mode: summary
autocollapse: none
closed_mode_threshold: 0
add_mode: dropdown
form_display_mode: default
default_paragraph_type: link_teaser
features:
add_above: '0'
collapse_edit_all: collapse_edit_all
duplicate: '0'
third_party_settings: { }
field_standalone_page:
type: boolean_checkbox
Expand Down Expand Up @@ -316,9 +311,15 @@ content:
maxlength: 70
counter_position: after
js_prevent_submit: true
count_only_mode: false
count_html_characters: false
textcount_status_message: 'Characters remaining: <span class="remaining_count">@remaining_count</span>'
third_party_settings: { }
translation:
weight: 10
region: content
settings: { }
third_party_settings: { }
url_redirects:
weight: 6
region: content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ dependencies:
- field.field.taxonomy_term.health_care_service_taxonomy.field_also_known_as
- field.field.taxonomy_term.health_care_service_taxonomy.field_commonly_treated_condition
- field.field.taxonomy_term.health_care_service_taxonomy.field_enforce_unique_combo_servi
- field.field.taxonomy_term.health_care_service_taxonomy.field_facility_service_descripti
- field.field.taxonomy_term.health_care_service_taxonomy.field_facility_service_header
- field.field.taxonomy_term.health_care_service_taxonomy.field_health_service_api_id
- field.field.taxonomy_term.health_care_service_taxonomy.field_online_self_service
- field.field.taxonomy_term.health_care_service_taxonomy.field_owner
- field.field.taxonomy_term.health_care_service_taxonomy.field_regional_service_descripti
- field.field.taxonomy_term.health_care_service_taxonomy.field_regional_service_header
- field.field.taxonomy_term.health_care_service_taxonomy.field_service_type_of_care
- field.field.taxonomy_term.health_care_service_taxonomy.field_show_for_vamc_facilities
- field.field.taxonomy_term.health_care_service_taxonomy.field_show_for_vba_facilities
Expand Down Expand Up @@ -99,6 +103,10 @@ third_party_settings:
- field_vba_friendly_name
- field_vba_com_conditions
- field_vba_service_descrip
- field_regional_service_header
- field_regional_service_descripti
- field_facility_service_header
- field_facility_service_descripti
- field_online_self_service
- field_vba_service_regions
label: VBA
Expand Down Expand Up @@ -165,6 +173,22 @@ content:
settings:
size: 1
third_party_settings: { }
field_facility_service_descripti:
type: string_textfield
weight: 15
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_facility_service_header:
type: string_textfield
weight: 14
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_health_service_api_id:
type: string_textfield
weight: 2
Expand All @@ -175,12 +199,28 @@ content:
third_party_settings: { }
field_online_self_service:
type: link_default
weight: 12
weight: 16
region: content
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
field_regional_service_descripti:
type: string_textfield
weight: 13
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_regional_service_header:
type: string_textfield
weight: 12
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_service_type_of_care:
type: options_select
weight: 15
Expand Down Expand Up @@ -249,7 +289,7 @@ content:
third_party_settings: { }
field_vba_service_regions:
type: entity_reference_autocomplete
weight: 13
weight: 17
region: content
settings:
match_operator: CONTAINS
Expand Down
Loading

0 comments on commit 94399b0

Please sign in to comment.