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

LG-13880: Add confirmation success message (fallback method) #1434

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

jc-gsa
Copy link
Contributor

@jc-gsa jc-gsa commented Jan 23, 2025

🎫 Ticket

LG-13880

🛠 Summary of changes

Adds a success message to the contact form found at:

The above form does not use the same technique for submission found on a similar form at https://login.gov/partners/business-inquiries/ due to a lack over control over the setting Access-Control-Allow-Origin on Salesforce servers.

Note: Some vars are temporarily overridden for staging.

@jc-gsa jc-gsa force-pushed the LG-13880-add-confirmation-fallback branch from b85b7d1 to 70d50f1 Compare January 24, 2025 16:11
@jc-gsa jc-gsa requested a review from aduth February 12, 2025 17:44
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM, with suggestions 👍 Tested and works as expected

Comment on lines +423 to +424
<!-- Note: Temp hardcode env var !-->
<input type="hidden" name="retURL" value="https://federalist-17bd62cc-77b7-4687-9c62-39b462ce6fd5.sites.pages.cloud.gov/preview/gsa-tts/identity-site/LG-13880-add-confirmation-fallback{{ page.permalink | append: 'case-submitted/#success' }}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make these configurable values in _config.yml so that we can override them in the Cloud.gov Pages backend without risking human error of temporary code changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're expecting consistent keys across locales for this data, I think it'd be good to enhance our existing spec to check for consistency in the new file. Right now it only checks data/*/settings.yml.

keys = Dir['_data/*/settings.yml'].map { |path| [path, hash_keys(YAML.load_file(path))] }

Same with translations checker:

yaml = YAML.safe_load(File.read("#{folder}/en/settings.yml"))

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: I might suggest this be named to align to the page it's actually loaded on. Specifically, it's not loaded on the "Contact Us" page, but it is loaded on the case-submitted page.

@@ -0,0 +1,15 @@
---
permalink: /contact/case-submitted/
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we align the permalink with the filename? One is case-submitted and the other is contact-submitted

Comment on lines +63 to +93
describe 'English' do
let(:lang) { 'en' }

it 'includes permalink' do
expect(settings['permalink']).to eq('/contact/case-submitted/')
end
end

describe 'Spanish' do
let(:lang) { 'es' }

it 'includes permalink' do
expect(settings['permalink']).to eq('/es/contact/case-submitted/')
end
end

describe 'French' do
let(:lang) { 'fr' }

it 'includes permalink' do
expect(settings['permalink']).to eq('/fr/contact/case-submitted/')
end
end

describe 'Chinese' do
let(:lang) { 'zh' }

it 'includes permalink' do
expect(settings['permalink']).to eq('/zh/contact/case-submitted/')
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

To make this more maintainable to possible future language additions, maybe we should loop over the canonical source of truth for available locales rather than manually listing them out?

We do this elsewhere, e.g.

it 'has directories for each supported language' do
SITE_CONFIG['languages'].each do |locale|

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice helpers 🙌

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.

2 participants