Skip to content

Commit

Permalink
merge branch 'main' into NTRNL-347-add-collaborator-per-repo-page
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMurray97 committed Mar 26, 2024
1 parent 5b016d9 commit 4e862c1
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 91 deletions.
42 changes: 16 additions & 26 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
PATH_SSL_PRIVATE_KEY="./infrastructure/host/test.key"
PATH_SSL_CERTIFICATE="./infrastructure/host/test.cert"

PORT=3000
NODE_ENV=development

AUTH_SIGN_IN_URL="https://cola.service.cabinetoffice.gov.uk/v2/<TEST>/login"
BASE_URL="http://localhost:3000"
CDN_HOST="test"
NODE_SSL_ENABLED="false"

COOKIE_ID_NAME="github-requests"
COOKIE_PARSER_SECRET="test"
COOKIE_SESSION_SECRET="test"

AUTH_SIGN_IN_URL="https://cola.service.cabinetoffice.gov.uk/v2/<TEST>/login"

USER_POOL_ID="test"
USER_POOL_CLIENT_ID="test"

COOKIE_ID_NAME="test"
SESSION_ID_NAME="test"
SESSION_APP_KEY="test"

FEATURE_FLAG_ENABLE_AUTH="true"
GITHUB_KEY="test"
GITHUB_OWNER="test"
GITHUB_TERRAFORM_REPO="test"
GITHUB_REPO_ISSUE_ASSIGNEE="test"
GITHUB_REPO_ISSUE_LABEL="test"

LOG_LEVEL=info
HUMAN=true

# Feature Flags

FEATURE_FLAG_ENABLE_AUTH="false"
GITHUB_TERRAFORM_REPO="test"
HUMAN="true"
LOG_LEVEL="info"
NODE_ENV="development"
NODE_SSL_ENABLED="false"
PATH_SSL_CERTIFICATE="./infrastructure/host/test.key"
PATH_SSL_PRIVATE_KEY="./infrastructure/host/test.cert"
PORT=3000
SESSION_APP_KEY="git"
SESSION_ID_NAME="connect.sid"
USER_POOL_CLIENT_ID="test"
USER_POOL_ID="test"
64 changes: 40 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,32 @@ The issue is then reviewed by the team, and further comments may be requested if

### Config variables

Key | Description | Example Value
----------------|--------------------------- |-------------------------
PATH_SSL_PRIVATE_KEY | Path to ssl private key | `./infrastructure/host/test.key`
PATH_SSL_CERTIFICATE | Path to ssl certificate | `./infrastructure/host/test.cert`
BASE_URL | Base application URL | `http://localhost:3000` (dev mode)
NODE_ENV | Node environment | `development` (or `production`)
PORT | Server port number | `3000`
CDN_HOST | CDN host | `cdn domain`
USER_POOL_ID | ID of the user pool in Amazon Cognito | `secret`
USER_POOL_CLIENT_ID | Client ID of an app registered with the user pool in Amazon Cognito | `secret`
AUTH_SIGN_IN_URL | Authentication sign in URL | `https://cola.service.cabinetoffice.gov.uk/v2/<YOUR_SERVICE>/login`
COOKIE_ID_NAME | The name of the cookie | `github-requests`
COOKIE_PARSER_SECRET | Secret used in validating/calculating the cookie signature | `secret`
COOKIE_SESSION_SECRET | Secret key for signing the session cookie | `secret`
LANDING_PAGE_URL | Github Requests landing Page | `/home/`
GITHUB_OWNER | Github organization name | `cabinetoffice`
GITHUB_TERRAFORM_REPO | Github private repo with terraform configurations with members, repos and teams files | `github-requests-terraform`
GITHUB_REPO_ISSUE_ASSIGNEE | Github team responsible to solve issues and update configs files | (eg. `IDP_TEAM`)
GITHUB_REPO_ISSUE_LABEL | Github label to categorize the related issues | (eg. `github-requests-app`)
LOG_LEVEL | Logging levels | `info`
HUMAN | Formatting messages form (default JSON) | `true` (Enable human formatting for log messages)
| Key | Description | Example Value |
|-----------------------------|---------------------------------------------------------------------|---------------------------------------------------------- |
| AUTH_SIGN_IN_URL | Authentication sign in URL | `https://cola.service.cabinetoffice.gov.uk/v2/<YOUR_SERVICE>/login`|
| BASE_URL | Base application URL | `http://localhost:3000` (dev mode) |
| CDN_HOST | CDN host | `cdn_domain` |
| COOKIE_ID_NAME | The name of the cookie | `github-requests` |
| COOKIE_PARSER_SECRET | Secret used in validating/calculating the cookie signature | `secret` |
| COOKIE_SESSION_SECRET | Secret key for signing the session cookie | `secret` |
| FEATURE_FLAG_ENABLE_AUTH | Enable authentication feature flag | `true` or `false` |
| GITHUB_KEY | GitHub key | `[github key]` |
| GITHUB_OWNER | GitHub organisation name | `cabinetoffice` |
| GITHUB_REPO_ISSUE_ASSIGNEE | GitHub team responsible to solve issues and update configs files | `IDP_TEAM` |
| GITHUB_REPO_ISSUE_LABEL | GitHub label to categorize the related issues | `github-requests-app` |
| GITHUB_TERRAFORM_REPO | GitHub private repo with terraform configurations with members, repos and teams files | `github-requests-terraform` |
| HUMAN | Formatting messages form (default JSON) | `true` (Enable human formatting for log messages) |
| LOG_LEVEL | Logging levels | `info` |
| NODE_ENV | Node environment | `development` or `production` |
| NODE_SSL_ENABLED | Whether SSL is enabled for Node | `true` or `false` |
| PATH_SSL_CERTIFICATE | Path to SSL certificate | `./infrastructure/host/test.cert` |
| PATH_SSL_PRIVATE_KEY | Path to SSL private key | `./infrastructure/host/test.key` |
| PORT | Server port number | `3000` |
| SESSION_APP_KEY | Session application key | `git` |
| SESSION_ID_NAME | Session ID name | `connect.sid` |
| USER_POOL_CLIENT_ID | Client ID of an app registered with the user pool in Amazon Cognito | `secret` |
| USER_POOL_ID | ID of the user pool in Amazon Cognito | `secret` |


