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

feat: add join.tts.gsa.gov redirects #256

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: "2"
volumes:
node-modules:
services:
Expand Down Expand Up @@ -100,3 +100,4 @@ services:
- app:product-guide.18f.gov
- app:methods.18f.gov
- app:identityequitystudy.gsa.gov
- app:join.tts.gsa.gov
19 changes: 19 additions & 0 deletions templates/_federalist-redirects.njk
Original file line number Diff line number Diff line change
Expand Up @@ -662,3 +662,22 @@ server {
return 301 https://www.gsa.gov/governmentwide-initiatives/diversity-equity-inclusion-and-accessibility/equity-study-on-remote-identity-proofing;
}
}

# join.tts.gsa.gov to tts.gsa.gov and handbook.tts.gsa.gov
server {
listen {{ PORT }};
server_name join.tts.gsa.gov;

location ~ ^/working-at-tts/?$ {
return 301 https://handbook.tts.gsa.gov/about-us/tts-history/;
}

location ~ ^/tts-offices/?$ {
return 301 https://handbook.tts.gsa.gov/#tts-offices;
}

location / {
return 301 https://tts.gsa.gov/join$request_uri;
}

}
1 change: 1 addition & 0 deletions templates/manifest-prod.yml.njk
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ routes:
- route: portfolios.18f.gov
- route: fac.gov
- route: identityequitystudy.gsa.gov
- route: join.tts.gsa.gov
{% for page in PAGE_CONFIGS -%}
- route: {{ page.to }}.{{ page.toDomain }}
{% endfor -%}
7 changes: 6 additions & 1 deletion test/integration/test_federalist_redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const expectedRedirects = [
{ from: 'partners.login.gov/state-and-local', to: 'www.login.gov/partners/state-and-local', redirectCode: 301, noPath: true },
{ from: 'design.login.gov', to: 'www.login.gov', redirectCode: 301, noPath: true },
{ from: 'usdigitalregistry.digitalgov.gov', to: 'touchpoints.app.cloud.gov/registry', redirectCode: 301, noPath: true },
{ from: 'join.tts.gsa.gov', to: 'tts.gsa.gov/join', redirectCode: 301 },
{ from: 'join.tts.gsa.gov/working-at-tts/', to: 'handbook.tts.gsa.gov/about-us/tts-history', redirectCode: 301, noPath: true },
{ from: 'join.tts.gsa.gov/tts-offices/', to: 'handbook.tts.gsa.gov/#tts-offices', redirectCode: 301, noPath: true },
];

function redirectOk(t, from, to, redirectCode) {
Expand All @@ -58,7 +61,9 @@ expectedRedirects.forEach((expected) => {
const redirectCode = expected.redirectCode || 302;

test(`redirects ${expected.from} to ${expected.to} (${redirectCode})`, (t) => {
redirectOk(t, expected.from, `${expected.to}/`, redirectCode);
// hashes don't have trailing slashes
const trailingSlash = expected.to.includes('#') ? '' : '/';
redirectOk(t, expected.from, `${expected.to}${trailingSlash}`, redirectCode);
});

if (!expected.noPath) {
Expand Down