Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: release v6.116.0 #7262

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,37 @@ 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)

- 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)

#### [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 [`31e1a33`](https://github.com/opengovsg/FormSG/commit/31e1a33c96d76b69c492f5212bc48a3dabe054af)

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

> 5 April 2024

- * chore(deps-dev): bump @types/express from 4.17.17 to 4.17.21 (#7233) [`#7241`](https://github.com/opengovsg/FormSG/pull/7241)
- fix: add check to block webhooks updates on mrf [`71ab0c5`](https://github.com/opengovsg/FormSG/commit/71ab0c592c15de5fddbffc9970a424af7a31d4ab)
- chore: bump version to 6.115.1 [`7d127b2`](https://github.com/opengovsg/FormSG/commit/7d127b2e8353a8a282acabe1c309cefb1e750f9c)

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

Expand Down
2 changes: 1 addition & 1 deletion 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 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
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.115.1",
"version": "6.116.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.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export const formatSmsCounts = (smsCounts?: SmsCountsDto): string => {
if (!smsCounts) {
return 'Loading...'
}
return `${smsCounts.freeSmsCounts.toLocaleString()}/${smsCounts.quota.toLocaleString()} SMSes used`
return `${smsCounts.freeSmsCounts.toLocaleString()} SMSes used`
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import {
FormResponseMode,
} from '~shared/types'

import { EndPageBlock } from '~components/FormEndPage/EndPageBlock'
import { PaymentsThankYouSvgr } from '~components/FormEndPage/PaymentsThankYouSvgr'
import { ThankYouSvgr } from '~components/FormEndPage/ThankYouSvgr'

import { useAdminForm } from '~features/admin-form/common/queries'
import { PREVIEW_MOCK_UINFIN } from '~features/admin-form/preview/constants'
import { useEnv } from '~features/env/queries'
import { EndPageBlock } from '~features/public-form/components/FormEndPage/components/EndPageBlock'
import { PaymentsThankYouSvgr } from '~features/public-form/components/FormEndPage/components/PaymentsThankYouSvgr'
import { ThankYouSvgr } from '~features/public-form/components/FormEndPage/components/ThankYouSvgr'
import {
FormBannerLogo,
useFormBannerLogo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ export const DeleteTwilioModal = ({
</ModalHeader>
<ModalBody whiteSpace="pre-wrap">
<Text textStyle="body-2" color="secondary.500">
Are you sure you want to remove your Twilio credentials? You will
not be able to use the Verified SMS feature unless you have free
SMSes remaining.
Are you sure you want to remove your Twilio credentials?
</Text>
</ModalBody>
<ModalFooter>
Expand Down
Loading
Loading