Skip to content

Commit

Permalink
Merge pull request #7266 from opengovsg/release_v6.117.0
Browse files Browse the repository at this point in the history
build: release v6.117.0
  • Loading branch information
justynoh committed Apr 24, 2024
2 parents 557b387 + 6eb4aca commit 4dc4e5a
Show file tree
Hide file tree
Showing 45 changed files with 476 additions and 1,332 deletions.
33 changes: 29 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,47 @@ 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.116.0](https://github.com/opengovsg/FormSG/compare/v6.116.0...v6.116.0)

- chore: update chromium to latest published version [`#7252`](https://github.com/opengovsg/FormSG/pull/7252)
#### [v6.117.0](https://github.com/opengovsg/FormSG/compare/v6.117.0...v6.117.0)

#### [v6.117.0](https://github.com/opengovsg/FormSG/compare/v6.116.0...v6.117.0)

> 23 April 2024

- feat(i18n): add common strings for translation [`#7256`](https://github.com/opengovsg/FormSG/pull/7256)
- fix(btn): remove admin sms toggle check [`#7275`](https://github.com/opengovsg/FormSG/pull/7275)
- feat: update localstack docker image [`#7271`](https://github.com/opengovsg/FormSG/pull/7271)
- fix: remove phantom fields [`#7276`](https://github.com/opengovsg/FormSG/pull/7276)
- chore: allow pip to install packages globally [`#7259`](https://github.com/opengovsg/FormSG/pull/7259)
- fix(deps): bump type-fest from 4.15.0 to 4.16.0 in /shared [`#7274`](https://github.com/opengovsg/FormSG/pull/7274)
- fix(deps): bump zod from 3.22.5 to 3.23.0 in /shared [`#7273`](https://github.com/opengovsg/FormSG/pull/7273)
- fix(deps): bump libphonenumber-js from 1.10.60 to 1.10.61 in /shared [`#7272`](https://github.com/opengovsg/FormSG/pull/7272)
- chore: add missing packages in package-lock [`#7270`](https://github.com/opengovsg/FormSG/pull/7270)
- build: release v6.116.0 to develop [`#7269`](https://github.com/opengovsg/FormSG/pull/7269)
- build: merge release v6.116.0 to develop [`#7263`](https://github.com/opengovsg/FormSG/pull/7263)
- feat(btn): sms removal and announcment [`#7257`](https://github.com/opengovsg/FormSG/pull/7257)
- fix(deps): bump zod from 3.22.4 to 3.22.5 in /shared [`#7261`](https://github.com/opengovsg/FormSG/pull/7261)
- chore: update chromium to latest published version [`#7258`](https://github.com/opengovsg/FormSG/pull/7258)
- chore(dockerfile): bump chromium version to work with alpine-3.19 [`#7255`](https://github.com/opengovsg/FormSG/pull/7255)
- chore(deps): bump tar from 6.1.11 to 6.2.1 in /serverless/virus-scanner [`#7253`](https://github.com/opengovsg/FormSG/pull/7253)
- fix(deps): bump tar from 6.2.0 to 6.2.1 [`#7254`](https://github.com/opengovsg/FormSG/pull/7254)
- chore: refactor to move endpage block to generic folder [`#7248`](https://github.com/opengovsg/FormSG/pull/7248)
- build: release v6.116.0 [`#7251`](https://github.com/opengovsg/FormSG/pull/7251)
- chore: reverting package-lock changes [`040b962`](https://github.com/opengovsg/FormSG/commit/040b96284ea317de22d9de6cf872fd4116f24c51)
- chore: bump version to v6.117.0 [`b355f4a`](https://github.com/opengovsg/FormSG/commit/b355f4a686445a7863e06a0da2ec136e878d50fd)

#### [v6.116.0](https://github.com/opengovsg/FormSG/compare/v6.115.1...v6.116.0)

> 8 April 2024

- chore: update chromium to latest published version [`#7252`](https://github.com/opengovsg/FormSG/pull/7252)
- fix(deps): bump libphonenumber-js from 1.10.59 to 1.10.60 in /shared [`#7250`](https://github.com/opengovsg/FormSG/pull/7250)
- build: merge release v6.115.1 back to develop [`#7249`](https://github.com/opengovsg/FormSG/pull/7249)
- chore: upgrade docker base node image to 3.19 [`#7053`](https://github.com/opengovsg/FormSG/pull/7053)
- fix(mrf): webhook be validation [`#7247`](https://github.com/opengovsg/FormSG/pull/7247)
- chore: move react-dev-inspector to frontend/package.json [`#7245`](https://github.com/opengovsg/FormSG/pull/7245)
- refactor: add exhaustive checks, use answerArray for arrays [`#7244`](https://github.com/opengovsg/FormSG/pull/7244)
- fix(deps): bump type-fest from 4.14.0 to 4.15.0 in /shared [`#7243`](https://github.com/opengovsg/FormSG/pull/7243)
- chore: bump version to v6.116.0 [`49245be`](https://github.com/opengovsg/FormSG/commit/49245be72a189bd0b78004db7f51e9d8427e332e)
- chore: bump version to v6.116.0 [`31e1a33`](https://github.com/opengovsg/FormSG/commit/31e1a33c96d76b69c492f5212bc48a3dabe054af)

#### [v6.115.1](https://github.com/opengovsg/FormSG/compare/v6.115.0...v6.115.1)

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN apk update && apk upgrade && \
# 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
# Compatible chromium versions can be found here https://pkgs.alpinelinux.org/packages?name=chromium&branch=v3.19&repo=&arch=&maintainer=
chromium=123.0.6312.105-r0 \
chromium=124.0.6367.60-r0 \
nss \
freetype \
freetype-dev \
Expand All @@ -43,7 +43,7 @@ RUN apk update && apk upgrade && \
py-pip && \
npm install --quiet node-gyp -g && \
# [ver1] ensures that the underlying AWS CLI version is also installed
pip install awscli-local[ver1]
pip install awscli-local[ver1] --break-system-packages


# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ RUN mv /opt/formsg/dist/backend/shared /opt/formsg/

RUN apk add --no-cache \
# Compatible chromium versions can be found here https://pkgs.alpinelinux.org/packages?name=chromium&branch=v3.19&repo=&arch=&maintainer=
chromium=123.0.6312.105-r0 \
chromium=124.0.6367.60-r0 \
nss \
freetype \
freetype-dev \
Expand Down
2 changes: 1 addition & 1 deletion __tests__/unit/backend/helpers/jest-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const insertFormCollectionReqs = async ({
betaFlags,
apiToken,
}: {
userId?: Schema.Types.ObjectId
userId?: Types.ObjectId
mailName?: string
mailDomain?: string
shortName?: string
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
- SEND_AUTH_OTP_RATE_LIMIT=60
- SES_PORT=1025
- SES_HOST=maildev
- WEBHOOK_SQS_URL=http://localhost:4566/000000000000/local-webhooks-sqs-main
- WEBHOOK_SQS_URL=http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/local-webhooks-sqs-main
- INTRANET_IP_LIST_PATH
- SENTRY_CONFIG_URL=https://random@sentry.io/123456
- CSP_REPORT_URI=https://random@sentry.io/123456
Expand Down Expand Up @@ -162,16 +162,16 @@ services:
- '27017:27017'

localstack:
image: localstack/localstack:0.11.5
image: localstack/localstack:3.3
container_name: formsg-localstack
depends_on:
- backend
environment:
- SERVICES=s3,sqs,secretsmanager
- DATA_DIR=/tmp/localstack/data
- DNS_ADDRESS=0
volumes:
- './.localstack:/tmp/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'
- ./.localstack/volume:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
network_mode: 'service:backend' # reuse backend service's network stack so that it can resolve localhost:4566 to localstack:4566
logging:
driver: none
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

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

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-frontend",
"version": "6.116.0",
"version": "6.117.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react'
import { Box, FormControl, useDisclosure } from '@chakra-ui/react'
import { Box, FormControl } from '@chakra-ui/react'
import { extend, pick } from 'lodash'

import { MobileFieldBase } from '~shared/types/field'
Expand All @@ -14,14 +14,11 @@ import Toggle from '~components/Toggle'
import { useFreeSmsQuota } from '~features/admin-form/common/queries'

import { CreatePageDrawerContentContainer } from '../../../../../common'
import { useCreateTabForm } from '../../../../useCreateTabForm'
import { FormFieldDrawerActions } from '../common/FormFieldDrawerActions'
import { EditFieldProps } from '../common/types'
import { useEditFieldForm } from '../common/useEditFieldForm'

import { SmsCountMessage } from './SmsCountMessage'
import { SmsCountsModal } from './SmsCountsModal'
import { TwilioCredentialsMessage } from './TwilioCredentialsMessage'

const EDIT_MOBILE_KEYS = [
'title',
Expand Down Expand Up @@ -57,20 +54,7 @@ export const EditMobile = ({ field }: EditMobileProps): JSX.Element => {
[],
)

const { data: form } = useCreateTabForm()
const hasTwilioCredentials = useMemo(() => !!form?.msgSrvcName, [form])

const { data: freeSmsCount } = useFreeSmsQuota()
const isToggleVfnDisabled = useMemo(() => {
if (!freeSmsCount) return true
return (
!field.isVerifiable &&
!hasTwilioCredentials &&
freeSmsCount.freeSmsCounts >= freeSmsCount.quota
)
}, [field.isVerifiable, freeSmsCount, hasTwilioCredentials])

const smsCountsDisclosure = useDisclosure()

return (
<>
Expand Down Expand Up @@ -103,27 +87,14 @@ export const EditMobile = ({ field }: EditMobileProps): JSX.Element => {
/>
</FormControl>
<Box>
<FormControl isReadOnly={isLoading} isDisabled={isToggleVfnDisabled}>
<FormControl isReadOnly={isLoading}>
<Toggle
{...register('isVerifiable', {
onChange: (e) => {
if (e.target.checked && !hasTwilioCredentials) {
smsCountsDisclosure.onOpen()
}
},
})}
{...register('isVerifiable')}
label="OTP verification"
description="Respondents must verify by entering a code sent to them. If you have added Twilio credentials, please test this OTP verification feature to make sure your credentials are accurate."
/>
</FormControl>
<SmsCountMessage
hasTwilioCredentials={hasTwilioCredentials}
freeSmsCount={freeSmsCount}
/>
<TwilioCredentialsMessage
freeSmsCount={freeSmsCount}
hasTwilioCredentials={hasTwilioCredentials}
/>
<SmsCountMessage freeSmsCount={freeSmsCount} />
</Box>
<FormFieldDrawerActions
isLoading={isLoading}
Expand All @@ -132,11 +103,6 @@ export const EditMobile = ({ field }: EditMobileProps): JSX.Element => {
handleCancel={handleCancel}
/>
</CreatePageDrawerContentContainer>
<SmsCountsModal
freeSmsCount={freeSmsCount}
isOpen={smsCountsDisclosure.isOpen}
onClose={smsCountsDisclosure.onClose}
/>
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useMemo } from 'react'
import { BiMessage } from 'react-icons/bi'
import { Flex, Icon, Skeleton, Text } from '@chakra-ui/react'

Expand All @@ -7,31 +6,19 @@ import { SmsCountsDto } from '~shared/types/form'
import { formatSmsCounts } from './utils'

type SmsCountMessageProps = {
hasTwilioCredentials: boolean
freeSmsCount: SmsCountsDto | undefined
}

export const SmsCountMessage = ({
hasTwilioCredentials,
freeSmsCount,
}: SmsCountMessageProps): JSX.Element => {
const textColor = useMemo(() => {
if (hasTwilioCredentials) return 'secondary.500'
return freeSmsCount && freeSmsCount.freeSmsCounts >= freeSmsCount.quota
? 'danger.500'
: 'secondary.500'
}, [freeSmsCount, hasTwilioCredentials])
const textColor = 'secondary.500'

return (
<Flex mt="1rem" color={textColor}>
<Icon as={BiMessage} mr="0.5rem" />
<Skeleton isLoaded={!!freeSmsCount}>
<Text
textDecorationLine={hasTwilioCredentials ? 'line-through' : undefined}
textStyle="caption-1"
>
{formatSmsCounts(freeSmsCount)}
</Text>
<Text textStyle="caption-1">{formatSmsCounts(freeSmsCount)}</Text>
</Skeleton>
</Flex>
)
Expand Down

This file was deleted.

0 comments on commit 4dc4e5a

Please sign in to comment.