## Launching the web-app

Expand All @@ -57,12 +62,23 @@ HUMAN | Formatting messages form (default JSON) | `true` (Enable human formattin

### Running local development environment with Docker

Docker is used to run the application in **development** mode, with tooling setup to detect changes in local `src` directory and reload the container's node server. Ensure that `NODE_ENV=development` is set in the `.env` file.
Docker is used to run the application in **development** mode, with tooling setup to detect changes in local `src` directory and reload the container's node server.

- Ensure that `NODE_ENV=development` is set in the `.env` file.

- In order for static assets to be loaded, the `CDN_HOST` must be set to a CDN domain which serves the GOV.UK static assets.

### Building the application

To build the project, run:

```sh
make build
```

### Building the Docker Image

1. Create a copy of the `.env.example` file and name it `.env`:
Then run:
Create a copy of the `.env.example` file and name it `.env`, then run:

```sh
make docker-build
Expand Down
2 changes: 1 addition & 1 deletion docs/Project Structure and Code Style.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Both `Nunjucks` and `GDS` style/components are utilised. To streamline the const
// Nunjucks HTML inputs field for adding a team
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/views/add-collaborator.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/add-member.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/add-repo.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/add-team-member.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/add-team.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/additional-requests.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/check-your-answers.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %}

{% block beforeContent %}
{% block backLink %}
{% include "include/back-link.html" %}
{% endblock %}

Expand Down
6 changes: 6 additions & 0 deletions src/views/include/phase-banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ govukPhaseBanner({
tag: {
text: "Alpha"
},
html: 'This is a new service – your <a class="govuk-link" href="#">feedback</a> will help us to improve it.'
}) }}
65 changes: 35 additions & 30 deletions src/views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/select/macro.njk" import govukSelect %}
{% from "govuk/components/cookie-banner/macro.njk" import govukCookieBanner %}
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}

{% block head %}

<link rel="stylesheet" type="text/css" media="all" href="//{{CDN_HOST}}/stylesheets/govuk-frontend/v3.11.0/govuk-frontend-3.11.0.min.css">

<link rel="SHORTCUT ICON" href="//{{CDN_HOST}}/images/favicon.ico"/>
<link rel="icon" href="//{{CDN_HOST}}/images/favicon.ico" type="image/x-icon"/>

{% endblock %}

{% block header %}
Expand All @@ -35,43 +34,49 @@
containerClasses: "govuk-width-container"
}) }}
{% endblock %}

{% block bodyStart %}
{% include "include/cookie-consent-banner.html" %}
{% endblock %}

{% block beforeContent %}
{% include "include/phase-banner.html" %}
{% block backLink %}
{% endblock %}
{% endblock %}

{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
{% block pageContent %}
{% endblock %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
{% block pageContent %}
{% endblock %}
</div>
</div>
</div>
{% endblock %}


{% block footer %}
{{ govukFooter({
meta: {
items: [
{
href: "#",
text: "Policies"
},
{
href: "#",
text: "Cookies"
},
{
href: "#",
text: "Contact us"
},
{
href: "#",
text: "Accessibility"
}
]
}
}) }}
{{ govukFooter({
meta: {
items: [
{
href: "#",
text: "Policies"
},
{
href: "#",
text: "Cookies"
},
{
href: "#",
text: "Contact us"
},
{
href: "#",
text: "Accessibility"
}
]
}
}) }}
{% endblock %}

{% block bodyEnd %}
Expand Down

0 comments on commit 4e862c1

Please sign in to comment.