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

Ntrnl 377 add environment variables to substitute reference to cabinet office or co words #64

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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ GITHUB_OWNER="test"
GITHUB_REPO_ISSUE_ASSIGNEE="test"
GITHUB_REPO_ISSUE_LABEL="test"
GITHUB_TERRAFORM_REPO="test"
DEPARTMENT_NAME ="Cabinet Office"
Copy link
Contributor

Choose a reason for hiding this comment

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

env vars are alphabetical

GITHUB_ORG_NAME ="cabinetoffice"
HUMAN="true"
LOG_LEVEL="info"
NODE_ENV="development"
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ services:
- GITHUB_REPO_ISSUE_ASSIGNEE=${GITHUB_REPO_ISSUE_ASSIGNEE}
- GITHUB_REPO_ISSUE_LABEL=${GITHUB_REPO_ISSUE_LABEL}
- GITHUB_TERRAFORM_REPO=${GITHUB_TERRAFORM_REPO}
- DEPARTMENT_NAME=${DEPARTMENT_NAME}
- GITHUB_ORG_NAME=${GITHUB_ORG_NAME}
- HUMAN=${HUMAN}
- LOG_LEVEL=${LOG_LEVEL}
- NODE_ENV=${NODE_ENV}
Expand Down
3 changes: 3 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { getEnvironmentValue } from '../utils/getEnvironmentValue';

export const SERVICE_NAME = 'GitHub Requests';

export const DEPARTMENT_NAME = getEnvironmentValue('DEPARTMENT_NAME');
export const GITHUB_ORG_NAME = getEnvironmentValue('GITHUB_ORG_NAME');

export const PATH_SSL_PRIVATE_KEY = getEnvironmentValue('PATH_SSL_PRIVATE_KEY', 'false');
export const PATH_SSL_CERTIFICATE = getEnvironmentValue('PATH_SSL_CERTIFICATE', 'false');

Expand Down
2 changes: 2 additions & 0 deletions src/config/nunjucks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export const configureNunjucks = (app: express.Application, viewsPath: string) =
nunjucksEnv.addGlobal('CDN_HOST', config.CDN_HOST);
nunjucksEnv.addGlobal('SERVICE_URL', config.SERVICE_URL);
nunjucksEnv.addGlobal('SERVICE_NAME', config.SERVICE_NAME);
nunjucksEnv.addGlobal('DEPARTMENT_NAME', config.DEPARTMENT_NAME);
nunjucksEnv.addGlobal('GITHUB_ORG_NAME', config.GITHUB_ORG_NAME);
};
2 changes: 1 addition & 1 deletion src/views/accessibility-statement.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2 class="govuk-heading-m" id="reporting">
</h2>

<p class="govuk-body">We’re always looking to improve the accessibility of this service. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, you can find contact details on our
<a class="govuk-link" href="#">contact page.</a> <!--Add link to contact us page when created. -->
<a class="govuk-link" href="/contact-us">contact page.</a>
</p>

<h2 class="govuk-heading-m" id="technical-information">
Expand Down
4 changes: 2 additions & 2 deletions src/views/add-member.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1 class="govuk-heading-l">Add a GitHub Member</h1>

<p class="govuk-body">
When a user requires access to our GitHub organisations (e.g they have joined The Cabinet Office) they should be added to the cabinetoffice GitHub organisation.
When a user requires access to our GitHub organisations (e.g they have joined {{ DEPARTMENT_NAME }}) they should be added to the {{ GITHUB_ORG_NAME }} GitHub organisation.
</p>

{% include "include/error-list.html" %}
Expand Down Expand Up @@ -50,7 +50,7 @@ <h1 class="govuk-heading-l">Add a GitHub Member</h1>
name: "contract_type",
fieldset: {
legend: {
text: "Is the GitHub account holder permanently employed within the CO orginsation?",
text: "Is the GitHub account holder permanently employed within the " + DEPARTMENT_NAME + " department?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/add-team-member.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1 class="govuk-heading-l">Add Member(s) to Team.</h1>

<p class="govuk-body">
When user(s) has access to our GitHub organisations and they wish to be added to a team within the cabinetoffice GitHub organisation.
When user(s) has access to our GitHub organisations and they wish to be added to a team within {{ GITHUB_ORG_NAME }} GitHub organisation.
</p>

{% include "include/error-list.html" %}
Expand Down
2 changes: 1 addition & 1 deletion src/views/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<h2 class="govuk-heading-m">What happens next</h2>

<p class="govuk-body">
We’ve sent your request to cabinetoffice internal developer platform.
We’ve sent your request to {{ GITHUB_ORG_NAME }} internal developer platform.
</p>
<p class="govuk-body">
They will contact you either to confirm your request, or to ask for more information.
Expand Down
2 changes: 2 additions & 0 deletions test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export default () => {
process.env.SESSION_APP_KEY = 'test';
process.env.GITHUB_KEY = 'key';
process.env.UNSANITISED_TEST_KEY = ' test ';
process.env.DEPARTMENT_NAME = 'Cabinet Office';
process.env.GITHUB_ORG_NAME = 'cabinetoffice';
};
Loading