From f8e96faa1f0e1fc195efff1a51cca5ba6be2f271 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:44:30 +0000 Subject: [PATCH 1/4] fix(deps): bump type-fest from 4.8.2 to 4.8.3 in /shared (#6943) Bumps [type-fest](https://github.com/sindresorhus/type-fest) from 4.8.2 to 4.8.3. - [Release notes](https://github.com/sindresorhus/type-fest/releases) - [Commits](https://github.com/sindresorhus/type-fest/compare/v4.8.2...v4.8.3) --- updated-dependencies: - dependency-name: type-fest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- shared/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/package-lock.json b/shared/package-lock.json index 43124680f2..4b4c936f09 100644 --- a/shared/package-lock.json +++ b/shared/package-lock.json @@ -865,9 +865,9 @@ } }, "node_modules/type-fest": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.8.2.tgz", - "integrity": "sha512-mcvrCjixA5166hSrUoJgGb9gBQN4loMYyj9zxuMs/66ibHNEFd5JXMw37YVDx58L4/QID9jIzdTBB4mDwDJ6KQ==", + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.8.3.tgz", + "integrity": "sha512-//BaTm14Q/gHBn09xlnKNqfI8t6bmdzx2DXYfPBNofN0WUybCEUDcbCWcTa0oF09lzLjZgPphXAsvRiMK0V6Bw==", "engines": { "node": ">=16" }, @@ -1478,9 +1478,9 @@ } }, "type-fest": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.8.2.tgz", - "integrity": "sha512-mcvrCjixA5166hSrUoJgGb9gBQN4loMYyj9zxuMs/66ibHNEFd5JXMw37YVDx58L4/QID9jIzdTBB4mDwDJ6KQ==" + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.8.3.tgz", + "integrity": "sha512-//BaTm14Q/gHBn09xlnKNqfI8t6bmdzx2DXYfPBNofN0WUybCEUDcbCWcTa0oF09lzLjZgPphXAsvRiMK0V6Bw==" }, "util-deprecate": { "version": "1.0.2", From 63974d4f1b8d65319d8318a4052b35f8d41697f4 Mon Sep 17 00:00:00 2001 From: sebastianwzq <136435307+sebastianwzq@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:38:39 +0800 Subject: [PATCH 2/4] fix: prevent generation of charts if number of responses exceed limit (#6937) * fix: prevent generation of charts if number of responses exceed limit * fix: remove unused import * fix: corrected condition * fix: amended error message * fix: updated chromium version * fix: removed spaces * fix: added link for chromium versions * fix: refactored feature flag variable --- Dockerfile.development | 9 +++++---- Dockerfile.production | 7 ++++--- .../responses/ChartsPage/ChartsPage.tsx | 20 +++++++++++++++++-- .../UnlockedChartsContainer.tsx | 5 ----- shared/constants/feature-flags.ts | 1 + 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/Dockerfile.development b/Dockerfile.development index 091b3f500b..350eb6f948 100644 --- a/Dockerfile.development +++ b/Dockerfile.development @@ -9,7 +9,7 @@ RUN chown 1001:1001 /mongodb_data ENV CHROMIUM_BIN=/usr/bin/chromium-browser ENV NODE_ENV=development # --openssl-legacy-provider flag -# A breaking change in the SSL provider was introduced in node 17. This caused +# A breaking change in the SSL provider was introduced in node 17. This caused # webpack 4 to break. This is an interim solution; we should investigate removing # this flag once angular has been removed and we have upgraded to CRA5 (which uses # webpack 5). @@ -28,7 +28,8 @@ RUN apk update && apk upgrade && \ # that is guaranteed to work. Upgrades must be done in lockstep. # https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine # https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions - chromium=117.0.5938.62-r0 \ + # Compatible chromium versions can be found here https://pkgs.alpinelinux.org/packages?name=chromium&branch=v3.18&repo=&arch=&maintainer= + chromium=119.0.6045.159-r0 \ nss \ freetype \ freetype-dev \ @@ -53,7 +54,7 @@ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser RUN apk add font-wqy-zenhei --repository https://dl-cdn.alpinelinux.org/alpine/edge/community # Avoid using globs as there seems to be some inconsistency in the way dockerfile handles globs -# * https://github.com/moby/moby/issues/15858 +# * https://github.com/moby/moby/issues/15858 COPY package.json package-lock.json ./ COPY shared/package.json shared/package-lock.json ./shared/ COPY frontend/package.json frontend/package-lock.json ./frontend/ @@ -75,4 +76,4 @@ EXPOSE 5000 # e.g. chromium when launched to create a new PDF ENTRYPOINT [ "tini", "--" ] # Create local AWS resources before building the app -CMD sh init-localstack.sh && npm run dev:backend \ No newline at end of file +CMD sh init-localstack.sh && npm run dev:backend diff --git a/Dockerfile.production b/Dockerfile.production index deb93941a6..6d8ec6ec5c 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -30,10 +30,10 @@ RUN npm ci --legacy-peer-deps COPY . ./ # --openssl-legacy-provider flag -# A breaking change in the SSL provider was introduced in node 17. This caused +# A breaking change in the SSL provider was introduced in node 17. This caused # webpack 4 to break. This is an interim solution; we should investigate removing # this flag once angular has been removed and we have upgraded to CRA5 (which uses -# webpack 5). +# webpack 5). # See also: # * https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported # * https://github.com/webpack/webpack/issues/14532#issuecomment-1304378535 @@ -81,7 +81,8 @@ RUN mv /opt/formsg/dist/backend/shared /opt/formsg/ # https://www.npmjs.com/package/puppeteer-core?activeTab=versions for corresponding versions RUN apk add --no-cache \ - chromium=117.0.5938.62-r0 \ +# Compatible chromium versions can be found here https://pkgs.alpinelinux.org/packages?name=chromium&branch=v3.18&repo=&arch=&maintainer= + chromium=119.0.6045.159-r0 \ nss \ freetype \ freetype-dev \ diff --git a/frontend/src/features/admin-form/responses/ChartsPage/ChartsPage.tsx b/frontend/src/features/admin-form/responses/ChartsPage/ChartsPage.tsx index f29ac87d33..241b359c44 100644 --- a/frontend/src/features/admin-form/responses/ChartsPage/ChartsPage.tsx +++ b/frontend/src/features/admin-form/responses/ChartsPage/ChartsPage.tsx @@ -1,6 +1,8 @@ import { useLocation } from 'react-router-dom' import { Box, Container, Divider, Stack } from '@chakra-ui/react' +import { useFeatureValue } from '@growthbook/growthbook-react' +import { featureFlags } from '~shared/constants' import { FormResponseMode } from '~shared/types/form' import { ACTIVE_ADMINFORM_RESULTS_ROUTE_REGEX } from '~constants/routes' @@ -21,7 +23,10 @@ export const ChartsPage = (): JSX.Element => { const { data: form, isLoading } = useAdminForm() const { totalResponsesCount, secretKey } = useStorageResponsesContext() const { pathname } = useLocation() - + const chartsMaxResponseCount = useFeatureValue( + featureFlags.chartsMaxResponseCount, + 100, + ) // limit number of responses to 100 as fallback const toast = useToast({ status: 'danger' }) if (isLoading) return @@ -53,7 +58,9 @@ export const ChartsPage = (): JSX.Element => { return <> } - if (totalResponsesCount === 0) { + const responseCount = totalResponsesCount || 0 + + if (responseCount === 0) { return ( { ) } + if (responseCount > chartsMaxResponseCount) { + return ( + + ) + } + return secretKey ? ( ) : ( diff --git a/frontend/src/features/admin-form/responses/ChartsPage/UnlockedCharts/UnlockedChartsContainer.tsx b/frontend/src/features/admin-form/responses/ChartsPage/UnlockedCharts/UnlockedChartsContainer.tsx index f28a10be58..dd1c061452 100644 --- a/frontend/src/features/admin-form/responses/ChartsPage/UnlockedCharts/UnlockedChartsContainer.tsx +++ b/frontend/src/features/admin-form/responses/ChartsPage/UnlockedCharts/UnlockedChartsContainer.tsx @@ -157,11 +157,6 @@ export const UnlockedChartsContainer = () => { {prettifiedResponsesCount} - - {filteredDecryptedData.length > 1000 - ? 'Charts are generated based on the latest 1,000 responses.' - : null} - Date: Mon, 4 Dec 2023 13:00:20 +0800 Subject: [PATCH 3/4] fix: changed z index of workspacesearchbar (#6927) * fix: changed z index of avatarmenu * fix: changed Z-index of workspacesearchbar --------- Co-authored-by: Kathleen Koh --- .../components/WorkspaceSearchbar/WorkspaceSearchbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/features/workspace/components/WorkspaceSearchbar/WorkspaceSearchbar.tsx b/frontend/src/features/workspace/components/WorkspaceSearchbar/WorkspaceSearchbar.tsx index 0ac5fc5194..35a07464be 100644 --- a/frontend/src/features/workspace/components/WorkspaceSearchbar/WorkspaceSearchbar.tsx +++ b/frontend/src/features/workspace/components/WorkspaceSearchbar/WorkspaceSearchbar.tsx @@ -135,7 +135,7 @@ export const WorkspaceSearchbar = forwardRef( onChange={(e) => setInternalValue(e.target.value)} pr={filterElemWidth} /> - + Date: Wed, 6 Dec 2023 08:49:37 +0800 Subject: [PATCH 4/4] chore: bump version to v6.93.0 --- CHANGELOG.md | 27 +++++++++++++++++++++------ frontend/package-lock.json | 4 ++-- frontend/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ba3521a14..2bd895fcd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,15 @@ 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.92.0](https://github.com/opengovsg/FormSG/compare/v6.92.0...v6.92.0) +#### [v6.93.0](https://github.com/opengovsg/FormSG/compare/v6.92.0...v6.93.0) +- fix: changed z index of workspacesearchbar [`#6927`](https://github.com/opengovsg/FormSG/pull/6927) +- fix: prevent generation of charts if number of responses exceed limit [`#6937`](https://github.com/opengovsg/FormSG/pull/6937) +- fix(deps): bump type-fest from 4.8.2 to 4.8.3 in /shared [`#6943`](https://github.com/opengovsg/FormSG/pull/6943) +- build: merge release v6.92.0 into develop [`#6934`](https://github.com/opengovsg/FormSG/pull/6934) +- build: release v6.92.0 [`#6932`](https://github.com/opengovsg/FormSG/pull/6932) - feat: set secret key input to password type on activation modal [`#6933`](https://github.com/opengovsg/FormSG/pull/6933) +- chore: bump version to v6.92.0 [`28a8b9c`](https://github.com/opengovsg/FormSG/commit/28a8b9ca95f456c0f2c95d22813bf6d2ae1509ed) #### [v6.92.0](https://github.com/opengovsg/FormSG/compare/v6.91.1...v6.92.0) @@ -59,17 +65,25 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: merge release v6.89.1 into develop [`#6905`](https://github.com/opengovsg/FormSG/pull/6905) - chore: bump version to v6.90.0 [`c03692e`](https://github.com/opengovsg/FormSG/commit/c03692e3d9aa64afa8007dffecfd9871542f4759) -#### [v6.89.2](https://github.com/opengovsg/FormSG/compare/v6.89.0...v6.89.2) +#### [v6.89.2](https://github.com/opengovsg/FormSG/compare/v6.89.1...v6.89.2) > 17 November 2023 - fix: hotfix v6.89.1 for proper error handling in encrypt-submission middleware [`#6903`](https://github.com/opengovsg/FormSG/pull/6903) -- build: release v6.89.0 [`#6898`](https://github.com/opengovsg/FormSG/pull/6898) -- fix: remove myinfo child from storage mode [`#6901`](https://github.com/opengovsg/FormSG/pull/6901) - chore: revert commit 6869 [`efab3cf`](https://github.com/opengovsg/FormSG/commit/efab3cf844113573d758b1b2c57147d5d0656a28) - chore: bump version to 6.89.2 [`1f4e9f7`](https://github.com/opengovsg/FormSG/commit/1f4e9f70cd33ac2f015fb902de5243a4227e4981) - fix: remove error block [`fb415fc`](https://github.com/opengovsg/FormSG/commit/fb415fcd7189a90056557c242ed98f1dc10e757e) +#### [v6.89.1](https://github.com/opengovsg/FormSG/compare/v6.89.0...v6.89.1) + +> 16 November 2023 + +- build: release v6.89.0 [`#6898`](https://github.com/opengovsg/FormSG/pull/6898) +- fix: remove myinfo child from storage mode [`#6901`](https://github.com/opengovsg/FormSG/pull/6901) +- chore: bump version to 6.89.1 [`253dd25`](https://github.com/opengovsg/FormSG/commit/253dd2596844d28e5dc3caae298fc775fb1a3f75) +- fix: add error handling [`d6c4985`](https://github.com/opengovsg/FormSG/commit/d6c4985aa8e35dd2278af9b70d00d4e86a48bde1) +- fix: remove email mode from myinfo limit message [`5a45c98`](https://github.com/opengovsg/FormSG/commit/5a45c980dbe3fc8c15eacb3ff1827f3003fcbfc4) + #### [v6.89.0](https://github.com/opengovsg/FormSG/compare/v6.88.0...v6.89.0) > 15 November 2023 @@ -106,13 +120,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: add case for SGID MyInfo when field value is missing [`#6874`](https://github.com/opengovsg/FormSG/pull/6874) - build: merge release v6.86.0 into develop [`#6873`](https://github.com/opengovsg/FormSG/pull/6873) - build: release v6.86.0 [`#6866`](https://github.com/opengovsg/FormSG/pull/6866) +- chore: use non-testing branch for font-wqy-zenhei [`#6867`](https://github.com/opengovsg/FormSG/pull/6867) +- chore: bump version to v6.86.0 [`1eec9b6`](https://github.com/opengovsg/FormSG/commit/1eec9b63c914b56b7b10adffd03554e07fde0f3a) - chore: bump version to v6.87.0 [`5054803`](https://github.com/opengovsg/FormSG/commit/50548038804b03f30ce6d23b4d43b7a8cf7d9620) #### [v6.86.0](https://github.com/opengovsg/FormSG/compare/v6.85.1...v6.86.0) > 6 November 2023 -- chore: use non-testing branch for font-wqy-zenhei [`#6867`](https://github.com/opengovsg/FormSG/pull/6867) - chore: update credits and terms of use [`#6865`](https://github.com/opengovsg/FormSG/pull/6865) - fix: add cloudflareinsights as allowable csp [`#6864`](https://github.com/opengovsg/FormSG/pull/6864) - feat: optimise submission query [`#6863`](https://github.com/opengovsg/FormSG/pull/6863) @@ -120,7 +135,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: only render delete button if owner [`#6837`](https://github.com/opengovsg/FormSG/pull/6837) - build: merge release v6.85.1 into develop [`#6861`](https://github.com/opengovsg/FormSG/pull/6861) - fix: hotfix v6.85.1 to prevent creation of SGID_MyInfo storage mode forms [`#6860`](https://github.com/opengovsg/FormSG/pull/6860) -- chore: bump version to v6.86.0 [`1eec9b6`](https://github.com/opengovsg/FormSG/commit/1eec9b63c914b56b7b10adffd03554e07fde0f3a) +- chore: bump version to v6.86.0 [`1c827cd`](https://github.com/opengovsg/FormSG/commit/1c827cd11844649ca303bb5dc9987db5367637c9) #### [v6.85.1](https://github.com/opengovsg/FormSG/compare/v6.85.0...v6.85.1) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f81a0f2e38..8310b2579d 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "form-frontend", - "version": "6.92.0", + "version": "6.93.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "form-frontend", - "version": "6.92.0", + "version": "6.93.0", "hasInstallScript": true, "dependencies": { "@chakra-ui/react": "^1.8.6", diff --git a/frontend/package.json b/frontend/package.json index 7d5729d712..a341aa4bf8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "form-frontend", - "version": "6.92.0", + "version": "6.93.0", "homepage": ".", "private": true, "dependencies": { diff --git a/package-lock.json b/package-lock.json index 1bb3b41107..5c88f7a0b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "FormSG", - "version": "6.92.0", + "version": "6.93.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "FormSG", - "version": "6.92.0", + "version": "6.93.0", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudwatch-logs": "^3.347.1", diff --git a/package.json b/package.json index d44c754cc3..26f3235d1e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "FormSG", "description": "Form Manager for Government", - "version": "6.92.0", + "version": "6.93.0", "homepage": "https://form.gov.sg", "authors": [ "FormSG "