diff --git a/CHANGELOG.md b/CHANGELOG.md index bd8bdc5ef9..4575fc6efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,40 @@ 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). +#### [v6.41.1](https://github.com/opengovsg/FormSG/compare/v6.41.0...v6.41.1) + +- build: release v6.41.0 [`#6128`](https://github.com/opengovsg/FormSG/pull/6128) + +#### [v6.41.0](https://github.com/opengovsg/FormSG/compare/v6.40.0...v6.41.0) + +> 19 April 2023 + +- chore: make hsts header follow recommendation from csa [`#6106`](https://github.com/opengovsg/FormSG/pull/6106) +- fix(deps): bump xml2js and aws-sdk [`#6084`](https://github.com/opengovsg/FormSG/pull/6084) +- feat: track nodejs runtime metrics in APM [`#6120`](https://github.com/opengovsg/FormSG/pull/6120) +- chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.58.0 to 5.59.0 in /shared [`#6104`](https://github.com/opengovsg/FormSG/pull/6104) +- fix(deps): bump libphonenumber-js from 1.10.26 to 1.10.28 in /shared [`#6119`](https://github.com/opengovsg/FormSG/pull/6119) +- fix: date-picker bug for negative UTC timezones [`#6096`](https://github.com/opengovsg/FormSG/pull/6096) +- chore(deps-dev): bump @typescript-eslint/parser from 5.58.0 to 5.59.0 in /shared [`#6105`](https://github.com/opengovsg/FormSG/pull/6105) +- chore: prune error logs for ndi oidc key retrieval error [`#6098`](https://github.com/opengovsg/FormSG/pull/6098) +- chore(deps-dev): bump @types/lodash from 4.14.192 to 4.14.194 in /shared [`#6100`](https://github.com/opengovsg/FormSG/pull/6100) +- fix(deps): bump vm2 from 3.9.15 to 3.9.16 [`#6092`](https://github.com/opengovsg/FormSG/pull/6092) +- chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.57.1 to 5.58.0 in /shared [`#6082`](https://github.com/opengovsg/FormSG/pull/6082) +- chore(deps-dev): bump @typescript-eslint/parser from 5.57.1 to 5.58.0 in /shared [`#6083`](https://github.com/opengovsg/FormSG/pull/6083) +- fix(deps): bump vm2 from 3.9.11 to 3.9.15 [`#6075`](https://github.com/opengovsg/FormSG/pull/6075) +- fix(deps): bump type-fest from 3.7.2 to 3.8.0 in /shared [`#6064`](https://github.com/opengovsg/FormSG/pull/6064) +- build: merge release v6.40.0 into develop [`#6072`](https://github.com/opengovsg/FormSG/pull/6072) +- build: release v6.40.0 [`#6071`](https://github.com/opengovsg/FormSG/pull/6071) +- chore: bump version to v6.41.0 [`5055b51`](https://github.com/opengovsg/FormSG/commit/5055b51c5505aab5e8f2a00907e2ee2a9f793e88) + #### [v6.40.0](https://github.com/opengovsg/FormSG/compare/v6.39.0...v6.40.0) +> 6 April 2023 + - build: merge release v6.39.0 into develop [`#6070`](https://github.com/opengovsg/FormSG/pull/6070) - fix(AttachmentField): correctly clear attachment on upload error [`#6069`](https://github.com/opengovsg/FormSG/pull/6069) +- build: release v6.39.0 [`#6068`](https://github.com/opengovsg/FormSG/pull/6068) +- chore: bump version to v6.40.0 [`d4441e2`](https://github.com/opengovsg/FormSG/commit/d4441e276a30b373d64dcc7838f1798049ccf105) #### [v6.39.0](https://github.com/opengovsg/FormSG/compare/v6.38.0...v6.39.0) @@ -37,7 +67,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump @types/lodash from 4.14.191 to 4.14.192 in /shared [`#5997`](https://github.com/opengovsg/FormSG/pull/5997) - chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.56.0 to 5.57.0 in /shared [`#5996`](https://github.com/opengovsg/FormSG/pull/5996) - fix(deps): bump type-fest from 3.7.0 to 3.7.1 in /shared [`#5991`](https://github.com/opengovsg/FormSG/pull/5991) -- build: merge v6.37.0 into develop [`#5989`](https://github.com/opengovsg/FormSG/pull/5989) +- build: merge v6.37.0 into develop [`#5989`](https://github.com/opengovsg/FormSG/pull/5989) - build: release v6.37.0 [`#5988`](https://github.com/opengovsg/FormSG/pull/5988) #### [v6.37.0](https://github.com/opengovsg/FormSG/compare/v6.36.0...v6.37.0) @@ -111,7 +141,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 1 March 2023 - chore: revert "feat: merge payment-mvp branch into develop" [`#5858`](https://github.com/opengovsg/FormSG/pull/5858) -- build: merge release v6.33.0 into develop [`#5859`](https://github.com/opengovsg/FormSG/pull/5859) +- build: merge release v6.33.0 into develop [`#5859`](https://github.com/opengovsg/FormSG/pull/5859) - build: release v6.33.0 [`#5853`](https://github.com/opengovsg/FormSG/pull/5853) - chore: bump version to v6.34.0 [`4624819`](https://github.com/opengovsg/FormSG/commit/46248191e9b5f69e7400ee9b03dd1decdae43e96) @@ -125,7 +155,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump libphonenumber-js from 1.10.20 to 1.10.21 in /shared [`#5841`](https://github.com/opengovsg/FormSG/pull/5841) - fix(deps): bump type-fest from 3.6.0 to 3.6.1 in /shared [`#5840`](https://github.com/opengovsg/FormSG/pull/5840) - feat: add prefix to OTPs [`#5828`](https://github.com/opengovsg/FormSG/pull/5828) -- build: merge release v6.32.0 into develop [`#5833`](https://github.com/opengovsg/FormSG/pull/5833) +- build: merge release v6.32.0 into develop [`#5833`](https://github.com/opengovsg/FormSG/pull/5833) - [Snyk] Security upgrade @aws-sdk/client-cloudwatch-logs from 3.241.0 to 3.276.0 [`#5835`](https://github.com/opengovsg/FormSG/pull/5835) - build: release v6.32.0 [`#5832`](https://github.com/opengovsg/FormSG/pull/5832) - chore: bump version to v6.33.0 [`6508dc0`](https://github.com/opengovsg/FormSG/commit/6508dc09bb519392afbc426c6b68257c4e83515d) @@ -141,7 +171,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump @typescript-eslint/parser from 5.52.0 to 5.53.0 in /shared [`#5797`](https://github.com/opengovsg/FormSG/pull/5797) - fix(deps): bump type-fest from 3.5.7 to 3.6.0 in /shared [`#5794`](https://github.com/opengovsg/FormSG/pull/5794) - fix(a11y): change heading label from instruction and section field container to h2 element [`#5786`](https://github.com/opengovsg/FormSG/pull/5786) -- build: merge release v6.31.0 into develop [`#5785`](https://github.com/opengovsg/FormSG/pull/5785) +- build: merge release v6.31.0 into develop [`#5785`](https://github.com/opengovsg/FormSG/pull/5785) - fix(a11y/windows): read qn number for all fields [`#5788`](https://github.com/opengovsg/FormSG/pull/5788) - fix: save secret key per form with useQuery to prevent need for entering secret key [`#5743`](https://github.com/opengovsg/FormSG/pull/5743) - fix(deps): bump node-jose from 2.1.1 to 2.2.0 [`#5790`](https://github.com/opengovsg/FormSG/pull/5790) @@ -279,7 +309,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: add console.error to instances of arrayBuffer in the frontend [`#5659`](https://github.com/opengovsg/FormSG/pull/5659) - fix: remove deprecated GA command set-output [`#5633`](https://github.com/opengovsg/FormSG/pull/5633) - chore: swap cookie names for admin ui from `v2-admin-ui` to `v2-admin-ui-Jan-2023` [`#5665`](https://github.com/opengovsg/FormSG/pull/5665) -- fix: view full public form page when printed [`#5596`](https://github.com/opengovsg/FormSG/pull/5596) +- fix: view full public form page when printed [`#5596`](https://github.com/opengovsg/FormSG/pull/5596) - fix: add frontend logging for network error [`#5663`](https://github.com/opengovsg/FormSG/pull/5663) - fix: revert "chore(deps-dev): bump @types/express from 4.17.14 to 4.17.15" [`#5664`](https://github.com/opengovsg/FormSG/pull/5664) - chore(deps-dev): bump typescript from 4.8.4 to 4.9.4 [`#5661`](https://github.com/opengovsg/FormSG/pull/5661) @@ -310,7 +340,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 23 December 2022 - build: remove lint steps from production Docker build [`#5623`](https://github.com/opengovsg/FormSG/pull/5623) -- feat: add form type, user agent and attachment types to public switchback form [`#5582`](https://github.com/opengovsg/FormSG/pull/5582) +- feat: add form type, user agent and attachment types to public switchback form [`#5582`](https://github.com/opengovsg/FormSG/pull/5582) - ci: add node options to src_e2e test [`#5625`](https://github.com/opengovsg/FormSG/pull/5625) - chore(deps-dev): bump @babel/core from 7.20.2 to 7.20.7 [`#5618`](https://github.com/opengovsg/FormSG/pull/5618) - fix(deps): bump @sentry/browser from 7.28.0 to 7.28.1 [`#5617`](https://github.com/opengovsg/FormSG/pull/5617) @@ -361,7 +391,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump formsg-javascript-sdk from 0.9.0 to 0.10.0 [`#5578`](https://github.com/opengovsg/FormSG/pull/5578) - fix: remove unecessary import [`#5576`](https://github.com/opengovsg/FormSG/pull/5576) - feat: upgrade axios to 1.2.1 [`#5568`](https://github.com/opengovsg/FormSG/pull/5568) -- chore: merge v6.23.0 into develop [`#5574`](https://github.com/opengovsg/FormSG/pull/5574) +- chore: merge v6.23.0 into develop [`#5574`](https://github.com/opengovsg/FormSG/pull/5574) - chore: bump version to v6.24.0 [`13fa4f6`](https://github.com/opengovsg/FormSG/commit/13fa4f6eb7854ef91e632d8e316d180e57bb759b) - Revert "fix(deps): bump sqs-consumer from 5.7.0 to 6.1.0 (#5591)" [`088902d`](https://github.com/opengovsg/FormSG/commit/088902d74fe8fde365859342aaacc7b735a777a3) @@ -381,7 +411,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: push static assets to s3 [`#5595`](https://github.com/opengovsg/FormSG/pull/5595) - fix: return 404 for unmatched static assets [`#5579`](https://github.com/opengovsg/FormSG/pull/5579) - test: fix selectors for tests [`#5597`](https://github.com/opengovsg/FormSG/pull/5597) -- - fix: trim email input in frontend and backend [`#5581`](https://github.com/opengovsg/FormSG/pull/5581) +- * fix: trim email input in frontend and backend [`#5581`](https://github.com/opengovsg/FormSG/pull/5581) #### [v6.23.1](https://github.com/opengovsg/FormSG/compare/v6.23.0...v6.23.1) @@ -442,7 +472,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: render saved title and esrvcId [`#5506`](https://github.com/opengovsg/FormSG/pull/5506) - chore(deps-dev): bump @types/lodash from 4.14.190 to 4.14.191 in /shared [`#5509`](https://github.com/opengovsg/FormSG/pull/5509) - fix: update feedback modal and switch env functionality [`#5411`](https://github.com/opengovsg/FormSG/pull/5411) -- fix: extend tags in then show logic blocks to be full width [`#5507`](https://github.com/opengovsg/FormSG/pull/5507) +- fix: extend tags in then show logic blocks to be full width [`#5507`](https://github.com/opengovsg/FormSG/pull/5507) - build: Release v6.20.0 [`#5496`](https://github.com/opengovsg/FormSG/pull/5496) - chore: bump version to v6.21.0 [`3d189cf`](https://github.com/opengovsg/FormSG/commit/3d189cfdc7c105eb31987d31c1b38cb82f402952) - chore: fix changelog due to recut in v6.19.0 [`769efee`](https://github.com/opengovsg/FormSG/commit/769efee7d3552d5d675c1b81ed3320a931aafcb8) @@ -473,7 +503,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump @typescript-eslint/parser from 5.44.0 to 5.45.0 in /shared [`#5477`](https://github.com/opengovsg/FormSG/pull/5477) - chore(deps-dev): bump csv-parse from 5.3.1 to 5.3.3 [`#5475`](https://github.com/opengovsg/FormSG/pull/5475) - fix: extend MyInfo login expiry to match env var [`#5464`](https://github.com/opengovsg/FormSG/pull/5464) -- chore: merge hotfix release v6.18.4 back to develop [`#5472`](https://github.com/opengovsg/FormSG/pull/5472) +- chore: merge hotfix release v6.18.4 back to develop [`#5472`](https://github.com/opengovsg/FormSG/pull/5472) - feat: improve admin storage mode response printability [`#5460`](https://github.com/opengovsg/FormSG/pull/5460) - chore(deps-dev): bump @babel/preset-env from 7.19.4 to 7.20.2 [`#5463`](https://github.com/opengovsg/FormSG/pull/5463) - test: add email submission e2e tests [`#5162`](https://github.com/opengovsg/FormSG/pull/5162) @@ -497,7 +527,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump jose from 4.10.4 to 4.11.0 [`#5418`](https://github.com/opengovsg/FormSG/pull/5418) - chore(deps-dev): bump @babel/core from 7.19.6 to 7.20.2 [`#5420`](https://github.com/opengovsg/FormSG/pull/5420) - fix(deps): bump express-rate-limit from 6.6.0 to 6.7.0 [`#5412`](https://github.com/opengovsg/FormSG/pull/5412) -- chore: merge release v6.18.0 into develop [`#5410`](https://github.com/opengovsg/FormSG/pull/5410) +- chore: merge release v6.18.0 into develop [`#5410`](https://github.com/opengovsg/FormSG/pull/5410) - fix(deps): bump moment-timezone from 0.5.38 to 0.5.39 [`#5413`](https://github.com/opengovsg/FormSG/pull/5413) - fix(deps): bump aws-sdk from 2.1251.0 to 2.1255.0 [`#5415`](https://github.com/opengovsg/FormSG/pull/5415) - fix(deps): bump loader-utils from 1.4.0 to 1.4.2 [`#5416`](https://github.com/opengovsg/FormSG/pull/5416) @@ -582,7 +612,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore: upgrade to node 18 [`#5344`](https://github.com/opengovsg/FormSG/pull/5344) - feat: add logging to capture SNS notification errors [`#5358`](https://github.com/opengovsg/FormSG/pull/5358) - fix: add frontend and backend validation for empty field titles [`#5351`](https://github.com/opengovsg/FormSG/pull/5351) -- chore: merge release v6.16.0 into develop [`#5347`](https://github.com/opengovsg/FormSG/pull/5347) +- chore: merge release v6.16.0 into develop [`#5347`](https://github.com/opengovsg/FormSG/pull/5347) - fix(deps): bump loader-utils from 1.4.0 to 1.4.1 [`#5350`](https://github.com/opengovsg/FormSG/pull/5350) - fix(deps): bump @opengovsg/spcp-auth-client from 1.4.19 to 1.4.20 [`#5354`](https://github.com/opengovsg/FormSG/pull/5354) - chore(deps-dev): bump @types/lodash from 4.14.187 to 4.14.188 in /shared [`#5356`](https://github.com/opengovsg/FormSG/pull/5356) @@ -600,7 +630,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: make feedback compulsory for public respondents [`#5339`](https://github.com/opengovsg/FormSG/pull/5339) - feat: allow entire form response to be viewed when printed [`#5341`](https://github.com/opengovsg/FormSG/pull/5341) - ref: move meta tag images into static/images folder [`#5338`](https://github.com/opengovsg/FormSG/pull/5338) -- chore: merge release v6.15.0 into develop [`#5337`](https://github.com/opengovsg/FormSG/pull/5337) +- chore: merge release v6.15.0 into develop [`#5337`](https://github.com/opengovsg/FormSG/pull/5337) - build: release v6.15.0 [`#5334`](https://github.com/opengovsg/FormSG/pull/5334) - chore: bump version to v6.16.0 [`ba14785`](https://github.com/opengovsg/FormSG/commit/ba147857c70de884c24e5db506d2b98582615a33) @@ -613,7 +643,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump babel-loader from 8.2.5 to 8.3.0 [`#5332`](https://github.com/opengovsg/FormSG/pull/5332) - fix: decimal field validation allows 0 to be the min or max [`#5330`](https://github.com/opengovsg/FormSG/pull/5330) - chore(deps-dev): bump @types/lodash from 4.14.186 to 4.14.187 [`#5326`](https://github.com/opengovsg/FormSG/pull/5326) -- chore: merge release v6.14.0 into develop [`#5324`](https://github.com/opengovsg/FormSG/pull/5324) +- chore: merge release v6.14.0 into develop [`#5324`](https://github.com/opengovsg/FormSG/pull/5324) - fix(deps): bump @aws-sdk/client-cloudwatch-logs from 3.200.0 to 3.201.0 [`#5327`](https://github.com/opengovsg/FormSG/pull/5327) - fix(deps): bump dd-trace from 3.6.0 to 3.7.0 [`#5328`](https://github.com/opengovsg/FormSG/pull/5328) - build: release v6.14.0 [`#5323`](https://github.com/opengovsg/FormSG/pull/5323) @@ -633,7 +663,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump @babel/runtime from 7.20.0 to 7.20.1 [`#5306`](https://github.com/opengovsg/FormSG/pull/5306) - fix(deps): bump @sentry/browser from 7.15.0 to 7.17.3 [`#5305`](https://github.com/opengovsg/FormSG/pull/5305) - ci: use federated role [`#5304`](https://github.com/opengovsg/FormSG/pull/5304) -- chore: merge release v6.13.0 into develop [`#5298`](https://github.com/opengovsg/FormSG/pull/5298) +- chore: merge release v6.13.0 into develop [`#5298`](https://github.com/opengovsg/FormSG/pull/5298) - build: release v6.13.0 [`#5297`](https://github.com/opengovsg/FormSG/pull/5297) - chore: bump version to v6.14.0 [`598fb42`](https://github.com/opengovsg/FormSG/commit/598fb42dcc7da4d6d887c4cd4e5cf9f99d1c741d) @@ -661,7 +691,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump @babel/runtime from 7.19.4 to 7.20.0 [`#5277`](https://github.com/opengovsg/FormSG/pull/5277) - fix(deps): bump hot-shots from 9.2.0 to 9.3.0 [`#5274`](https://github.com/opengovsg/FormSG/pull/5274) - fix(deps): bump dd-trace from 3.5.0 to 3.6.0 [`#5273`](https://github.com/opengovsg/FormSG/pull/5273) -- build: merge v6.12.0 into develop [`#5268`](https://github.com/opengovsg/FormSG/pull/5268) +- build: merge v6.12.0 into develop [`#5268`](https://github.com/opengovsg/FormSG/pull/5268) - build: release v6.12.0 [`#5267`](https://github.com/opengovsg/FormSG/pull/5267) - chore: bump version to v6.13.0 [`5162d7e`](https://github.com/opengovsg/FormSG/commit/5162d7ecbf9dc61a21e1b76ac41465ab450807c9) - feat: add mode option to editForm [`979e3ea`](https://github.com/opengovsg/FormSG/commit/979e3ea49077f89ae3360d3acf7e34f2bfdc5453) @@ -678,7 +708,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump openid-client from 5.1.10 to 5.2.1 [`#5263`](https://github.com/opengovsg/FormSG/pull/5263) - fix: add condition to submit bug report feedback form [`#5258`](https://github.com/opengovsg/FormSG/pull/5258) - chore: merge release v6.11.0 into develop (round 2, merge) [`#5259`](https://github.com/opengovsg/FormSG/pull/5259) -- chore: merge release v6.11.0 into develop [`#5255`](https://github.com/opengovsg/FormSG/pull/5255) +- chore: merge release v6.11.0 into develop [`#5255`](https://github.com/opengovsg/FormSG/pull/5255) - build: release v6.11.0 [`#5254`](https://github.com/opengovsg/FormSG/pull/5254) - chore: bump version to v6.12.0 [`6263ac6`](https://github.com/opengovsg/FormSG/commit/6263ac63a68a32c9855cbd93daa181b5814b6888) @@ -708,7 +738,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump jose from 4.10.0 to 4.10.3 [`#5237`](https://github.com/opengovsg/FormSG/pull/5237) - chore(deps-dev): bump @babel/core from 7.19.3 to 7.19.6 [`#5236`](https://github.com/opengovsg/FormSG/pull/5236) - fix: correctly filter 401 status responses in datadog RUM [`#5232`](https://github.com/opengovsg/FormSG/pull/5232) -- chore: merge release v6.9.0 into develop [`#5231`](https://github.com/opengovsg/FormSG/pull/5231) +- chore: merge release v6.9.0 into develop [`#5231`](https://github.com/opengovsg/FormSG/pull/5231) - build: release v6.9.0 [`#5228`](https://github.com/opengovsg/FormSG/pull/5228) - chore: bump version to v6.10.0 [`0a24b49`](https://github.com/opengovsg/FormSG/commit/0a24b49f404c82d24f22195a721e738b8d073d45) @@ -723,9 +753,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump @aws-sdk/client-cloudwatch-logs from 3.190.0 to 3.192.0 [`#5224`](https://github.com/opengovsg/FormSG/pull/5224) - feat: add breadcrumbs to admin form navbar [`#5190`](https://github.com/opengovsg/FormSG/pull/5190) - build: use new CD pipeline to allow for datadog source maps, add cache control [`#5225`](https://github.com/opengovsg/FormSG/pull/5225) -- chore: merge release v6.8.1 into develop [`#5222`](https://github.com/opengovsg/FormSG/pull/5222) +- chore: merge release v6.8.1 into develop [`#5222`](https://github.com/opengovsg/FormSG/pull/5222) - fix: update RUM percentages to 65%, prevent feedback form submission if feedback is empty [`#5220`](https://github.com/opengovsg/FormSG/pull/5220) -- chore: merge release v6.8.0 into develop [`#5221`](https://github.com/opengovsg/FormSG/pull/5221) +- chore: merge release v6.8.0 into develop [`#5221`](https://github.com/opengovsg/FormSG/pull/5221) - chore: bump version to v6.9.0 [`8d66b8b`](https://github.com/opengovsg/FormSG/commit/8d66b8bf84d4e11b7f086214add6fba22e64770b) #### [v6.8.1](https://github.com/opengovsg/FormSG/compare/v6.8.0...v6.8.1) @@ -789,7 +819,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: prevent benign frontend errors from being sent to datadog RUM [`#5188`](https://github.com/opengovsg/FormSG/pull/5188) - chore: merge release 6.6.1 into develop [`#5189`](https://github.com/opengovsg/FormSG/pull/5189) - fix: inject RUM session IDs into feedback form [`#5187`](https://github.com/opengovsg/FormSG/pull/5187) -- chore: merge release 6.6.0 back to develop [`#5184`](https://github.com/opengovsg/FormSG/pull/5184) +- chore: merge release 6.6.0 back to develop [`#5184`](https://github.com/opengovsg/FormSG/pull/5184) - chore: bump version to v6.7.0 [`9920ff0`](https://github.com/opengovsg/FormSG/commit/9920ff0ef2ff1a0d930d3262c0c4a87bad33dec2) #### [v6.6.1](https://github.com/opengovsg/FormSG/compare/v6.6.0...v6.6.1) @@ -964,7 +994,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(v2): upgrade chromium to 102.0.5005.182-r0 [`#4988`](https://github.com/opengovsg/FormSG/pull/4988) - fix(v2): add padding between form fields [`#4965`](https://github.com/opengovsg/FormSG/pull/4965) - feat: add extra aria text to denote the end of the form [`#4977`](https://github.com/opengovsg/FormSG/pull/4977) -- fix(v2): update react dev proxy port to port 5001, fix invalid dom tag nesting [`#4976`](https://github.com/opengovsg/FormSG/pull/4976) +- fix(v2): update react dev proxy port to port 5001, fix invalid dom tag nesting [`#4976`](https://github.com/opengovsg/FormSG/pull/4976) - fix(v2): extend empty workspace flexbox to fill screen [`#4964`](https://github.com/opengovsg/FormSG/pull/4964) - feat(v2): add single quote to CSV output [`#4950`](https://github.com/opengovsg/FormSG/pull/4950) - build: merge release 5.73.0 into v2/develop [`#4967`](https://github.com/opengovsg/FormSG/pull/4967) @@ -1054,7 +1084,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(v2): add and use NavigationTabs template components for admin form tab navigation [`#4601`](https://github.com/opengovsg/FormSG/pull/4601) - feat(v2): always enable e-service id box in auth settings [`#4576`](https://github.com/opengovsg/FormSG/pull/4576) - fix: set addMoreFields derived value so useEffect is stable [`#4669`](https://github.com/opengovsg/FormSG/pull/4669) -- feat(v2): add better error messages for submission and network errors [`#4615`](https://github.com/opengovsg/FormSG/pull/4615) +- feat(v2): add better error messages for submission and network errors [`#4615`](https://github.com/opengovsg/FormSG/pull/4615) - fix: do not require eservice id for sgid form [`#4671`](https://github.com/opengovsg/FormSG/pull/4671) - fix(v2): bunch of fixes in admin builder styling [`#4605`](https://github.com/opengovsg/FormSG/pull/4605) - fix: local mongo replicaset host mismatch [`#4603`](https://github.com/opengovsg/FormSG/pull/4603) @@ -1069,7 +1099,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(form-v2): add switch-to-react url for admins [`#4577`](https://github.com/opengovsg/FormSG/pull/4577) - fix(form-v2): add loading state for form builder, misc improvements [`#4525`](https://github.com/opengovsg/FormSG/pull/4525) - feat(v2): update create storage mode form modal to new design [`#4493`](https://github.com/opengovsg/FormSG/pull/4493) -- feat: add tag input component [`#4509`](https://github.com/opengovsg/FormSG/pull/4509) +- feat: add tag input component [`#4509`](https://github.com/opengovsg/FormSG/pull/4509) - fix(form-v2): refactor to avoid repopulating design store when cache is invalidated [`#4554`](https://github.com/opengovsg/FormSG/pull/4554) - fix: remove flaky unit test [`#4578`](https://github.com/opengovsg/FormSG/pull/4578) - fix(form-v2): add default values to field templates to ensure optional fields can be submitted [`#4546`](https://github.com/opengovsg/FormSG/pull/4546) @@ -1144,7 +1174,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: update admin logic OTP to not resend immediately and update copy of verified fields to show correct time of 30 minute validity [`#4405`](https://github.com/opengovsg/FormSG/pull/4405) - feat(form-v2): replace icon with BiHomeCircle [`#4280`](https://github.com/opengovsg/FormSG/pull/4280) - fix(form-v2): form preview should open in new tab [`#4400`](https://github.com/opengovsg/FormSG/pull/4400) -- copy(form-v2): multiple edits [`#4318`](https://github.com/opengovsg/FormSG/pull/4318) +- copy(form-v2): multiple edits [`#4318`](https://github.com/opengovsg/FormSG/pull/4318) - fix: update copy for empty logic page [`#4396`](https://github.com/opengovsg/FormSG/pull/4396) - fix: copy update for create-form modal [`#4394`](https://github.com/opengovsg/FormSG/pull/4394) - fix(form-v2): add correct html titles to feature tour tooltip buttons [`#4388`](https://github.com/opengovsg/FormSG/pull/4388) @@ -1204,7 +1234,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: add progress indicator styles [`#4019`](https://github.com/opengovsg/FormSG/pull/4019) - fix(v2): prevent everchanging snapshots from triggering chromatic regressions [`#4004`](https://github.com/opengovsg/FormSG/pull/4004) - feat: add question numbers to show in form builder tool [`#4020`](https://github.com/opengovsg/FormSG/pull/4020) -- chore: merge release v5.62.0 into form-v2/develop [`#4010`](https://github.com/opengovsg/FormSG/pull/4010) +- chore: merge release v5.62.0 into form-v2/develop [`#4010`](https://github.com/opengovsg/FormSG/pull/4010) - feat(v2/storage): add tests for CsvGenerator classes [`#3975`](https://github.com/opengovsg/FormSG/pull/3975) - feat: add pagination component and logic [`#3992`](https://github.com/opengovsg/FormSG/pull/3992) - feat(v2): login page redesign again, add AppGrid template [`#3978`](https://github.com/opengovsg/FormSG/pull/3978) @@ -1245,9 +1275,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(v2): add share form feature [`#3828`](https://github.com/opengovsg/FormSG/pull/3828) - feat(v2): allow creation of rating fields in admin form builder, fix nested updates [`#3834`](https://github.com/opengovsg/FormSG/pull/3834) - feat(v2): prevent submission and show message on public form when logic is triggered [`#3813`](https://github.com/opengovsg/FormSG/pull/3813) -- feat(v2): allow creation of dropdown fields in admin form builder [`#3817`](https://github.com/opengovsg/FormSG/pull/3817) +- feat(v2): allow creation of dropdown fields in admin form builder [`#3817`](https://github.com/opengovsg/FormSG/pull/3817) - feat(v2): add react-i18next and associated boilerplate for interface … [`#3823`](https://github.com/opengovsg/FormSG/pull/3823) -- feat(v2): allow creation of long and short answer fields in admin form builder [`#3806`](https://github.com/opengovsg/FormSG/pull/3806) +- feat(v2): allow creation of long and short answer fields in admin form builder [`#3806`](https://github.com/opengovsg/FormSG/pull/3806) - feat(v2/collab): allow removal of self from form collaborators [`#3802`](https://github.com/opengovsg/FormSG/pull/3802) - feat(v2/collab): render viewer-only collaborator modal [`#3793`](https://github.com/opengovsg/FormSG/pull/3793) - feat(v2): allow creation of homeno fields in admin form builder [`#3804`](https://github.com/opengovsg/FormSG/pull/3804) @@ -1277,7 +1307,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: render govt masthead component [`#3644`](https://github.com/opengovsg/FormSG/pull/3644) - feat(v2): add Settings Webhooks tab [`#3716`](https://github.com/opengovsg/FormSG/pull/3716) - feat(v2): builder design review; stories for Empty, AllFields builders [`#3695`](https://github.com/opengovsg/FormSG/pull/3695) -- feat(v2/epic): implement (partial) public form submission feature [`#3738`](https://github.com/opengovsg/FormSG/pull/3738) +- feat(v2/epic): implement (partial) public form submission feature [`#3738`](https://github.com/opengovsg/FormSG/pull/3738) - feat(v2/submit): design and squash fixes [`#3739`](https://github.com/opengovsg/FormSG/pull/3739) - feat: create country field story [`#3705`](https://github.com/opengovsg/FormSG/pull/3705) - refactor(v2/submit-1): pass input types to react-hook-form generics for better validation [`#3736`](https://github.com/opengovsg/FormSG/pull/3736) @@ -1342,7 +1372,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(builder/4): add form field creation feature in form builder, extend create field API with positional arg [`#3135`](https://github.com/opengovsg/FormSG/pull/3135) - feat(builder/3): allow form fields reordering in form builder [`#3134`](https://github.com/opengovsg/FormSG/pull/3134) - feat(builder/2): add checkbox field preview when editing field in form builder [`#3131`](https://github.com/opengovsg/FormSG/pull/3131) -- feat(builder/1): add initial field preview (only SectionField) when editing field in form builder [`#3130`](https://github.com/opengovsg/FormSG/pull/3130) +- feat(builder/1): add initial field preview (only SectionField) when editing field in form builder [`#3130`](https://github.com/opengovsg/FormSG/pull/3130) - feat(v2): impl initial create form modal feature, update Tile component [`#3048`](https://github.com/opengovsg/FormSG/pull/3048) - feat(v2): [Date1] add DateRangePicker/Input component [`#3199`](https://github.com/opengovsg/FormSG/pull/3199) - feat(v2): [Date0] add single date DatePicker component [`#3185`](https://github.com/opengovsg/FormSG/pull/3185) @@ -1351,7 +1381,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(v2): add initial public form authentication feature [`#3210`](https://github.com/opengovsg/FormSG/pull/3210) - feat(v2): update form mode display in settings to conform to design [`#3209`](https://github.com/opengovsg/FormSG/pull/3209) - feat(v2): Set up web workers on React [`#3125`](https://github.com/opengovsg/FormSG/pull/3125) -- feat(v2): update Tile and Badge styling to better fit design [`#3179`](https://github.com/opengovsg/FormSG/pull/3179) +- feat(v2): update Tile and Badge styling to better fit design [`#3179`](https://github.com/opengovsg/FormSG/pull/3179) - feat(v2): add WorkspacePage (only layout, no business logic yet) [`#3045`](https://github.com/opengovsg/FormSG/pull/3045) - feat(v2): update Menu styling to better fit design [`#3178`](https://github.com/opengovsg/FormSG/pull/3178) - chore(v2): update npm packages to their latest versions (except storybook) [`#3168`](https://github.com/opengovsg/FormSG/pull/3168) @@ -1375,7 +1405,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(FormSettings/4): add storage mode form activation modal [`#2939`](https://github.com/opengovsg/FormSG/pull/2939) - feat(PublicFormPage/3): add FormSections rendering and scroll handling [`#2888`](https://github.com/opengovsg/FormSG/pull/2888) - feat(PublicFormPage/2): add FormStartPage component [`#2885`](https://github.com/opengovsg/FormSG/pull/2885) -- feat(FormSettings/3): add email-form specific email setting input [`#2891`](https://github.com/opengovsg/FormSG/pull/2891) +- feat(FormSettings/3): add email-form specific email setting input [`#2891`](https://github.com/opengovsg/FormSG/pull/2891) - feat(FormSettings/2): add remaining general settings toggles [`#2890`](https://github.com/opengovsg/FormSG/pull/2890) - feat(FormSettings/1): create initial FormSettingsPage [`#2889`](https://github.com/opengovsg/FormSG/pull/2889) - feat(FormSettings/0): add admin form route and layout scaffolding [`#2762`](https://github.com/opengovsg/FormSG/pull/2762) @@ -1523,7 +1553,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump winston from 3.8.1 to 3.8.2 [`#4881`](https://github.com/opengovsg/FormSG/pull/4881) - chore(deps-dev): bump @babel/core from 7.18.10 to 7.19.1 [`#4868`](https://github.com/opengovsg/FormSG/pull/4868) - chore(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.1 [`#4871`](https://github.com/opengovsg/FormSG/pull/4871) -- build: merge release v5.71.0 into develop [`#4875`](https://github.com/opengovsg/FormSG/pull/4875) +- build: merge release v5.71.0 into develop [`#4875`](https://github.com/opengovsg/FormSG/pull/4875) - build: release v5.71.0 [`#4869`](https://github.com/opengovsg/FormSG/pull/4869) - chore: bump version to v5.72.0 [`90471df`](https://github.com/opengovsg/FormSG/commit/90471df62d7b7dec501771f2636cdb8f27a2f0d0) @@ -1651,7 +1681,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - 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: 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) @@ -1811,7 +1841,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump eslint-plugin-prettier in /shared [`#4067`](https://github.com/opengovsg/FormSG/pull/4067) - fix(deps): bump type-fest from 2.14.0 to 2.15.1 in /shared [`#4068`](https://github.com/opengovsg/FormSG/pull/4068) - fix(deps): bump nocache from 3.0.3 to 3.0.4 [`#4059`](https://github.com/opengovsg/FormSG/pull/4059) -- feat: enable datadog APM [`#3908`](https://github.com/opengovsg/FormSG/pull/3908) +- feat: enable datadog APM [`#3908`](https://github.com/opengovsg/FormSG/pull/3908) - fix(deps): bump @opengovsg/sgid-client from 0.0.12 to 1.0.3 [`#3905`](https://github.com/opengovsg/FormSG/pull/3905) - chore(deps-dev): bump @babel/core from 7.17.12 to 7.18.5 [`#4052`](https://github.com/opengovsg/FormSG/pull/4052) - chore(deps-dev): bump core-js from 3.22.5 to 3.23.3 [`#4053`](https://github.com/opengovsg/FormSG/pull/4053) @@ -1925,7 +1955,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump zod from 3.14.4 to 3.15.1 in /shared [`#3835`](https://github.com/opengovsg/FormSG/pull/3835) - fix(deps): bump libphonenumber-js from 1.9.52 to 1.9.53 in /shared [`#3836`](https://github.com/opengovsg/FormSG/pull/3836) - feat: track Twilio metrics to DataDog [`#3824`](https://github.com/opengovsg/FormSG/pull/3824) -- chore: merge release v5.57.2 back to develop [`#3833`](https://github.com/opengovsg/FormSG/pull/3833) +- chore: merge release v5.57.2 back to develop [`#3833`](https://github.com/opengovsg/FormSG/pull/3833) - feat: hotfix: validate SNS notification with AWS lib rather than custom implementation [`#3832`](https://github.com/opengovsg/FormSG/pull/3832) - chore: merge release v5.57.1 back to develop [`#3831`](https://github.com/opengovsg/FormSG/pull/3831) - build: hotfix release v5.57.1 [`#3829`](https://github.com/opengovsg/FormSG/pull/3829) @@ -2124,7 +2154,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat(BounceController): log SNS topic confirmation notification emails [`#3525`](https://github.com/opengovsg/FormSG/pull/3525) - fix(deps): bump dotenv from 10.0.0 to 16.0.0 [`#3377`](https://github.com/opengovsg/FormSG/pull/3377) - feat: add `/client/env` API route for sending client env vars as JSON [`#3505`](https://github.com/opengovsg/FormSG/pull/3505) -- feat: add positional argument to create form field API [`#3486`](https://github.com/opengovsg/FormSG/pull/3486) +- feat: add positional argument to create form field API [`#3486`](https://github.com/opengovsg/FormSG/pull/3486) - fix(ci/deploy): truncate deploy description correctly [`#3524`](https://github.com/opengovsg/FormSG/pull/3524) - fix(deps): bump aws-sdk from 2.1081.0 to 2.1082.0 [`#3523`](https://github.com/opengovsg/FormSG/pull/3523) - chore(deps-dev): bump @types/lodash from 4.14.178 to 4.14.179 [`#3522`](https://github.com/opengovsg/FormSG/pull/3522) @@ -3299,7 +3329,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - refactor(auth.client): (1) extract email validation and send login otp flow to Typescript [`#2084`](https://github.com/opengovsg/FormSG/pull/2084) - feat: store only user ID in session [`#1849`](https://github.com/opengovsg/FormSG/pull/1849) - fix: return storage mode submission version when when retrieving from server [`#2112`](https://github.com/opengovsg/FormSG/pull/2112) -- refactor: replace $resource in angularjs form-api.client.factory.js with typescript FormService [`#1947`](https://github.com/opengovsg/FormSG/pull/1947) +- refactor: replace $resource in angularjs form-api.client.factory.js with typescript FormService [`#1947`](https://github.com/opengovsg/FormSG/pull/1947) - refactor(ts-migration): ndjsonstream and process-decrypted-content [`#2111`](https://github.com/opengovsg/FormSG/pull/2111) - chore: remove redundant ValidationOption object properties for short text, long text and number fields [`#2040`](https://github.com/opengovsg/FormSG/pull/2040) - chore(deps-dev): bump @types/node from 14.17.2 to 14.17.3 [`#2108`](https://github.com/opengovsg/FormSG/pull/2108) @@ -3327,7 +3357,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(adminsubmissionsservice): renamed form to submissions to reflect context [`#2098`](https://github.com/opengovsg/FormSG/pull/2098) - feat: enable retries for webhooks [`#2093`](https://github.com/opengovsg/FormSG/pull/2093) - feat: log form updates [`#2063`](https://github.com/opengovsg/FormSG/pull/2063) -- chore: remove endPage.buttons key from database [`#2087`](https://github.com/opengovsg/FormSG/pull/2087) +- chore: remove endPage.buttons key from database [`#2087`](https://github.com/opengovsg/FormSG/pull/2087) - feat: sort responses for csv download according to creation date [`#2028`](https://github.com/opengovsg/FormSG/pull/2028) - fix(deps): downgrade typescript to 4.2.4 and pin [`#2097`](https://github.com/opengovsg/FormSG/pull/2097) - chore(deps-dev): bump @typescript-eslint/eslint-plugin [`#2095`](https://github.com/opengovsg/FormSG/pull/2095) @@ -3499,7 +3529,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump core-js from 3.11.3 to 3.12.0 [`#1817`](https://github.com/opengovsg/FormSG/pull/1817) - fix(deps): bump aws-sdk from 2.900.0 to 2.901.0 [`#1816`](https://github.com/opengovsg/FormSG/pull/1816) - feat(email-submission): separate error logging for db and state checks [`#1813`](https://github.com/opengovsg/FormSG/pull/1813) -- feat(admin-form): individual form field api [`#1799`](https://github.com/opengovsg/FormSG/pull/1799) +- feat(admin-form): individual form field api [`#1799`](https://github.com/opengovsg/FormSG/pull/1799) - chore(deps-dev): bump @types/bluebird from 3.5.33 to 3.5.34 [`#1807`](https://github.com/opengovsg/FormSG/pull/1807) - chore(deps-dev): bump @types/node from 14.14.43 to 14.14.44 [`#1805`](https://github.com/opengovsg/FormSG/pull/1805) - fix(deps): bump aws-sdk from 2.899.0 to 2.900.0 [`#1809`](https://github.com/opengovsg/FormSG/pull/1809) @@ -3562,8 +3592,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump aws-sdk from 2.892.0 to 2.893.0 [`#1745`](https://github.com/opengovsg/FormSG/pull/1745) - feat: show highlights only if prefill is provided in url [`#1742`](https://github.com/opengovsg/FormSG/pull/1742) - fix: clone field to save before removing myinfo field info [`#1741`](https://github.com/opengovsg/FormSG/pull/1741) -- fix: convert form field responses to field class [`#1739`](https://github.com/opengovsg/FormSG/pull/1739) -- refactor(test): integration and unit tests for redirect [`#1728`](https://github.com/opengovsg/FormSG/pull/1728) +- fix: convert form field responses to field class [`#1739`](https://github.com/opengovsg/FormSG/pull/1739) +- refactor(test): integration and unit tests for redirect [`#1728`](https://github.com/opengovsg/FormSG/pull/1728) - feat: prefill mainstream launch [`#1702`](https://github.com/opengovsg/FormSG/pull/1702) - fix: update MyInfo field count correctly, show correct error [`#1738`](https://github.com/opengovsg/FormSG/pull/1738) - refactor: use shared DateSelectedValidation enum instead of DATE_VALIDATION_OPTIONS object [`#1724`](https://github.com/opengovsg/FormSG/pull/1724) @@ -3631,7 +3661,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump jest-mock-axios from 4.3.0 to 4.4.0 [`#1667`](https://github.com/opengovsg/FormSG/pull/1667) - chore(deps-dev): bump date-fns from 2.21.0 to 2.21.1 [`#1662`](https://github.com/opengovsg/FormSG/pull/1662) - chore(deps-dev): bump @types/node from 14.14.37 to 14.14.41 [`#1657`](https://github.com/opengovsg/FormSG/pull/1657) -- refactor(email-submission/controller): refactored email submission [`#1594`](https://github.com/opengovsg/FormSG/pull/1594) +- refactor(email-submission/controller): refactored email submission [`#1594`](https://github.com/opengovsg/FormSG/pull/1594) - fix(deps): bump aws-sdk from 2.886.0 to 2.888.0 [`#1656`](https://github.com/opengovsg/FormSG/pull/1656) - fix(deps): bump opossum from 6.0.0 to 6.0.1 [`#1658`](https://github.com/opengovsg/FormSG/pull/1658) - fix: jest memory leak [`#1659`](https://github.com/opengovsg/FormSG/pull/1659) @@ -3651,7 +3681,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump date-fns from 2.20.2 to 2.20.3 [`#1637`](https://github.com/opengovsg/FormSG/pull/1637) - fix(deps): bump aws-sdk from 2.884.0 to 2.885.0 [`#1636`](https://github.com/opengovsg/FormSG/pull/1636) - chore: merge release v5.6.0 back to develop [`#1632`](https://github.com/opengovsg/FormSG/pull/1632) -- refactor(feedback-api): duplicate adminform feedback endpoints for /api/v3 [`#1589`](https://github.com/opengovsg/FormSG/pull/1589) +- refactor(feedback-api): duplicate adminform feedback endpoints for /api/v3 [`#1589`](https://github.com/opengovsg/FormSG/pull/1589) - refactor(frontend-api): duplicate frontend client endpoints to new /api/v3 router [`#1574`](https://github.com/opengovsg/FormSG/pull/1574) - chore: bump version to 5.7.0 [`6f91f00`](https://github.com/opengovsg/FormSG/commit/6f91f0027dbe90289e083d533e90634018798b83) - fix: merge conflict from merging with develop [`9f0930e`](https://github.com/opengovsg/FormSG/commit/9f0930e6665a5e635fe6187e031c3c5ea50dfc41) @@ -3939,7 +3969,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump @types/node from 14.14.31 to 14.14.32 [`#1300`](https://github.com/opengovsg/FormSG/pull/1300) - feat: Add submission limits for storage mode form submissions [`#1268`](https://github.com/opengovsg/FormSG/pull/1268) - chore(deps-dev): bump ts-jest from 26.5.2 to 26.5.3 [`#1295`](https://github.com/opengovsg/FormSG/pull/1295) -- chore: change copy & insert secretkeyloss golink [`#1293`](https://github.com/opengovsg/FormSG/pull/1293) +- chore: change copy & insert secretkeyloss golink [`#1293`](https://github.com/opengovsg/FormSG/pull/1293) - chore(deps-dev): bump testcafe from 1.11.0 to 1.12.0 [`#1294`](https://github.com/opengovsg/FormSG/pull/1294) - fix(deps): bump aws-info from 1.1.0 to 1.2.0 [`#1290`](https://github.com/opengovsg/FormSG/pull/1290) - chore(deps-dev): bump eslint from 7.20.0 to 7.21.0 [`#1289`](https://github.com/opengovsg/FormSG/pull/1289) @@ -4036,7 +4066,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: Hotfix v4.32.1 -- split mail by semicolon in addition to comma when validating [`#222`](https://github.com/opengovsg/FormSG/pull/222) - feat: Release v4.32.0 [`#201`](https://github.com/opengovsg/FormSG/pull/201) - Release v4.31.0 - improve docs, log IP, fix tests [`#152`](https://github.com/opengovsg/FormSG/pull/152) -- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) +- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) - build: Release 4.30.3 - Typescript migrations, filter storage mode responses by submission id [`#123`](https://github.com/opengovsg/FormSG/pull/123) - Release 4.30.2 - fix AWS endpoint and /emailnotifications log group [`#78`](https://github.com/opengovsg/FormSG/pull/78) - build: Release 4.30.1 - Fix field creation on old clients [`#74`](https://github.com/opengovsg/FormSG/pull/74) @@ -4056,7 +4086,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 23 February 2021 -- fix: add \_id key in permissionList object for updateForm validator [`#1224`](https://github.com/opengovsg/FormSG/pull/1224) +- fix: add _id key in permissionList object for updateForm validator [`#1224`](https://github.com/opengovsg/FormSG/pull/1224) - chore: use formsg-sdk beta release [`#1219`](https://github.com/opengovsg/FormSG/pull/1219) - chore(deps-dev): bump csv-parse from 4.15.1 to 4.15.3 [`#1213`](https://github.com/opengovsg/FormSG/pull/1213) - refactor: move addLogin method to Billing module [`#1195`](https://github.com/opengovsg/FormSG/pull/1195) @@ -4417,7 +4447,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: Hotfix v4.32.1 -- split mail by semicolon in addition to comma when validating [`#222`](https://github.com/opengovsg/FormSG/pull/222) - feat: Release v4.32.0 [`#201`](https://github.com/opengovsg/FormSG/pull/201) - Release v4.31.0 - improve docs, log IP, fix tests [`#152`](https://github.com/opengovsg/FormSG/pull/152) -- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) +- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) - build: Release 4.30.3 - Typescript migrations, filter storage mode responses by submission id [`#123`](https://github.com/opengovsg/FormSG/pull/123) - Release 4.30.2 - fix AWS endpoint and /emailnotifications log group [`#78`](https://github.com/opengovsg/FormSG/pull/78) - build: Release 4.30.1 - Fix field creation on old clients [`#74`](https://github.com/opengovsg/FormSG/pull/74) @@ -4496,10 +4526,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump eslint-plugin-simple-import-sort [`#820`](https://github.com/opengovsg/FormSG/pull/820) - ref: migrate create new form api flow to TypeScript [`#806`](https://github.com/opengovsg/FormSG/pull/806) - chore(deps-dev): bump @types/jest from 26.0.15 to 26.0.16 [`#812`](https://github.com/opengovsg/FormSG/pull/812) -- ref: migrate copy template form flow to TypeScript [`#793`](https://github.com/opengovsg/FormSG/pull/793) +- ref: migrate copy template form flow to TypeScript [`#793`](https://github.com/opengovsg/FormSG/pull/793) - fix(deps): bump validator from 13.1.17 to 13.5.1 [`#811`](https://github.com/opengovsg/FormSG/pull/811) - ref: migrate duplicate admin form endpoint to TypeScript [`#789`](https://github.com/opengovsg/FormSG/pull/789) -- ref: migrate endpoint for getting admin form to TypeScript [`#807`](https://github.com/opengovsg/FormSG/pull/807) +- ref: migrate endpoint for getting admin form to TypeScript [`#807`](https://github.com/opengovsg/FormSG/pull/807) - chore(deps-dev): bump eslint-config-prettier from 6.15.0 to 7.0.0 [`#810`](https://github.com/opengovsg/FormSG/pull/810) - chore: enhance jest test reliability [`#800`](https://github.com/opengovsg/FormSG/pull/800) - docs: remove dangling commas from mongo scripts [`#794`](https://github.com/opengovsg/FormSG/pull/794) @@ -4556,7 +4586,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: Hotfix v4.32.1 -- split mail by semicolon in addition to comma when validating [`#222`](https://github.com/opengovsg/FormSG/pull/222) - feat: Release v4.32.0 [`#201`](https://github.com/opengovsg/FormSG/pull/201) - Release v4.31.0 - improve docs, log IP, fix tests [`#152`](https://github.com/opengovsg/FormSG/pull/152) -- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) +- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) - build: Release 4.30.3 - Typescript migrations, filter storage mode responses by submission id [`#123`](https://github.com/opengovsg/FormSG/pull/123) - Release 4.30.2 - fix AWS endpoint and /emailnotifications log group [`#78`](https://github.com/opengovsg/FormSG/pull/78) - build: Release 4.30.1 - Fix field creation on old clients [`#74`](https://github.com/opengovsg/FormSG/pull/74) @@ -4596,8 +4626,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump winston-cloudwatch from 2.3.2 to 2.4.0 [`#728`](https://github.com/opengovsg/FormSG/pull/728) - refactor: migrate mobile number validator to ts [`#713`](https://github.com/opengovsg/FormSG/pull/713) - chore(deps-dev): bump ts-jest from 26.4.1 to 26.4.4 [`#720`](https://github.com/opengovsg/FormSG/pull/720) -- refactor: migrate rating validator to ts [`#724`](https://github.com/opengovsg/FormSG/pull/724) -- refactor: migrate radio button validator to ts [`#723`](https://github.com/opengovsg/FormSG/pull/723) +- refactor: migrate rating validator to ts [`#724`](https://github.com/opengovsg/FormSG/pull/724) +- refactor: migrate radio button validator to ts [`#723`](https://github.com/opengovsg/FormSG/pull/723) - feat: migrate get encrypt metadata endpoint controller to TypeScript [`#711`](https://github.com/opengovsg/FormSG/pull/711) - fix(AdminFormRoutes): add Joi validation on /submission endpoint [`#712`](https://github.com/opengovsg/FormSG/pull/712) - chore(deps-dev): bump prettier from 2.1.2 to 2.2.0 [`#709`](https://github.com/opengovsg/FormSG/pull/709) @@ -4678,7 +4708,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - ref: migrate fetch form submission counts flow to Typescript [`#592`](https://github.com/opengovsg/FormSG/pull/592) - fix: resolve & in url upon redirect, shift prefill to textfield component [`#569`](https://github.com/opengovsg/FormSG/pull/569) - feat(monitoring): add memory monitoring to EC2 instances [`#620`](https://github.com/opengovsg/FormSG/pull/620) -- ref: migrate createPresignedPost endpoint for logos to TypeScript [`#607`](https://github.com/opengovsg/FormSG/pull/607) +- ref: migrate createPresignedPost endpoint for logos to TypeScript [`#607`](https://github.com/opengovsg/FormSG/pull/607) - fix: package.json & package-lock.json to reduce vulnerabilities [`#637`](https://github.com/opengovsg/FormSG/pull/637) - fix(deps): bump @sentry/browser from 5.24.2 to 5.27.3 [`#631`](https://github.com/opengovsg/FormSG/pull/631) - fix(deps): bump helmet from 4.1.1 to 4.2.0 [`#624`](https://github.com/opengovsg/FormSG/pull/624) @@ -4745,7 +4775,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): upgrade Chromium and puppeteer-core [`#572`](https://github.com/opengovsg/FormSG/pull/572) - fix(deps): bump fp-ts from 2.8.3 to 2.8.5 [`#567`](https://github.com/opengovsg/FormSG/pull/567) - chore(deps-dev): bump @babel/core from 7.11.6 to 7.12.3 [`#536`](https://github.com/opengovsg/FormSG/pull/536) -- feat: add examples module to handle /examples endpoints [`#412`](https://github.com/opengovsg/FormSG/pull/412) +- feat: add examples module to handle /examples endpoints [`#412`](https://github.com/opengovsg/FormSG/pull/412) - fix(deps): bump aws-sdk from 2.770.0 to 2.783.0 [`#561`](https://github.com/opengovsg/FormSG/pull/561) - refactor: remove unused verified mobile beta check [`#556`](https://github.com/opengovsg/FormSG/pull/556) - refactor: create initial PublicFormController for handling feedback submission [`#525`](https://github.com/opengovsg/FormSG/pull/525) @@ -4772,7 +4802,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: Hotfix v4.32.1 -- split mail by semicolon in addition to comma when validating [`#222`](https://github.com/opengovsg/FormSG/pull/222) - feat: Release v4.32.0 [`#201`](https://github.com/opengovsg/FormSG/pull/201) - Release v4.31.0 - improve docs, log IP, fix tests [`#152`](https://github.com/opengovsg/FormSG/pull/152) -- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) +- Release 4.30.4 - revert filtering by submission ID [`#137`](https://github.com/opengovsg/FormSG/pull/137) - build: Release 4.30.3 - Typescript migrations, filter storage mode responses by submission id [`#123`](https://github.com/opengovsg/FormSG/pull/123) - Release 4.30.2 - fix AWS endpoint and /emailnotifications log group [`#78`](https://github.com/opengovsg/FormSG/pull/78) - build: Release 4.30.1 - Fix field creation on old clients [`#74`](https://github.com/opengovsg/FormSG/pull/74) @@ -4891,7 +4921,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: early return when validating empty email string [`#433`](https://github.com/opengovsg/FormSG/pull/433) - fix(deps): bump angular-cookies from 1.8.0 to 1.8.1 [`#419`](https://github.com/opengovsg/FormSG/pull/419) -- - /billing [`#426`](https://github.com/opengovsg/FormSG/pull/426) +- * /billing [`#426`](https://github.com/opengovsg/FormSG/pull/426) - chore: merge release v4.38.1 into develop [`#430`](https://github.com/opengovsg/FormSG/pull/430) - feat: soft-launch rate-limiting of API endpoints [`#389`](https://github.com/opengovsg/FormSG/pull/389) - refactor: use res.json or sendStatus for objects or empty body [`#424`](https://github.com/opengovsg/FormSG/pull/424) @@ -5020,7 +5050,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - refactor: migrate /auth endpoint handling to Typescript, Domain Driven Design [`#215`](https://github.com/opengovsg/FormSG/pull/215) - chore(deps-dev): bump stylelint-config-prettier from 8.0.1 to 8.0.2 [`#280`](https://github.com/opengovsg/FormSG/pull/280) - fix: upgrade mongoose from 5.9.19 to 5.10.0 [`#289`](https://github.com/opengovsg/FormSG/pull/289) -- revert: reintroduce convict [`#287`](https://github.com/opengovsg/FormSG/pull/287) +- revert: reintroduce convict [`#287`](https://github.com/opengovsg/FormSG/pull/287) - revert(convict): "refactor: use convict for configuration (#190)" [`#285`](https://github.com/opengovsg/FormSG/pull/285) - chore(deps-dev): bump @typescript-eslint/eslint-plugin and @typescript-eslint/parser [`#246`](https://github.com/opengovsg/FormSG/pull/246) - feat: verified sms modal [`#274`](https://github.com/opengovsg/FormSG/pull/274) @@ -5073,7 +5103,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: fix linting not working on frontend code [`#217`](https://github.com/opengovsg/FormSG/pull/217) - fix: pass missing $state param into EditContactNumberModalController [`#216`](https://github.com/opengovsg/FormSG/pull/216) - feat: add Emergency Contact feature frontend [`#142`](https://github.com/opengovsg/FormSG/pull/142) -- refactor: convert webhook service to Typescript [`#83`](https://github.com/opengovsg/FormSG/pull/83) +- refactor: convert webhook service to Typescript [`#83`](https://github.com/opengovsg/FormSG/pull/83) - chore(deps-dev): bump sinon from 6.3.5 to 9.0.3 [`#207`](https://github.com/opengovsg/FormSG/pull/207) - feat: Share form secret keys across browser tabs using BroadcastChannel [`#203`](https://github.com/opengovsg/FormSG/pull/203) - chore: merge Release v4.32.0 into develop branch [`#205`](https://github.com/opengovsg/FormSG/pull/205) @@ -5101,7 +5131,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - feat: add core ApplicationError for express app [`#195`](https://github.com/opengovsg/FormSG/pull/195) - chore(deps-dev): bump typescript to 4.0.2 [`#196`](https://github.com/opengovsg/FormSG/pull/196) - fix(deps): bump font-awesome from 4.6.1 to 4.7.0 [`#186`](https://github.com/opengovsg/FormSG/pull/186) -- feat: migrate `util/response` to new Submission module (service, utils, etc) [`#176`](https://github.com/opengovsg/FormSG/pull/176) +- feat: migrate `util/response` to new Submission module (service, utils, etc) [`#176`](https://github.com/opengovsg/FormSG/pull/176) - feat: log form ID in GA event labels [`#154`](https://github.com/opengovsg/FormSG/pull/154) - refactor(verification): convert to module and typescriptify [`#172`](https://github.com/opengovsg/FormSG/pull/172) - feat: support &`;'" in form title [`#156`](https://github.com/opengovsg/FormSG/pull/156) @@ -5121,7 +5151,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump node-cache from 5.1.1 to 5.1.2 [`#145`](https://github.com/opengovsg/FormSG/pull/145) - feat: include user ip address when sending otp [`#147`](https://github.com/opengovsg/FormSG/pull/147) - chore(deps-dev): bump htmlhint from 0.11.0 to 0.14.1 [`#116`](https://github.com/opengovsg/FormSG/pull/116) -- fix(deps): bump angular-\* dependency packages from 1.7.9 to 1.8.0 [`#108`](https://github.com/opengovsg/FormSG/pull/108) +- fix(deps): bump angular-* dependency packages from 1.7.9 to 1.8.0 [`#108`](https://github.com/opengovsg/FormSG/pull/108) - feat: log IP, submissionId and formId together [`#130`](https://github.com/opengovsg/FormSG/pull/130) - fix(deps): bump crypto-js from 3.3.0 to 4.0.0 [`#110`](https://github.com/opengovsg/FormSG/pull/110) - [develop] Release 4.30.4 [`#138`](https://github.com/opengovsg/FormSG/pull/138) @@ -5174,7 +5204,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore: add dependabot.yml [`#82`](https://github.com/opengovsg/FormSG/pull/82) - feat: remove allowSms beta flag [`#73`](https://github.com/opengovsg/FormSG/pull/73) - feat(FormSchema): Document new indexes for form dashboard [`#77`](https://github.com/opengovsg/FormSG/pull/77) -- refactor: add \_id to all model interfaces [`#75`](https://github.com/opengovsg/FormSG/pull/75) +- refactor: add _id to all model interfaces [`#75`](https://github.com/opengovsg/FormSG/pull/75) - Bump version to 4.30.3 [`4e97a48`](https://github.com/opengovsg/FormSG/commit/4e97a48e52eefa621b1ef84f1d991d90e96a57b4) #### [v4.30.2](https://github.com/opengovsg/FormSG/compare/v4.30.1...v4.30.2) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ae46361f7a..74f73c230c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "form-frontend", - "version": "6.40.0", + "version": "6.41.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "form-frontend", - "version": "6.40.0", + "version": "6.41.0", "hasInstallScript": true, "dependencies": { "@chakra-ui/react": "^1.8.6", diff --git a/frontend/package.json b/frontend/package.json index 96ee0c2ec5..ff15de3ae3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "form-frontend", - "version": "6.40.0", + "version": "6.41.0", "homepage": ".", "private": true, "dependencies": { diff --git a/frontend/src/components/DatePicker/DatePickerContext.tsx b/frontend/src/components/DatePicker/DatePickerContext.tsx index 10b9fc14b4..37f3975b78 100644 --- a/frontend/src/components/DatePicker/DatePickerContext.tsx +++ b/frontend/src/components/DatePicker/DatePickerContext.tsx @@ -20,7 +20,6 @@ import { useMultiStyleConfig, } from '@chakra-ui/react' import { format, isValid, parse } from 'date-fns' -import { zonedTimeToUtc } from 'date-fns-tz' import { ThemeColorScheme } from '~theme/foundations/colours' import { useIsMobile } from '~hooks/useIsMobile' @@ -84,7 +83,6 @@ const useProvideDatePicker = ({ isReadOnly: isReadOnlyProp, isRequired: isRequiredProp, isInvalid: isInvalidProp, - timeZone = 'UTC', locale, isDateUnavailable, allowManualInput = true, @@ -120,9 +118,9 @@ const useProvideDatePicker = ({ const formatInputValue = useCallback( (date: Date | null) => { if (!date || !isValid(date)) return '' - return format(zonedTimeToUtc(date, timeZone), displayFormat, { locale }) + return format(date, displayFormat, { locale }) }, - [displayFormat, locale, timeZone], + [displayFormat, locale], ) // What is rendered as a string in the input according to given display format. @@ -142,11 +140,7 @@ const useProvideDatePicker = ({ const handleInputBlur: FocusEventHandler = useCallback( (e) => { - const date = parse( - internalInputValue, - dateFormat, - zonedTimeToUtc(new Date(), timeZone), - ) + const date = parse(internalInputValue, dateFormat, new Date()) // Clear if input is invalid on blur if invalid dates are not allowed. if (!allowInvalidDates && !isValid(date)) { setInternalValue(null) @@ -161,7 +155,6 @@ const useProvideDatePicker = ({ onBlur, setInternalInputValue, setInternalValue, - timeZone, ], ) @@ -179,12 +172,11 @@ const useProvideDatePicker = ({ const handleDateChange = useCallback( (date: Date | null) => { - const zonedDate = date ? zonedTimeToUtc(date, timeZone) : null - if (allowInvalidDates || isValid(zonedDate) || !zonedDate) { - setInternalValue(zonedDate) + if (allowInvalidDates || isValid(date) || !date) { + setInternalValue(date) } - if (zonedDate) { - setInternalInputValue(format(zonedDate, displayFormat, { locale })) + if (date) { + setInternalInputValue(format(date, displayFormat, { locale })) } else { setInternalInputValue('') } @@ -198,23 +190,18 @@ const useProvideDatePicker = ({ locale, setInternalInputValue, setInternalValue, - timeZone, ], ) const handleInputChange = useCallback( (event: React.ChangeEvent) => { - const date = parse( - event.target.value, - dateFormat, - zonedTimeToUtc(new Date(), timeZone), - ) + const date = parse(event.target.value, dateFormat, new Date()) setInternalInputValue(event.target.value) if (isValid(date)) { setInternalValue(date) } }, - [dateFormat, setInternalInputValue, setInternalValue, timeZone], + [dateFormat, setInternalInputValue, setInternalValue], ) const handleInputClick: MouseEventHandler = useCallback( diff --git a/frontend/src/components/DatePicker/types.ts b/frontend/src/components/DatePicker/types.ts index fbec861fa8..37754857c6 100644 --- a/frontend/src/components/DatePicker/types.ts +++ b/frontend/src/components/DatePicker/types.ts @@ -33,10 +33,4 @@ export interface DatePickerBaseProps refocusOnClose?: boolean /** date-fns's Locale of the date to be applied if provided. */ locale?: Locale - /** - * Time zone of date created. - * Defaults to `'UTC'`. - * Accepts all possible `Intl.Locale.prototype.timeZones` values - */ - timeZone?: string } diff --git a/frontend/src/components/DateRangePicker/DateRangePickerContext.tsx b/frontend/src/components/DateRangePicker/DateRangePickerContext.tsx index 0f974a41f8..5fd63ec28b 100644 --- a/frontend/src/components/DateRangePicker/DateRangePickerContext.tsx +++ b/frontend/src/components/DateRangePicker/DateRangePickerContext.tsx @@ -21,7 +21,6 @@ import { useMultiStyleConfig, } from '@chakra-ui/react' import { format, isValid, parse } from 'date-fns' -import { zonedTimeToUtc } from 'date-fns-tz' import { ThemeColorScheme } from '~theme/foundations/colours' import { useIsMobile } from '~hooks/useIsMobile' @@ -92,7 +91,6 @@ const useProvideDateRangePicker = ({ isReadOnly: isReadOnlyProp, isRequired: isRequiredProp, isInvalid: isInvalidProp, - timeZone = 'UTC', locale, isDateUnavailable, allowManualInput = true, @@ -129,13 +127,13 @@ const useProvideDateRangePicker = ({ // What is rendered as a string in the start date range input according to given display format. const [startInputDisplay, setStartInputDisplay] = useState( startDate && isValid(startDate) - ? format(zonedTimeToUtc(startDate, timeZone), displayFormat, { locale }) + ? format(startDate, displayFormat, { locale }) : '', ) // What is rendered as a string in the end date range input according to given display format. const [endInputDisplay, setEndInputDisplay] = useState( endDate && isValid(endDate) - ? format(zonedTimeToUtc(endDate, timeZone), displayFormat, { locale }) + ? format(endDate, displayFormat, { locale }) : '', ) @@ -151,24 +149,18 @@ const useProvideDateRangePicker = ({ ) as DateRangeValue const [nextStart, nextEnd] = sortedRange - const zonedStartDate = nextStart - ? zonedTimeToUtc(nextStart, timeZone) - : null - const zonedEndDate = nextEnd ? zonedTimeToUtc(nextEnd, timeZone) : null - if (zonedStartDate) { - if (isValid(zonedStartDate)) { - setStartInputDisplay( - format(zonedStartDate, displayFormat, { locale }), - ) + if (nextStart) { + if (isValid(nextStart)) { + setStartInputDisplay(format(nextStart, displayFormat, { locale })) } else if (!allowInvalidDates) { setStartInputDisplay('') } } else { setStartInputDisplay('') } - if (zonedEndDate) { - if (isValid(zonedEndDate)) { - setEndInputDisplay(format(zonedEndDate, displayFormat, { locale })) + if (nextEnd) { + if (isValid(nextEnd)) { + setEndInputDisplay(format(nextEnd, displayFormat, { locale })) } else if (!allowInvalidDates) { setEndInputDisplay('') } @@ -177,7 +169,7 @@ const useProvideDateRangePicker = ({ } setInternalValue(validRange) }, - [allowInvalidDates, displayFormat, locale, setInternalValue, timeZone], + [allowInvalidDates, displayFormat, locale, setInternalValue], ) const fcProps = useFormControlProps({ @@ -274,11 +266,8 @@ const useProvideDateRangePicker = ({ const handleCalendarDateChange = useCallback( (date: DateRangeValue) => { - const zonedDateRange = date.map((d) => - d ? zonedTimeToUtc(d, timeZone) : null, - ) as DateRangeValue - const [nextStartDate, nextEndDate] = zonedDateRange - setInternalValue(zonedDateRange) + const [nextStartDate, nextEndDate] = date + setInternalValue(date) setStartInputDisplay( nextStartDate ? format(nextStartDate, displayFormat, { locale }) : '', ) @@ -296,7 +285,6 @@ const useProvideDateRangePicker = ({ displayFormat, locale, setInternalValue, - timeZone, ], ) diff --git a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditDate/EditDate.tsx b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditDate/EditDate.tsx index c762e9fe3b..918a0b824a 100644 --- a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditDate/EditDate.tsx +++ b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditDate/EditDate.tsx @@ -1,4 +1,4 @@ -import { useMemo } from 'react' +import { useCallback, useMemo } from 'react' import { Controller, RegisterOptions } from 'react-hook-form' import { Box, FormControl, SimpleGrid } from '@chakra-ui/react' import { isBefore, isEqual, isValid } from 'date-fns' @@ -10,7 +10,11 @@ import { DateValidationOptions, } from '~shared/types/field' -import { fromUtcToLocalDate, isDateOutOfRange } from '~utils/date' +import { + isDateOutOfRange, + loadDateFromNormalizedDate, + normalizeDateToUtc, +} from '~utils/date' import { createBaseValidationRules } from '~utils/fieldValidation' import { DatePicker } from '~components/DatePicker' import { SingleSelect } from '~components/Dropdown' @@ -49,10 +53,10 @@ const transformDateFieldToEditForm = (field: DateFieldBase): EditDateInputs => { selectedDateValidation: field.dateValidation.selectedDateValidation ?? ('' as const), customMaxDate: field.dateValidation.selectedDateValidation - ? field.dateValidation.customMaxDate ?? null + ? loadDateFromNormalizedDate(field.dateValidation.customMaxDate) : null, customMinDate: field.dateValidation.selectedDateValidation - ? field.dateValidation.customMinDate ?? null + ? loadDateFromNormalizedDate(field.dateValidation.customMinDate) : null, } return { @@ -97,6 +101,28 @@ const transformDateEditFormToField = ( } export const EditDate = ({ field }: EditDateProps): JSX.Element => { + const preSubmitTransform = useCallback( + (inputs: EditDateInputs, output: DateFieldBase): DateFieldBase => { + // normalize time to UTC before saving + return { + ...output, + dateValidation: { + selectedDateValidation: + inputs.dateValidation.selectedDateValidation === '' + ? null + : inputs.dateValidation.selectedDateValidation, + customMinDate: normalizeDateToUtc( + inputs.dateValidation.customMinDate, + ), + customMaxDate: normalizeDateToUtc( + inputs.dateValidation.customMaxDate, + ), + }, + } as DateFieldBase + }, + [], + ) + const { register, formState: { errors }, @@ -111,6 +137,7 @@ export const EditDate = ({ field }: EditDateProps): JSX.Element => { transform: { input: transformDateFieldToEditForm, output: transformDateEditFormToField, + preSubmit: preSubmitTransform, }, }) @@ -222,9 +249,7 @@ export const EditDate = ({ field }: EditDateProps): JSX.Element => { isDateUnavailable={(d) => isDateOutOfRange( d, - fromUtcToLocalDate( - getValues('dateValidation.customMinDate'), - ), + getValues('dateValidation.customMinDate'), ) } {...field} diff --git a/frontend/src/templates/Field/Date/DateField.tsx b/frontend/src/templates/Field/Date/DateField.tsx index 1286800088..dd3bd120ae 100644 --- a/frontend/src/templates/Field/Date/DateField.tsx +++ b/frontend/src/templates/Field/Date/DateField.tsx @@ -5,10 +5,10 @@ import { FormColorTheme } from '~shared/types' import { DateSelectedValidation } from '~shared/types/field' import { - fromUtcToLocalDate, isDateAfterToday, isDateBeforeToday, isDateOutOfRange, + loadDateFromNormalizedDate, } from '~utils/date' import { createDateValidationRules } from '~utils/fieldValidation' import { DatePicker } from '~components/DatePicker' @@ -53,8 +53,8 @@ export const DateField = ({ // need to convert to local time but with the same date as UTC. return isDateOutOfRange( date, - fromUtcToLocalDate(customMinDate), - fromUtcToLocalDate(customMaxDate), + loadDateFromNormalizedDate(customMinDate), + loadDateFromNormalizedDate(customMaxDate), ) } default: diff --git a/frontend/src/utils/date.ts b/frontend/src/utils/date.ts index e49e2acd3b..93d4f26e9d 100644 --- a/frontend/src/utils/date.ts +++ b/frontend/src/utils/date.ts @@ -38,8 +38,12 @@ export const isDateAfterToday = (date: number | Date) => { return isAfter(date, endOfToday()) } -// Converts UTC time to the same date in local time, ignoring original timezone. -export const fromUtcToLocalDate = (date?: Date | null) => { +export const normalizeDateToUtc = (date: Date | null) => { + if (!date) return date + return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) +} + +export const loadDateFromNormalizedDate = (date: Date | null) => { if (!date) return date return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()) } diff --git a/frontend/src/utils/fieldValidation.ts b/frontend/src/utils/fieldValidation.ts index 8c8d2448e4..9f2b163bf0 100644 --- a/frontend/src/utils/fieldValidation.ts +++ b/frontend/src/utils/fieldValidation.ts @@ -53,10 +53,10 @@ import { import { VerifiableFieldBase } from '~features/verifiable-fields/types' import { - fromUtcToLocalDate, isDateAfterToday, isDateBeforeToday, isDateOutOfRange, + loadDateFromNormalizedDate, } from './date' import { formatNumberToLocaleString } from './stringFormat' @@ -434,8 +434,8 @@ export const createDateValidationRules: ValidationRuleFn = ( return ( !isDateOutOfRange( parseDate(val), - fromUtcToLocalDate(customMinDate), - fromUtcToLocalDate(customMaxDate), + loadDateFromNormalizedDate(customMinDate), + loadDateFromNormalizedDate(customMaxDate), ) || 'Selected date is not within the allowed date range' ) }, diff --git a/package-lock.json b/package-lock.json index 962a6868c7..4c58fb8899 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "FormSG", - "version": "6.40.0", + "version": "6.41.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "FormSG", - "version": "6.40.0", + "version": "6.41.1", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudwatch-logs": "^3.276.0", @@ -37,7 +37,7 @@ "angular-ui-bootstrap": "~2.5.6", "angular-ui-router": "~1.0.30", "aws-info": "^1.2.0", - "aws-sdk": "^2.1282.0", + "aws-sdk": "^2.1354.0", "axios": "^1.2.1", "bcrypt": "^5.1.0", "bluebird": "^3.5.2", @@ -8117,9 +8117,9 @@ "license": "MIT" }, "node_modules/aws-sdk": { - "version": "2.1282.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1282.0.tgz", - "integrity": "sha512-xH9oPE0Ggk1Q667byhStbutLYm528d/yCq81kvuU7t24Ijvx7tNMjai77x/QojDl8wEznzsguAwCEdj+aTcFbg==", + "version": "2.1354.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz", + "integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==", "dependencies": { "buffer": "4.9.2", "events": "1.1.1", @@ -8130,7 +8130,7 @@ "url": "0.10.3", "util": "^0.12.4", "uuid": "8.0.0", - "xml2js": "0.4.19" + "xml2js": "0.5.0" }, "engines": { "node": ">= 10.0.0" @@ -28184,7 +28184,8 @@ }, "node_modules/sax": { "version": "1.2.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, "node_modules/saxes": { "version": "5.0.1", @@ -32331,8 +32332,9 @@ "license": "MIT" }, "node_modules/vm2": { - "version": "3.9.11", - "license": "MIT", + "version": "3.9.16", + "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.16.tgz", + "integrity": "sha512-3T9LscojNTxdOyG+e8gFeyBXkMlOBYDoF6dqZbj+MPVHi9x10UfiTAJIobuchRCp3QvC+inybTbMJIUrLsig0w==", "dependencies": { "acorn": "^8.7.0", "acorn-walk": "^8.2.0" @@ -33584,16 +33586,21 @@ "license": "Apache-2.0" }, "node_modules/xml2js": { - "version": "0.4.19", - "license": "MIT", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", "dependencies": { "sax": ">=0.6.0", - "xmlbuilder": "~9.0.1" + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" } }, "node_modules/xmlbuilder": { - "version": "9.0.7", - "license": "MIT", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", "engines": { "node": ">=4.0" } @@ -39543,9 +39550,9 @@ "version": "1.2.0" }, "aws-sdk": { - "version": "2.1282.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1282.0.tgz", - "integrity": "sha512-xH9oPE0Ggk1Q667byhStbutLYm528d/yCq81kvuU7t24Ijvx7tNMjai77x/QojDl8wEznzsguAwCEdj+aTcFbg==", + "version": "2.1354.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz", + "integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==", "requires": { "buffer": "4.9.2", "events": "1.1.1", @@ -39556,7 +39563,7 @@ "url": "0.10.3", "util": "^0.12.4", "uuid": "8.0.0", - "xml2js": "0.4.19" + "xml2js": "0.5.0" }, "dependencies": { "buffer": { @@ -53098,7 +53105,9 @@ } }, "sax": { - "version": "1.2.1" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, "saxes": { "version": "5.0.1", @@ -55866,7 +55875,9 @@ "dev": true }, "vm2": { - "version": "3.9.11", + "version": "3.9.16", + "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.16.tgz", + "integrity": "sha512-3T9LscojNTxdOyG+e8gFeyBXkMlOBYDoF6dqZbj+MPVHi9x10UfiTAJIobuchRCp3QvC+inybTbMJIUrLsig0w==", "requires": { "acorn": "^8.7.0", "acorn-walk": "^8.2.0" @@ -56757,14 +56768,18 @@ "dev": true }, "xml2js": { - "version": "0.4.19", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", "requires": { "sax": ">=0.6.0", - "xmlbuilder": "~9.0.1" + "xmlbuilder": "~11.0.0" } }, "xmlbuilder": { - "version": "9.0.7" + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" }, "xmlchars": { "version": "2.2.0", diff --git a/package.json b/package.json index 6db3380ba8..73c6e59748 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "FormSG", "description": "Form Manager for Government", - "version": "6.40.0", + "version": "6.41.1", "homepage": "https://form.gov.sg", "authors": [ "FormSG " @@ -91,7 +91,7 @@ "angular-ui-bootstrap": "~2.5.6", "angular-ui-router": "~1.0.30", "aws-info": "^1.2.0", - "aws-sdk": "^2.1282.0", + "aws-sdk": "^2.1354.0", "axios": "^1.2.1", "bcrypt": "^5.1.0", "bluebird": "^3.5.2", diff --git a/shared/package-lock.json b/shared/package-lock.json index d5404b98d0..30dc798220 100644 --- a/shared/package-lock.json +++ b/shared/package-lock.json @@ -91,9 +91,9 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.14.192", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.192.tgz", - "integrity": "sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==", + "version": "4.14.194", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.194.tgz", + "integrity": "sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==", "dev": true }, "node_modules/@types/semver": { @@ -103,15 +103,15 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz", - "integrity": "sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.0.tgz", + "integrity": "sha512-p0QgrEyrxAWBecR56gyn3wkG15TJdI//eetInP3zYRewDh0XS+DhB3VUAd3QqvziFsfaQIoIuZMxZRB7vXYaYw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/type-utils": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/scope-manager": "5.59.0", + "@typescript-eslint/type-utils": "5.59.0", + "@typescript-eslint/utils": "5.59.0", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -137,14 +137,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.57.1.tgz", - "integrity": "sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.0.tgz", + "integrity": "sha512-qK9TZ70eJtjojSUMrrEwA9ZDQ4N0e/AuoOIgXuNBorXYcBDk397D2r5MIe1B3cok/oCtdNC5j+lUUpVB+Dpb+w==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.59.0", + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/typescript-estree": "5.59.0", "debug": "^4.3.4" }, "engines": { @@ -164,13 +164,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz", - "integrity": "sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.0.tgz", + "integrity": "sha512-tsoldKaMh7izN6BvkK6zRMINj4Z2d6gGhO2UsI8zGZY3XhLq1DndP3Ycjhi1JwdwPRwtLMW4EFPgpuKhbCGOvQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1" + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/visitor-keys": "5.59.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -181,13 +181,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz", - "integrity": "sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.0.tgz", + "integrity": "sha512-d/B6VSWnZwu70kcKQSCqjcXpVH+7ABKH8P1KNn4K7j5PXXuycZTPXF44Nui0TEm6rbWGi8kc78xRgOC4n7xFgA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/typescript-estree": "5.59.0", + "@typescript-eslint/utils": "5.59.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -208,9 +208,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.1.tgz", - "integrity": "sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.0.tgz", + "integrity": "sha512-yR2h1NotF23xFFYKHZs17QJnB51J/s+ud4PYU4MqdZbzeNxpgUr05+dNeCN/bb6raslHvGdd6BFCkVhpPk/ZeA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -221,13 +221,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz", - "integrity": "sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.0.tgz", + "integrity": "sha512-sUNnktjmI8DyGzPdZ8dRwW741zopGxltGs/SAPgGL/AAgDpiLsCFLcMNSpbfXfmnNeHmK9h3wGmCkGRGAoUZAg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1", + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/visitor-keys": "5.59.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -248,17 +248,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.1.tgz", - "integrity": "sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.0.tgz", + "integrity": "sha512-GGLFd+86drlHSvPgN/el6dRQNYYGOvRSDVydsUaQluwIW3HvbXuxyuD5JETvBt/9qGYe+lOrDk6gRrWOHb/FvA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.59.0", + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/typescript-estree": "5.59.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -274,12 +274,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz", - "integrity": "sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.0.tgz", + "integrity": "sha512-qZ3iXxQhanchCeaExlKPV3gDQFxMUmU35xfd5eCXB6+kUw1TUAbIy2n7QIrwz9s98DQLzNWyHp61fY0da4ZcbA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/types": "5.59.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -594,9 +594,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.10.26", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.26.tgz", - "integrity": "sha512-oB3l4J5gEhMV+ymmlIjWedsbCpsNRqbEZ/E/MpN2QVyinKNra6DcuXywxSk/72M3DZDoH/6kzurOq1erznBMwQ==" + "version": "1.10.28", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.28.tgz", + "integrity": "sha512-1eAgjLrZA0+2Wgw4hs+4Q/kEBycxQo8ZLYnmOvZ3AlM8ImAVAJgDPlZtISLEzD1vunc2q8s2Pn7XwB7I8U3Kzw==" }, "node_modules/lie": { "version": "3.3.0", @@ -843,9 +843,9 @@ } }, "node_modules/type-fest": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.7.2.tgz", - "integrity": "sha512-f9BHrLjRJ4MYkfOsnC/53PNDzZJcVo14MqLp2+hXE39p5bgwqohxR5hDZztwxlbxmIVuvC2EFAKrAkokq23PLA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.8.0.tgz", + "integrity": "sha512-FVNSzGQz9Th+/9R6Lvv7WIAkstylfHN2/JYxkyhhmKFYh9At2DST8t6L6Lref9eYO8PXFTfG9Sg1Agg0K3vq3Q==", "engines": { "node": ">=14.16" }, @@ -930,9 +930,9 @@ "dev": true }, "@types/lodash": { - "version": "4.14.192", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.192.tgz", - "integrity": "sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==", + "version": "4.14.194", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.194.tgz", + "integrity": "sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==", "dev": true }, "@types/semver": { @@ -942,15 +942,15 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz", - "integrity": "sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.0.tgz", + "integrity": "sha512-p0QgrEyrxAWBecR56gyn3wkG15TJdI//eetInP3zYRewDh0XS+DhB3VUAd3QqvziFsfaQIoIuZMxZRB7vXYaYw==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/type-utils": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/scope-manager": "5.59.0", + "@typescript-eslint/type-utils": "5.59.0", + "@typescript-eslint/utils": "5.59.0", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", @@ -960,53 +960,53 @@ } }, "@typescript-eslint/parser": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.57.1.tgz", - "integrity": "sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.0.tgz", + "integrity": "sha512-qK9TZ70eJtjojSUMrrEwA9ZDQ4N0e/AuoOIgXuNBorXYcBDk397D2r5MIe1B3cok/oCtdNC5j+lUUpVB+Dpb+w==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.59.0", + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/typescript-estree": "5.59.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz", - "integrity": "sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.0.tgz", + "integrity": "sha512-tsoldKaMh7izN6BvkK6zRMINj4Z2d6gGhO2UsI8zGZY3XhLq1DndP3Ycjhi1JwdwPRwtLMW4EFPgpuKhbCGOvQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1" + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/visitor-keys": "5.59.0" } }, "@typescript-eslint/type-utils": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz", - "integrity": "sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.0.tgz", + "integrity": "sha512-d/B6VSWnZwu70kcKQSCqjcXpVH+7ABKH8P1KNn4K7j5PXXuycZTPXF44Nui0TEm6rbWGi8kc78xRgOC4n7xFgA==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/typescript-estree": "5.59.0", + "@typescript-eslint/utils": "5.59.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.1.tgz", - "integrity": "sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.0.tgz", + "integrity": "sha512-yR2h1NotF23xFFYKHZs17QJnB51J/s+ud4PYU4MqdZbzeNxpgUr05+dNeCN/bb6raslHvGdd6BFCkVhpPk/ZeA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz", - "integrity": "sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.0.tgz", + "integrity": "sha512-sUNnktjmI8DyGzPdZ8dRwW741zopGxltGs/SAPgGL/AAgDpiLsCFLcMNSpbfXfmnNeHmK9h3wGmCkGRGAoUZAg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1", + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/visitor-keys": "5.59.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1015,28 +1015,28 @@ } }, "@typescript-eslint/utils": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.1.tgz", - "integrity": "sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.0.tgz", + "integrity": "sha512-GGLFd+86drlHSvPgN/el6dRQNYYGOvRSDVydsUaQluwIW3HvbXuxyuD5JETvBt/9qGYe+lOrDk6gRrWOHb/FvA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.59.0", + "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/typescript-estree": "5.59.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" } }, "@typescript-eslint/visitor-keys": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz", - "integrity": "sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA==", + "version": "5.59.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.0.tgz", + "integrity": "sha512-qZ3iXxQhanchCeaExlKPV3gDQFxMUmU35xfd5eCXB6+kUw1TUAbIy2n7QIrwz9s98DQLzNWyHp61fY0da4ZcbA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/types": "5.59.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -1262,9 +1262,9 @@ } }, "libphonenumber-js": { - "version": "1.10.26", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.26.tgz", - "integrity": "sha512-oB3l4J5gEhMV+ymmlIjWedsbCpsNRqbEZ/E/MpN2QVyinKNra6DcuXywxSk/72M3DZDoH/6kzurOq1erznBMwQ==" + "version": "1.10.28", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.28.tgz", + "integrity": "sha512-1eAgjLrZA0+2Wgw4hs+4Q/kEBycxQo8ZLYnmOvZ3AlM8ImAVAJgDPlZtISLEzD1vunc2q8s2Pn7XwB7I8U3Kzw==" }, "lie": { "version": "3.3.0", @@ -1440,9 +1440,9 @@ } }, "type-fest": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.7.2.tgz", - "integrity": "sha512-f9BHrLjRJ4MYkfOsnC/53PNDzZJcVo14MqLp2+hXE39p5bgwqohxR5hDZztwxlbxmIVuvC2EFAKrAkokq23PLA==" + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.8.0.tgz", + "integrity": "sha512-FVNSzGQz9Th+/9R6Lvv7WIAkstylfHN2/JYxkyhhmKFYh9At2DST8t6L6Lref9eYO8PXFTfG9Sg1Agg0K3vq3Q==" }, "util-deprecate": { "version": "1.0.2", diff --git a/src/app/loaders/datadog-tracer.ts b/src/app/loaders/datadog-tracer.ts index 7cce51151c..69e3163ae4 100644 --- a/src/app/loaders/datadog-tracer.ts +++ b/src/app/loaders/datadog-tracer.ts @@ -2,6 +2,7 @@ import tracer from 'dd-trace' tracer.init({ logInjection: true, // https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces/nodejs/ + runtimeMetrics: true, // https://datadoghq.dev/dd-trace-js/interfaces/traceroptions.html#runtimemetrics }) // setup express to not track middlewares as spans diff --git a/src/app/loaders/express/__tests__/helmet.spec.ts b/src/app/loaders/express/__tests__/helmet.spec.ts index e8a80d7101..7b539222b4 100644 --- a/src/app/loaders/express/__tests__/helmet.spec.ts +++ b/src/app/loaders/express/__tests__/helmet.spec.ts @@ -122,7 +122,7 @@ describe('helmetMiddlewares', () => { if (hstsFn) { hstsFn(mockReq, mockRes, mockNext) } - expect(mockHelmet.hsts).toHaveBeenCalledWith({ maxAge: 5184000 }) + expect(mockHelmet.hsts).toHaveBeenCalledWith({ maxAge: 400 * 24 * 60 * 60 }) // 400 days expect(mockNext).not.toHaveBeenCalled() }) diff --git a/src/app/loaders/express/helmet.ts b/src/app/loaders/express/helmet.ts index 1b3fc61f8f..7ac3ee5e1b 100644 --- a/src/app/loaders/express/helmet.ts +++ b/src/app/loaders/express/helmet.ts @@ -9,7 +9,7 @@ const helmetMiddlewares = () => { // Only add the "Strict-Transport-Security" header if request is https. const hstsMiddleware: RequestHandler = (req, res, next) => { if (req.secure) { - helmet.hsts({ maxAge: 5184000 })(req, res, next) // 60 days + helmet.hsts({ maxAge: 400 * 24 * 60 * 60 })(req, res, next) // 400 days } else next() } diff --git a/src/app/modules/spcp/spcp.oidc.util.ts b/src/app/modules/spcp/spcp.oidc.util.ts index b54d07b60e..42b432a5fe 100644 --- a/src/app/modules/spcp/spcp.oidc.util.ts +++ b/src/app/modules/spcp/spcp.oidc.util.ts @@ -46,7 +46,7 @@ export const retryPromiseThreeAttempts = ( }, }) return result - } catch (e) { + } catch (e: any) { logger.warn({ message: 'Promise rejected', meta: { @@ -54,7 +54,11 @@ export const retryPromiseThreeAttempts = ( promise: promiseName, attemptNo, }, - error: e, + error: { + message: e?.message, + stack: e?.stack, + code: e?.code, + }, }) return retry(e) } @@ -102,7 +106,7 @@ export const retryPromiseForever = ( }, }) return result - } catch (e) { + } catch (e: any) { logger.warn({ message: 'Promise rejected', meta: { @@ -110,7 +114,11 @@ export const retryPromiseForever = ( promise: promiseName, attemptNo, }, - error: e, + error: { + message: e?.message, + stack: e?.stack, + code: e?.code, + }, }) return retry(e) } diff --git a/src/app/utils/field-validation/validators/dateValidator.ts b/src/app/utils/field-validation/validators/dateValidator.ts index af41a0ac52..fd2ae2dc7b 100644 --- a/src/app/utils/field-validation/validators/dateValidator.ts +++ b/src/app/utils/field-validation/validators/dateValidator.ts @@ -42,10 +42,9 @@ const dateFormatValidator: DateValidator = (response) => { */ const pastOnlyValidator: DateValidator = (response) => { // Today takes two possible values - a min (in makeFutureOnlyValidator) and max (here) - // Add 14 hours here to account for up to UTC + 14 timezone - // This allows validation to pass as long as user is on the correct date (locally) - // Even if they are in a different timezone - const todayMax = moment().utc().add(14, 'hours').startOf('day') + // Compares the input date with the maximum date for today anywhere in the world so + // respondent can be from any timezone. + const todayMax = moment().zone('+14:00').startOf('day') const { answer } = response const answerDate = createMomentFromDateString(answer) @@ -59,10 +58,9 @@ const pastOnlyValidator: DateValidator = (response) => { */ const futureOnlyValidator: DateValidator = (response) => { // Today takes two possible values - a min (here) and max (in makePastOnlyValidator) - // Subtract 12 hours here to account for up to UTC - 12 timezone - // This allows validation to pass as long as user is on the correct date (locally) - // Even if they are in a different timezone - const todayMin = moment().utc().subtract(12, 'hours').startOf('day') + // Compares the input date with the minimum date for today anywhere in the world so + // respondent can be from any timezone. + const todayMin = moment().zone('-12:00').startOf('day') const { answer } = response const answerDate = createMomentFromDateString(answer)