Skip to content

Commit

Permalink
Merge branch 'form-v2/develop' into form-v2/whats-new
Browse files Browse the repository at this point in the history
# Conflicts:
#	frontend/src/app/AdminNavBar/AdminNavBar.tsx
  • Loading branch information
karrui committed Aug 31, 2022
2 parents 96f02fa + aa5dc38 commit 178e378
Show file tree
Hide file tree
Showing 235 changed files with 5,982 additions and 3,210 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/ci-react.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: CI (React)

defaults:
run:
working-directory: frontend

on:
push:
branches:
Expand Down Expand Up @@ -55,4 +51,26 @@ jobs:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm test
- run: npm run test:frontend

test-backend:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test:backend
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
88 changes: 88 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,95 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v5.69.0](https://github.com/opengovsg/FormSG/compare/v5.68.0...v5.69.0)

- build: merge release-v5.68.0 back to develop [`#4771`](https://github.com/opengovsg/FormSG/pull/4771)
- fix(deps): bump moment-timezone from 0.5.34 to 0.5.37 [`#4761`](https://github.com/opengovsg/FormSG/pull/4761)
- fix(deps): bump express-rate-limit from 6.5.1 to 6.5.2 [`#4703`](https://github.com/opengovsg/FormSG/pull/4703)
- chore(deps-dev): bump core-js from 3.24.1 to 3.25.0 [`#4704`](https://github.com/opengovsg/FormSG/pull/4704)
- fix(deps): bump libphonenumber-js from 1.10.12 to 1.10.13 [`#4701`](https://github.com/opengovsg/FormSG/pull/4701)
- chore(deps-dev): bump @types/validator from 13.7.5 to 13.7.6 [`#4702`](https://github.com/opengovsg/FormSG/pull/4702)
- fix(deps): bump date-fns from 2.29.1 to 2.29.2 [`#4692`](https://github.com/opengovsg/FormSG/pull/4692)
- fix(deps): bump twilio from 3.80.1 to 3.81.0 [`#4694`](https://github.com/opengovsg/FormSG/pull/4694)
- fix(deps): bump type-fest from 2.18.1 to 2.19.0 in /shared [`#4663`](https://github.com/opengovsg/FormSG/pull/4663)
- chore(deps-dev): bump ngrok from 4.3.2 to 4.3.3 [`#4689`](https://github.com/opengovsg/FormSG/pull/4689)
- chore(deps-dev): bump ts-essentials from 9.2.0 to 9.3.0 [`#4688`](https://github.com/opengovsg/FormSG/pull/4688)
- fix(deps): bump mongoose from 5.13.14 to 5.13.15 [`#4687`](https://github.com/opengovsg/FormSG/pull/4687)
- chore(deps-dev): bump @types/lodash from 4.14.182 to 4.14.184 [`#4680`](https://github.com/opengovsg/FormSG/pull/4680)
- fix(deps): bump openid-client from 5.1.8 to 5.1.9 [`#4681`](https://github.com/opengovsg/FormSG/pull/4681)
- chore(deps-dev): bump type-fest from 2.18.0 to 2.19.0 [`#4675`](https://github.com/opengovsg/FormSG/pull/4675)
- fix(deps): bump @sentry/browser from 7.10.0 to 7.11.1 [`#4678`](https://github.com/opengovsg/FormSG/pull/4678)
- fix(deps): bump jose from 4.8.3 to 4.9.0 [`#4676`](https://github.com/opengovsg/FormSG/pull/4676)
- fix(deps): bump dd-trace from 2.12.2 to 3.0.0 [`#4592`](https://github.com/opengovsg/FormSG/pull/4592)
- chore(deps-dev): bump eslint-plugin-jest from 26.8.3 to 26.8.7 [`#4662`](https://github.com/opengovsg/FormSG/pull/4662)
- fix(deps): bump type-fest from 2.18.0 to 2.18.1 in /shared [`#4613`](https://github.com/opengovsg/FormSG/pull/4613)
- fix(deps): bump libphonenumber-js from 1.10.12 to 1.10.13 in /shared [`#4614`](https://github.com/opengovsg/FormSG/pull/4614)
- chore: upgrade chromium [`#4607`](https://github.com/opengovsg/FormSG/pull/4607)
- fix: return correct statuses on submission routes when sgid errors occur [`#4600`](https://github.com/opengovsg/FormSG/pull/4600)
- fix(deps): bump date-fns from 2.29.1 to 2.29.2 in /shared [`#4602`](https://github.com/opengovsg/FormSG/pull/4602)
- chore(deps-dev): bump ngrok from 4.3.1 to 4.3.2 [`#4594`](https://github.com/opengovsg/FormSG/pull/4594)
- feat: log redirects to login for sp cp myinfo sgid [`#4585`](https://github.com/opengovsg/FormSG/pull/4585)
- Revert "feat: migration corppass to oidc (#4248)" [`#4586`](https://github.com/opengovsg/FormSG/pull/4586)
- fix(deps): bump nodemailer from 6.7.7 to 6.7.8 [`#4589`](https://github.com/opengovsg/FormSG/pull/4589)
- fix(deps): bump aws-sdk from 2.1194.0 to 2.1195.0 [`#4588`](https://github.com/opengovsg/FormSG/pull/4588)
- fix(deps): bump @sentry/browser from 7.9.0 to 7.10.0 [`#4584`](https://github.com/opengovsg/FormSG/pull/4584)
- chore(deps-dev): bump eslint-plugin-jest from 26.8.2 to 26.8.3 [`#4583`](https://github.com/opengovsg/FormSG/pull/4583)

#### [v5.68.0](https://github.com/opengovsg/FormSG/compare/v5.67.0...v5.68.0)

> 30 August 2022
- build: Release 5.68.0 [`#4575`](https://github.com/opengovsg/FormSG/pull/4575)
- feat: migration corppass to oidc [`#4248`](https://github.com/opengovsg/FormSG/pull/4248)
- chore(deps-dev): bump jest-localstorage-mock from 2.4.21 to 2.4.22 [`#4572`](https://github.com/opengovsg/FormSG/pull/4572)
- fix(deps): bump libphonenumber-js from 1.10.11 to 1.10.12 [`#4570`](https://github.com/opengovsg/FormSG/pull/4570)
- fix(deps): bump aws-sdk from 2.1192.0 to 2.1194.0 [`#4571`](https://github.com/opengovsg/FormSG/pull/4571)
- fix(deps): bump libphonenumber-js from 1.10.11 to 1.10.12 in /shared [`#4559`](https://github.com/opengovsg/FormSG/pull/4559)
- fix(deps): bump twilio from 3.80.0 to 3.80.1 [`#4558`](https://github.com/opengovsg/FormSG/pull/4558)
- fix(deps): bump aws-sdk from 2.1191.0 to 2.1192.0 [`#4557`](https://github.com/opengovsg/FormSG/pull/4557)
- build: merge 5.67.0 into develop [`#4555`](https://github.com/opengovsg/FormSG/pull/4555)
- build: release 5.67.0 [`#4553`](https://github.com/opengovsg/FormSG/pull/4553)
- chore: bump version to 5.68.0 [`b1b88c1`](https://github.com/opengovsg/FormSG/commit/b1b88c1c68f64c1eaf879f46e844231f22c7cb76)

#### [v5.67.0](https://github.com/opengovsg/FormSG/compare/v5.66.0...v5.67.0)

> 11 August 2022
- chore(deps-dev): bump axios-mock-adapter from 1.21.1 to 1.21.2 [`#4543`](https://github.com/opengovsg/FormSG/pull/4543)
- fix(deps): bump zod from 3.17.10 to 3.18.0 in /shared [`#4544`](https://github.com/opengovsg/FormSG/pull/4544)
- fix(deps): bump aws-sdk from 2.1188.0 to 2.1191.0 [`#4534`](https://github.com/opengovsg/FormSG/pull/4534)
- fix(deps): bump zod from 3.17.10 to 3.18.0 [`#4533`](https://github.com/opengovsg/FormSG/pull/4533)
- fix(deps): bump @sentry/browser from 7.8.1 to 7.9.0 [`#4531`](https://github.com/opengovsg/FormSG/pull/4531)
- chore(deps-dev): bump eslint-plugin-jest from 26.8.0 to 26.8.2 [`#4532`](https://github.com/opengovsg/FormSG/pull/4532)
- fix(deps): bump dd-trace from 2.12.1 to 2.12.2 [`#4530`](https://github.com/opengovsg/FormSG/pull/4530)
- chore(deps-dev): bump @types/nodemailer from 6.4.4 to 6.4.5 [`#4520`](https://github.com/opengovsg/FormSG/pull/4520)
- chore(deps-dev): bump eslint-plugin-jest from 26.7.0 to 26.8.0 [`#4522`](https://github.com/opengovsg/FormSG/pull/4522)
- chore(deps-dev): bump @types/validator from 13.7.4 to 13.7.5 [`#4521`](https://github.com/opengovsg/FormSG/pull/4521)
- feat(datadog): connect logs and traces [`#4505`](https://github.com/opengovsg/FormSG/pull/4505)
- fix: remove confidential responses from email mode features in copy [`#4502`](https://github.com/opengovsg/FormSG/pull/4502)
- chore(deps-dev): bump @babel/plugin-transform-runtime [`#4497`](https://github.com/opengovsg/FormSG/pull/4497)
- chore(deps-dev): bump eslint-plugin-jest from 26.6.0 to 26.7.0 [`#4491`](https://github.com/opengovsg/FormSG/pull/4491)
- chore(deps-dev): bump @babel/preset-env from 7.18.9 to 7.18.10 [`#4494`](https://github.com/opengovsg/FormSG/pull/4494)
- fix(deps): bump @sentry/browser from 7.8.0 to 7.8.1 [`#4492`](https://github.com/opengovsg/FormSG/pull/4492)
- chore(deps-dev): downgrade @types/node from 18.6.2 to 14.18.23 [`#4486`](https://github.com/opengovsg/FormSG/pull/4486)
- fix(deps): bump aws-sdk from 2.1187.0 to 2.1188.0 [`#4490`](https://github.com/opengovsg/FormSG/pull/4490)
- chore(deps-dev): bump type-fest from 2.17.0 to 2.18.0 [`#4489`](https://github.com/opengovsg/FormSG/pull/4489)
- fix(deps): bump jszip from 3.10.0 to 3.10.1 in /shared [`#4488`](https://github.com/opengovsg/FormSG/pull/4488)
- fix(deps): bump aws-sdk from 2.1186.0 to 2.1187.0 [`#4487`](https://github.com/opengovsg/FormSG/pull/4487)
- fix(deps): bump jszip from 3.10.0 to 3.10.1 [`#4471`](https://github.com/opengovsg/FormSG/pull/4471)
- fix(deps): bump hot-shots from 9.1.0 to 9.2.0 [`#4470`](https://github.com/opengovsg/FormSG/pull/4470)
- chore(deps-dev): bump @babel/core from 7.18.9 to 7.18.10 [`#4469`](https://github.com/opengovsg/FormSG/pull/4469)
- fix(deps): bump aws-sdk from 2.1184.0 to 2.1186.0 [`#4465`](https://github.com/opengovsg/FormSG/pull/4465)
- fix(deps): bump dd-trace from 2.12.0 to 2.12.1 [`#4457`](https://github.com/opengovsg/FormSG/pull/4457)
- fix(deps): bump neverthrow from 4.4.2 to 5.0.0 [`#4416`](https://github.com/opengovsg/FormSG/pull/4416)
- build: merge release-al2 into develop [`#4449`](https://github.com/opengovsg/FormSG/pull/4449)
- build: release 5.66.0 [`#4439`](https://github.com/opengovsg/FormSG/pull/4439)
- chore: bump version to 5.67.0 [`0bd59a4`](https://github.com/opengovsg/FormSG/commit/0bd59a4abd1c0dd88cd8605830b8f2a735ceaffd)

#### [v5.66.0](https://github.com/opengovsg/FormSG/compare/v5.65.0...v5.66.0)

> 1 August 2022
- chore(deps-dev): bump core-js from 3.24.0 to 3.24.1 [`#4438`](https://github.com/opengovsg/FormSG/pull/4438)
- fix(deps): bump libphonenumber-js from 1.10.10 to 1.10.11 in /shared [`#4437`](https://github.com/opengovsg/FormSG/pull/4437)
- fix(deps): bump type-fest from 2.17.0 to 2.18.0 in /shared [`#4436`](https://github.com/opengovsg/FormSG/pull/4436)
Expand Down Expand Up @@ -48,6 +135,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(deps): bump libphonenumber-js from 1.10.8 to 1.10.9 in /shared [`#4240`](https://github.com/opengovsg/FormSG/pull/4240)
- build: merge release 5.65.0 into develop [`#4231`](https://github.com/opengovsg/FormSG/pull/4231)
- build: Release 5.65.0 [`#4227`](https://github.com/opengovsg/FormSG/pull/4227)
- chore: bump version to 5.66.0 [`9da003c`](https://github.com/opengovsg/FormSG/commit/9da003c4e2b6919e593a2c90ca4ab8aa53dd278e)

#### [v5.65.0](https://github.com/opengovsg/FormSG/compare/v5.64.0...v5.65.0)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apk update && apk upgrade && \
# that is guaranteed to work. Upgrades must be done in lockstep.
# https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine
# https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions
chromium=102.0.5005.167-r0 \
chromium=102.0.5005.173-r0 \
nss \
freetype \
freetype-dev \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN mv /opt/formsg/dist/backend/shared /opt/formsg/
# https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions

RUN apk add --no-cache \
chromium=102.0.5005.167-r0 \
chromium=102.0.5005.173-r0 \
nss \
freetype \
freetype-dev \
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
- [Features](#features)
- [Local Development (Docker)](#local-development-docker)
- [Prerequisites](#prerequisites)
- [First Setup](#first-setup)
- [Running Locally](#running-locally)
- [Accessing email locally](#accessing-email-locally)
- [Environment variables](#environment-variables)
- [Trouble-shooting](#trouble-shooting)
- [Testing](#testing)
Expand All @@ -20,9 +22,9 @@
- [End-to-end tests](#end-to-end-tests)
- [Architecture](#architecture)
- [MongoDB Scripts](#mongodb-scripts)
- [Maintenance Banners](#maintenance-banners)
- [Contributing](#contributing)
- [Support](#support)
- [Acknowledgements](#acknowledgements)

## Features

Expand All @@ -37,7 +39,7 @@ Notable features include:
- (Singapore government agencies only) Citizen authentication with [SingPass](https://www.singpass.gov.sg/singpass/common/aboutus)
- (Singapore government agencies only) Corporate authentication with [CorpPass](https://www.corppass.gov.sg/corppass/common/aboutus)
- (Singapore government agencies only) Automatic prefill of verified data with [MyInfo](https://www.singpass.gov.sg/myinfo/common/aboutus)
- Webhooks functionality via the official [FormSG JavaScript SDK](https://github.com/opengovsg/formsg-sdk) and contributor-supported [FormSG Ruby SDK] (https://github.com/opengovsg/formsg-ruby-sdk)
- Webhooks functionality via the official [FormSG JavaScript SDK](https://github.com/opengovsg/formsg-sdk) and contributor-supported [FormSG Ruby SDK](<https://github.com/opengovsg/formsg-ruby-sdk>)

The current product roadmap includes:

Expand All @@ -63,6 +65,18 @@ npm install

If you are on Mac OS X, you may want to allow Docker to use more RAM (minimum of 4GB) by clicking on the Docker icon on the toolbar, clicking on the "Preferences" menu item, then clicking on the "Resources" link on the left.

If you are on macOS Monetery or higher, port 5000 is now used by the system. This conflicts with the default port used by the backend. You could either:

- Update the backend ports in these environment variables:
- `Dockerfile.development`
- Update exposed port
- `docker-compose.yml`
- Introduce a new env var `PORT`
- Update `APP_URL`
- `frontend/package.json`
- Update the proxy URL
- [Disable control center](https://apple.stackexchange.com/a/431164)

### Running Locally

Run the following shell command to build the Docker image from scratch. This will usually take 10 or so minutes.
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ services:
- SES_USER
- OTP_LIFE_SPAN
- AWS_REGION
# this needs to be replaced with the ID of a feedback form that you create
# in your local environment
- REACT_TO_ANGULAR_FEEDBACK_FORM_ID=62da6a569ee8e90143b5da26
- REACT_MIGRATION_ANGULAR_END_DATE=15 September 2022
- REACT_MIGRATION_RESP_ROLLOUT_EMAIL=1
- REACT_MIGRATION_RESP_ROLLOUT_STORAGE=1
- REACT_MIGRATION_ADMIN_ROLLOUT=1
mockpass:
build: https://github.com/opengovsg/mockpass.git
depends_on:
Expand All @@ -117,6 +124,7 @@ services:
container_name: 'formsg-db'
environment:
- MONGODB_DATABASE=formsg
- MONGODB_ADVERTISED_HOSTNAME=database
- MONGODB_REPLICA_SET_MODE=primary
- ALLOW_EMPTY_PASSWORD=yes
volumes:
Expand Down
17 changes: 8 additions & 9 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ If you cannot login to the app and see an `MongoError: not primary and secondary

This is most likely due to the replicaSet being misconfigured with the wrong IP address of the MongoDB container.

To fix this issue, follow these steps:
This should only happen if your MongoDB volume was created before [#4603](https://github.com/opengovsg/FormSG/pull/4603).

1. Retrieve the container ID of the mongodb container using `docker ps`,
2. Retrieve the IP address of the container `docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <mongodb-container-id>`.
3. Login to the docker container using `docker exec -it <mongodb-container-id> /bin/sh`
4. Start the mongodb shell with `mongosh`.
5. Look at the replica set configuration by entering `rs.config()`. Look to see if the IP address listed is different than the one in step 2.
6. Run the following commands within `mongosh` to force set the IP address within the replica set:
To fix this issue, either delete and re-create the MongoDB volume, or follow these steps:

1. Login to the docker container using `docker exec -it <mongodb-container-id> /bin/sh`
2. Start the mongodb shell with `mongosh`.
3. Run the following commands within `mongosh` to force set the IP address within the replica set:

```
conf = rs.config()
conf.members[0].host = '<ip-address>:27017'
conf.members[0].host = 'database:27017'
rs.reconfig(conf, {force:true})
```
```
35 changes: 28 additions & 7 deletions frontend/package-lock.json

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

6 changes: 4 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"file-saver": "^2.0.5",
"focus-visible": "^5.2.0",
"framer-motion": "^5.4.5",
"http-status-codes": "^2.2.0",
"i18next": "^21.6.16",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-icu": "^2.0.3",
Expand Down Expand Up @@ -54,6 +55,7 @@
"react-popper": "^2.3.0",
"react-query": "^3.34.2",
"react-router-dom": "^6.0.2",
"react-roving-tabindex": "^3.2.0",
"react-swipeable": "^7.0.0",
"react-table": "^7.7.0",
"react-textarea-autosize": "^8.3.3",
Expand Down Expand Up @@ -99,7 +101,7 @@
"postinstall": "npm run gen:theme-typings && npm run clean:emotion-types && npm run partytown && npm --prefix ../shared install",
"start": "cross-env SKIP_PREFLIGHT_CHECK=true craco start",
"build": "cross-env CI=false BUILD_PATH='../dist/frontend' INLINE_RUNTIME_CHUNK=false SKIP_PREFLIGHT_CHECK=true craco build",
"test": "cross-env SKIP_PREFLIGHT_CHECK=true craco test",
"test": "cross-env SKIP_PREFLIGHT_CHECK=true craco test --silent",
"eject": "react-scripts eject",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
Expand Down Expand Up @@ -141,7 +143,7 @@
"@testing-library/dom": "^8.11.1",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@testing-library/user-event": "^14.4.3",
"@types/dedent": "^0.7.0",
"@types/file-saver": "^2.0.3",
"@types/gtag.js": "0.0.10",
Expand Down
Loading

0 comments on commit 178e378

Please sign in to comment.