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

chore: merge v5.28.0 into master #2852

Merged
merged 27 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
26fd190
chore(deps-dev): bump ngrok from 4.1.0 to 4.2.2 (#2753)
dependabot[bot] Sep 6, 2021
e003e6b
chore(deps-dev): bump @typescript-eslint/parser from 4.30.0 to 4.31.0…
dependabot[bot] Sep 6, 2021
4fe60c3
fix(deps): bump web-streams-polyfill from 3.1.0 to 3.1.1 (#2755)
dependabot[bot] Sep 6, 2021
a671ee6
fix(deps): bump axios from 0.21.2 to 0.21.4 (#2756)
dependabot[bot] Sep 6, 2021
cdf632d
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#2752)
dependabot[bot] Sep 6, 2021
7da643d
fix(radio): Remove unnecessary nbsp from option text (#2736)
timotheeg Sep 7, 2021
cabb912
Merge pull request #2757 from opengovsg/release-5.27.0
mantariksh Sep 7, 2021
9be0e7e
fix: upgrade zod from 3.7.1 to 3.7.2 (#2737)
snyk-bot Sep 7, 2021
bb9749c
chore(deps): Update winston-cloudwatch (#2726)
timotheeg Sep 7, 2021
50c9e8a
chore(deps-dev): bump @types/node from 14.17.14 to 14.17.15 (#2758)
dependabot[bot] Sep 7, 2021
14461c3
chore(deps-dev): bump @types/compression from 1.7.1 to 1.7.2 (#2760)
dependabot[bot] Sep 7, 2021
2e3eeb8
fix(deps): bump aws-sdk from 2.983.0 to 2.984.0 (#2763)
dependabot[bot] Sep 8, 2021
c440061
chore(deps-dev): bump core-js from 3.17.2 to 3.17.3 (#2770)
dependabot[bot] Sep 9, 2021
1298700
chore(deps-dev): bump prettier from 2.3.2 to 2.4.0 (#2771)
dependabot[bot] Sep 9, 2021
e4217a3
fix(deps): bump aws-sdk from 2.984.0 to 2.985.0 (#2773)
dependabot[bot] Sep 9, 2021
128c1fc
fix(deps): bump libphonenumber-js from 1.9.26 to 1.9.27 (#2774)
dependabot[bot] Sep 9, 2021
51f0b8c
fix(otp): Ensure uniform distribution of digits (#2775)
timotheeg Sep 10, 2021
3f0aa27
fix(deps): bump aws-sdk from 2.985.0 to 2.987.0 (#2778)
dependabot[bot] Sep 12, 2021
570b1e8
chore(deps-dev): bump typescript from 4.4.2 to 4.4.3 (#2779)
dependabot[bot] Sep 12, 2021
3744811
chore(deps-dev): bump @babel/preset-env from 7.15.4 to 7.15.6 (#2780)
dependabot[bot] Sep 12, 2021
31d1846
fix(deps): bump libphonenumber-js from 1.9.27 to 1.9.32 (#2782)
dependabot[bot] Sep 12, 2021
cde09b7
chore(deps-dev): bump type-fest from 2.2.0 to 2.3.2 (#2783)
dependabot[bot] Sep 12, 2021
eeeb0ac
fix(deps): bump twilio from 3.67.1 to 3.67.2 (#2772)
dependabot[bot] Sep 13, 2021
1ae05e7
feat: Add 4MB attachment support (#2777)
frankchn Sep 13, 2021
c5bfd95
chore(deps-dev): bump @typescript-eslint/eslint-plugin (#2795)
dependabot[bot] Sep 13, 2021
227329d
fix(deps): bump fp-ts from 2.11.1 to 2.11.2 (#2796)
dependabot[bot] Sep 14, 2021
59fe066
chore: bump version to 5.28.0
timotheeg Sep 14, 2021
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
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,39 @@ 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.28.0](https://github.com/opengovsg/FormSG/compare/v5.27.0...v5.28.0)

- fix(deps): bump fp-ts from 2.11.1 to 2.11.2 [`#2796`](https://github.com/opengovsg/FormSG/pull/2796)
- chore(deps-dev): bump @typescript-eslint/eslint-plugin [`#2795`](https://github.com/opengovsg/FormSG/pull/2795)
- feat: Add 4MB attachment support [`#2777`](https://github.com/opengovsg/FormSG/pull/2777)
- fix(deps): bump twilio from 3.67.1 to 3.67.2 [`#2772`](https://github.com/opengovsg/FormSG/pull/2772)
- chore(deps-dev): bump type-fest from 2.2.0 to 2.3.2 [`#2783`](https://github.com/opengovsg/FormSG/pull/2783)
- fix(deps): bump libphonenumber-js from 1.9.27 to 1.9.32 [`#2782`](https://github.com/opengovsg/FormSG/pull/2782)
- chore(deps-dev): bump @babel/preset-env from 7.15.4 to 7.15.6 [`#2780`](https://github.com/opengovsg/FormSG/pull/2780)
- chore(deps-dev): bump typescript from 4.4.2 to 4.4.3 [`#2779`](https://github.com/opengovsg/FormSG/pull/2779)
- fix(deps): bump aws-sdk from 2.985.0 to 2.987.0 [`#2778`](https://github.com/opengovsg/FormSG/pull/2778)
- fix(otp): Ensure uniform distribution of digits [`#2775`](https://github.com/opengovsg/FormSG/pull/2775)
- fix(deps): bump libphonenumber-js from 1.9.26 to 1.9.27 [`#2774`](https://github.com/opengovsg/FormSG/pull/2774)
- fix(deps): bump aws-sdk from 2.984.0 to 2.985.0 [`#2773`](https://github.com/opengovsg/FormSG/pull/2773)
- chore(deps-dev): bump prettier from 2.3.2 to 2.4.0 [`#2771`](https://github.com/opengovsg/FormSG/pull/2771)
- chore(deps-dev): bump core-js from 3.17.2 to 3.17.3 [`#2770`](https://github.com/opengovsg/FormSG/pull/2770)
- fix(deps): bump aws-sdk from 2.983.0 to 2.984.0 [`#2763`](https://github.com/opengovsg/FormSG/pull/2763)
- chore(deps-dev): bump @types/compression from 1.7.1 to 1.7.2 [`#2760`](https://github.com/opengovsg/FormSG/pull/2760)
- chore(deps-dev): bump @types/node from 14.17.14 to 14.17.15 [`#2758`](https://github.com/opengovsg/FormSG/pull/2758)
- chore(deps): Update winston-cloudwatch [`#2726`](https://github.com/opengovsg/FormSG/pull/2726)
- fix: upgrade zod from 3.7.1 to 3.7.2 [`#2737`](https://github.com/opengovsg/FormSG/pull/2737)
- build: merge release 5.27.0 into develop [`#2757`](https://github.com/opengovsg/FormSG/pull/2757)
- fix(radio): Remove unnecessary nbsp from option text [`#2736`](https://github.com/opengovsg/FormSG/pull/2736)
- chore(deps-dev): bump @typescript-eslint/eslint-plugin [`#2752`](https://github.com/opengovsg/FormSG/pull/2752)
- fix(deps): bump axios from 0.21.2 to 0.21.4 [`#2756`](https://github.com/opengovsg/FormSG/pull/2756)
- fix(deps): bump web-streams-polyfill from 3.1.0 to 3.1.1 [`#2755`](https://github.com/opengovsg/FormSG/pull/2755)
- chore(deps-dev): bump @typescript-eslint/parser from 4.30.0 to 4.31.0 [`#2754`](https://github.com/opengovsg/FormSG/pull/2754)
- chore(deps-dev): bump ngrok from 4.1.0 to 4.2.2 [`#2753`](https://github.com/opengovsg/FormSG/pull/2753)

#### [v5.27.0](https://github.com/opengovsg/FormSG/compare/v5.26.0...v5.27.0)

> 6 September 2021

- fix(deps): bump libphonenumber-js from 1.9.25 to 1.9.26 [`#2741`](https://github.com/opengovsg/FormSG/pull/2741)
- fix(deps): bump @babel/runtime from 7.15.3 to 7.15.4 [`#2746`](https://github.com/opengovsg/FormSG/pull/2746)
- chore(deps-dev): bump @babel/core from 7.15.0 to 7.15.5 [`#2749`](https://github.com/opengovsg/FormSG/pull/2749)
Expand All @@ -28,6 +59,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore(deps-dev): bump @types/node from 14.17.12 to 14.17.14 [`#2722`](https://github.com/opengovsg/FormSG/pull/2722)
- fix(deps): bump aws-sdk from 2.978.0 to 2.979.0 [`#2717`](https://github.com/opengovsg/FormSG/pull/2717)
- chore: merge release v5.26.0 back to develop [`#2711`](https://github.com/opengovsg/FormSG/pull/2711)
- chore: bump version to 5.27.0 [`ffb85d2`](https://github.com/opengovsg/FormSG/commit/ffb85d2ff0d902baac9b497d66c520f4c4f7e018)

#### [v5.26.0](https://github.com/opengovsg/FormSG/compare/v5.25.0...v5.26.0)

Expand Down
438 changes: 226 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "FormSG",
"description": "Form Manager for Government",
"version": "5.27.0",
"version": "5.28.0",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <formsg@data.gov.sg>"
Expand Down Expand Up @@ -82,8 +82,8 @@
"angular-ui-bootstrap": "~2.5.6",
"angular-ui-router": "~1.0.29",
"aws-info": "^1.2.0",
"aws-sdk": "^2.983.0",
"axios": "^0.21.2",
"aws-sdk": "^2.987.0",
"axios": "^0.21.4",
"bcrypt": "^5.0.1",
"bluebird": "^3.5.2",
"body-parser": "^1.18.3",
Expand Down Expand Up @@ -111,15 +111,15 @@
"fetch-readablestream": "^0.2.0",
"file-saver": "^2.0.5",
"font-awesome": "4.7.0",
"fp-ts": "^2.11.1",
"fp-ts": "^2.11.2",
"has-ansi": "^4.0.1",
"helmet": "^4.6.0",
"http-status-codes": "^2.1.4",
"intl-tel-input": "~12.4.0",
"json-stringify-safe": "^5.0.1",
"jszip": "^3.7.1",
"jwt-decode": "^3.1.2",
"libphonenumber-js": "^1.9.26",
"libphonenumber-js": "^1.9.32",
"lodash": "^4.17.21",
"moment-timezone": "0.5.33",
"mongodb-uri": "^0.9.7",
Expand All @@ -146,26 +146,26 @@
"toastr": "^2.1.4",
"triple-beam": "^1.3.0",
"tweetnacl": "^1.0.1",
"twilio": "^3.67.1",
"twilio": "^3.67.2",
"ui-select": "^0.19.8",
"uid-generator": "^2.0.0",
"uuid": "^8.3.2",
"validator": "^13.6.0",
"web-streams-polyfill": "^3.1.0",
"web-streams-polyfill": "^3.1.1",
"whatwg-fetch": "^3.6.2",
"winston": "^3.3.3",
"winston-cloudwatch": "^2.5.2",
"winston-cloudwatch": "^3.0.2",
"zod": "^3.8.2"
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.4",
"@babel/preset-env": "^7.15.6",
"@opengovsg/mockpass": "^2.7.8",
"@types/bcrypt": "^5.0.0",
"@types/bluebird": "^3.5.36",
"@types/busboy": "^0.2.4",
"@types/compression": "^1.7.1",
"@types/compression": "^1.7.2",
"@types/convict": "^6.1.1",
"@types/cookie-parser": "^1.4.2",
"@types/dedent": "^0.7.0",
Expand All @@ -181,7 +181,7 @@
"@types/json-stringify-safe": "^5.0.0",
"@types/mongodb": "^3.6.20",
"@types/mongodb-uri": "^0.9.1",
"@types/node": "^14.17.14",
"@types/node": "^14.17.15",
"@types/nodemailer": "^6.4.4",
"@types/opossum": "^6.2.0",
"@types/promise-retry": "^1.1.3",
Expand All @@ -192,14 +192,14 @@
"@types/uid-generator": "^2.0.2",
"@types/uuid": "^8.3.1",
"@types/validator": "^13.6.3",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.0",
"auto-changelog": "^2.3.0",
"axios-mock-adapter": "^1.20.0",
"babel-loader": "^8.2.2",
"concurrently": "^6.2.1",
"copy-webpack-plugin": "^6.0.2",
"core-js": "^3.17.2",
"core-js": "^3.17.3",
"coveralls": "^3.1.1",
"css-loader": "^2.1.1",
"csv-parse": "^4.16.3",
Expand Down Expand Up @@ -228,9 +228,9 @@
"mockdate": "^3.0.5",
"mockingoose": "^2.13.2",
"mongodb-memory-server-core": "^6.9.6",
"ngrok": "^4.1.0",
"ngrok": "^4.2.2",
"optimize-css-assets-webpack-plugin": "^5.0.8",
"prettier": "^2.3.2",
"prettier": "^2.4.0",
"proxyquire": "^2.1.3",
"regenerator": "^0.14.4",
"rimraf": "^3.0.2",
Expand All @@ -247,8 +247,8 @@
"ts-loader": "^7.0.5",
"ts-node": "^10.2.1",
"ts-node-dev": "^1.1.8",
"type-fest": "^2.2.0",
"typescript": "^4.4.2",
"type-fest": "^2.3.2",
"typescript": "^4.4.3",
"url-loader": "^1.1.2",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
Expand Down
6 changes: 3 additions & 3 deletions shared/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 shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lodash": "^4.17.21",
"type-fest": "^1.4.0",
"validator": "^13.6.0",
"zod": "^3.7.1"
"zod": "^3.7.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.28.2",
Expand Down
1 change: 1 addition & 0 deletions shared/types/field/attachmentField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum AttachmentSize {
OneMb = '1',
TwoMb = '2',
ThreeMb = '3',
FourMb = '4',
SevenMb = '7',
TenMb = '10',
TwentyMb = '20',
Expand Down
7 changes: 7 additions & 0 deletions src/app/config/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import { Environment } from '../../types'

import { aws, customCloudWatchGroup, isDev, nodeEnv } from './config'

// WINSTON_CLOUDWATCH_NAME is not actually needed, but the typescript definition has
// an error (presumably?), and so we must supply a dummy value.
// See issue: https://github.com/lazywithclass/winston-cloudwatch/issues/159
// TODO: remove if/when typescript definition is updated correctly
const WINSTON_CLOUDWATCH_NAME = 'FormSGCloudWatch'

// Params to enforce the logging format.
export type CustomLoggerParams = {
message: string
Expand Down Expand Up @@ -233,6 +239,7 @@ export const createCloudWatchLogger = (label: string) => {
if (!isDev && customCloudWatchGroup) {
loggerOptions.transports = [
new WinstonCloudWatch({
name: WINSTON_CLOUDWATCH_NAME,
logGroupName: customCloudWatchGroup,
// Every EC2 instance needs its own unique stream name, or else they
// will run into InvalidSequenceTokenException errors because they do
Expand Down
14 changes: 4 additions & 10 deletions src/app/utils/otp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ const DEFAULT_SALT_ROUNDS = 10
* @returns 6 digit OTP string
*/
export const generateOtp = (): string => {
const length = 6
const chars = '0123456789'
// Generates cryptographically strong pseudo-random data.
// The size argument is a number indicating the number of bytes to generate.
const rnd = crypto.randomBytes(length)
const d = chars.length / 256
const digits = new Array(length)
for (let i = 0; i < length; i++) {
digits[i] = chars[Math.floor(rnd[i] * d)]
}
return digits.join('')
return Array(6)
.fill(0)
.map(() => crypto.randomInt(0, 10))
.join('')
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const {
} = require('../../../../../../shared/types/field')
const CancelToken = axios.CancelToken

const EMAIL_MODE_ALLOWED_SIZES = ['1', '2', '3', '7']
const EMAIL_MODE_ALLOWED_SIZES = ['1', '2', '3', '4', '7']

angular
.module('forms')
Expand Down Expand Up @@ -326,8 +326,8 @@ function EditFieldsModalController(
// Modify tooltip to match email or encrypt mode options
vm.attachmentTooltipText =
vm.myform.responseMode === responseModeEnum.EMAIL
? 'Guideline: Images & PDFs - 1-3 MB, Slides & Videos - 7 MB. Include up to 7 MB of attachments in a submission (Email mode).'
: 'Guideline: Images & PDFs - 1-3 MB, Slides - 7 MB, Videos - 10-20 MB. Include up to 20 MB of attachments in a submission (Storage mode).'
? 'Guideline: Images & PDFs - 1-4 MB, Slides & Videos - 7 MB. Include up to 7 MB of attachments in a submission (Email mode).'
: 'Guideline: Images & PDFs - 1-4 MB, Slides - 7 MB, Videos - 10-20 MB. Include up to 20 MB of attachments in a submission (Storage mode).'

let previousAttachmentSize = 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
aria-labelledby="label-{{ vm.field._id || 'defaultID'}}"
aria-describedby="description-{{ vm.field._id || 'defaultID'}}"
/>
{{ option }} &nbsp;
<!-- Empty space is to prevent visual bug when radio button is empty-->
<span ng-if="option">{{ option }}</span>
<span ng-if="!option">&nbsp;</span>
<span
class="radiomark"
ng-class="vm.field.fieldValue === option ? '{{ vm.colortheme }}-border' : ''"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const { zipWith } = require('lodash')
angular.module('forms').service('Attachment', [Attachment])

function Attachment() {
this.sizes = ['1', '2', '3', '7', '10', '20']
this.sizes = ['1', '2', '3', '4', '7', '10', '20']

this.descriptions = ['1 MB', '2 MB', '3 MB', '7 MB', '10 MB', '20 MB']
this.descriptions = ['1 MB', '2 MB', '3 MB', '4 MB', '7 MB', '10 MB', '20 MB']

this.dropdown = zipWith(this.descriptions, this.sizes, (desc, size) => {
return { name: desc, value: size }
Expand Down