Skip to content

Commit 2ae0333

Browse files
authored
Merge pull request #8853 from opengovsg/release_v6.264.0
build: release v6.264.0
2 parents 2701b61 + 6dbbae0 commit 2ae0333

File tree

48 files changed

+799
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+799
-221
lines changed

CHANGELOG.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [v6.264.0](https://github.com/opengovsg/FormSG/compare/v6.263.0...v6.264.0)
8+
9+
- feat(i18n): extract text from various modals [`#8843`](https://github.com/opengovsg/FormSG/pull/8843)
10+
- build: merge release v6.263. to develop [`#8848`](https://github.com/opengovsg/FormSG/pull/8848)
11+
- build: release v6.263.0 [`#8847`](https://github.com/opengovsg/FormSG/pull/8847)
12+
713
#### [v6.263.0](https://github.com/opengovsg/FormSG/compare/v6.262.0...v6.263.0)
814

15+
> 28 October 2025
16+
917
- fix: radio others bug v2 [`#8842`](https://github.com/opengovsg/FormSG/pull/8842)
1018
- feat: remove betaFlag from signature field in basic field list drawer [`#8846`](https://github.com/opengovsg/FormSG/pull/8846)
1119
- fix(deps): bump libphonenumber-js from 1.12.23 to 1.12.25 in /shared [`#8841`](https://github.com/opengovsg/FormSG/pull/8841)
@@ -15,6 +23,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1523
- build(deps-dev): bump vite from 5.4.20 to 5.4.21 in /frontend [`#8831`](https://github.com/opengovsg/FormSG/pull/8831)
1624
- build: merge release v6.262.0 to develop [`#8833`](https://github.com/opengovsg/FormSG/pull/8833)
1725
- build: release v6.262.0 [`#8832`](https://github.com/opengovsg/FormSG/pull/8832)
26+
- chore: bump version to v6.263.0 [`51d1069`](https://github.com/opengovsg/FormSG/commit/51d1069406c2e810280f1568673842fb6cad00dc)
1827

1928
#### [v6.262.0](https://github.com/opengovsg/FormSG/compare/v6.261.0...v6.262.0)
2029

@@ -660,7 +669,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
660669
- fix(deps): bump libphonenumber-js from 1.12.8 to 1.12.9 in /shared [`#8466`](https://github.com/opengovsg/FormSG/pull/8466)
661670
- build: release v6.206.0 [`#8464`](https://github.com/opengovsg/FormSG/pull/8464)
662671
- chore: bump version to v6.207.0 [`24ca7e8`](https://github.com/opengovsg/FormSG/commit/24ca7e8e8ad6d42f2dfd3ad4223fcc3809e79272)
663-
- chore: bump version to v6.206.0 [`b121e2f`](https://github.com/opengovsg/FormSG/commit/b121e2ff3234ebf09f14d90dbf631297bd44c606)
664672

665673
#### [v6.206.0](https://github.com/opengovsg/FormSG/compare/v6.205.0...v6.206.0)
666674

@@ -669,7 +677,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
669677
- fix: retain isForceConvertToStorageMode for email mode form converts [`#8463`](https://github.com/opengovsg/FormSG/pull/8463)
670678
- build: merge release v6.205.0 to develop [`#8461`](https://github.com/opengovsg/FormSG/pull/8461)
671679
- build: release v6.205.0 [`#8460`](https://github.com/opengovsg/FormSG/pull/8460)
672-
- chore: bump version to v6.206.0 [`7e58553`](https://github.com/opengovsg/FormSG/commit/7e585531370be5555910bb73a0cedd3a03b43ee6)
680+
- chore: bump version to v6.206.0 [`b121e2f`](https://github.com/opengovsg/FormSG/commit/b121e2ff3234ebf09f14d90dbf631297bd44c606)
673681

674682
#### [v6.205.0](https://github.com/opengovsg/FormSG/compare/v6.204.0...v6.205.0)
675683

@@ -699,7 +707,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
699707
- fix(deps): bump zod from 3.25.20 to 3.25.28 in /shared [`#8422`](https://github.com/opengovsg/FormSG/pull/8422)
700708
- fix(deps): bump zod from 3.25.17 to 3.25.20 in /shared [`#8411`](https://github.com/opengovsg/FormSG/pull/8411)
701709
- chore: bump version to v6.204.0 [`162f9c6`](https://github.com/opengovsg/FormSG/commit/162f9c65764ddcd8e2dfcf489d2b637a81373691)
702-
- chore: bump version to v6.203.0 [`fa0d417`](https://github.com/opengovsg/FormSG/commit/fa0d4178044d022d0acc097af13e377b7a37d292)
703710

704711
#### [v6.203.0](https://github.com/opengovsg/FormSG/compare/v6.202.0...v6.203.0)
705712

@@ -711,7 +718,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
711718
- feat: add iac tag [`#8403`](https://github.com/opengovsg/FormSG/pull/8403)
712719
- feat: add error span tag for dd retention filter to index [`#8402`](https://github.com/opengovsg/FormSG/pull/8402)
713720
- build: release v6.202.0 [`#8401`](https://github.com/opengovsg/FormSG/pull/8401)
714-
- chore: bump version to v6.203.0 [`48e8251`](https://github.com/opengovsg/FormSG/commit/48e825166839c820379846c21efc7a755a2a48e1)
721+
- chore: bump version to v6.203.0 [`fa0d417`](https://github.com/opengovsg/FormSG/commit/fa0d4178044d022d0acc097af13e377b7a37d292)
715722

716723
#### [v6.202.0](https://github.com/opengovsg/FormSG/compare/v6.201.0...v6.202.0)
717724

frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "form-frontend",
3-
"version": "6.263.0",
3+
"version": "6.264.0",
44
"homepage": ".",
55
"type": "module",
66
"private": true,

frontend/src/features/admin-form/common/components/CollaboratorModal/CollaboratorListScreen/AddCollaboratorInput.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCallback, useMemo } from 'react'
22
import { Controller, RegisterOptions, useForm } from 'react-hook-form'
3+
import { useTranslation } from 'react-i18next'
34
import { FormControl, Skeleton, Stack } from '@chakra-ui/react'
45
import { isEmpty } from 'lodash'
56
import isEmail from 'validator/lib/isEmail'
@@ -27,6 +28,9 @@ export type AddCollaboratorInputs = {
2728
}
2829

2930
const useAddCollaboratorInput = () => {
31+
const { t } = useTranslation('translation', {
32+
keyPrefix: 'features.adminForm.collaborator.addInput',
33+
})
3034
const { handleForwardToTransferOwnership, formId } = useCollaboratorWizard()
3135
const { isLoading, collaborators, form, isFormAdmin } =
3236
useAdminFormCollaborators(formId)
@@ -76,23 +80,23 @@ const useAddCollaboratorInput = () => {
7680
const validationRules: RegisterOptions<AddCollaboratorInputs, 'email'> =
7781
useMemo(() => {
7882
return {
79-
required: 'Collaborator email is required',
83+
required: t('errors.required'),
8084
validate: {
8185
validEmail: (value: string) =>
82-
!value || isEmail(value) || 'Please enter a valid email',
86+
!value || isEmail(value) || t('errors.invalidEmail'),
8387
duplicateEmail: (value: string) =>
8488
!value ||
8589
!collaborators?.find(
8690
(c) => c.email.toLowerCase() === value.toLowerCase(),
8791
) ||
88-
'This user is an existing collaborator. Edit role below.',
92+
t('errors.duplicate'),
8993
ownerEmail: (value: string) =>
9094
!value ||
9195
form?.admin.email?.toLowerCase() !== value.toLowerCase() ||
92-
'You cannot add the form owner as a collaborator',
96+
t('errors.ownerEmail'),
9397
},
9498
}
95-
}, [collaborators, form?.admin.email])
99+
}, [collaborators, form?.admin.email, t])
96100

97101
const isMobile = useIsMobile()
98102

@@ -114,6 +118,9 @@ const useAddCollaboratorInput = () => {
114118
}
115119

116120
export const AddCollaboratorInput = (): JSX.Element => {
121+
const { t } = useTranslation('translation', {
122+
keyPrefix: 'features.adminForm.collaborator.addInput',
123+
})
117124
const {
118125
formMethods: {
119126
control,
@@ -132,19 +139,16 @@ export const AddCollaboratorInput = (): JSX.Element => {
132139
return (
133140
<form noValidate onSubmit={handleInputSubmission}>
134141
<FormControl isInvalid={!isEmpty(errors)} isReadOnly={isMutationLoading}>
135-
<FormLabel
136-
isRequired
137-
description="Share your secret key with users who need to access response data"
138-
>
139-
Add collaborators or transfer form ownership
142+
<FormLabel isRequired description={t('description')}>
143+
{t('label')}
140144
</FormLabel>
141145
<Skeleton isLoaded={!isQueryLoading}>
142146
<Stack direction={{ base: 'column', md: 'row' }}>
143147
<Input
144148
isDisabled={isQueryLoading}
145149
type="email"
146150
{...register('email', validationRules)}
147-
placeholder="[email protected]"
151+
placeholder={t('email.placeholder')}
148152
/>
149153
<Controller
150154
name="role"
@@ -172,9 +176,7 @@ export const AddCollaboratorInput = (): JSX.Element => {
172176
mt="1rem"
173177
type="submit"
174178
>
175-
{isTransferOwnershipSelected
176-
? 'Transfer form ownership'
177-
: 'Add collaborator'}
179+
{isTransferOwnershipSelected ? t('button.transfer') : t('button.add')}
178180
</Button>
179181
</form>
180182
)

frontend/src/features/admin-form/common/components/CollaboratorModal/CollaboratorListScreen/CollaboratorList.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useCallback, useMemo } from 'react'
2+
import { useTranslation } from 'react-i18next'
23
import { BiTrash } from 'react-icons/bi'
34
import { Spacer, Stack, StackDivider } from '@chakra-ui/react'
45

@@ -23,20 +24,26 @@ type CollaboratorRowMeta = {
2324
}
2425

2526
const RemoveCollaboratorButton = (
26-
props: Pick<IconButtonProps, 'isDisabled' | 'isLoading' | 'onClick'>,
27+
props: Pick<IconButtonProps, 'isDisabled' | 'isLoading' | 'onClick'> & {
28+
ariaLabel: string
29+
},
2730
) => {
31+
const { ariaLabel, ...rest } = props
2832
return (
2933
<IconButton
3034
icon={<BiTrash />}
3135
variant="clear"
3236
colorScheme="danger"
33-
aria-label="Remove collaborator"
34-
{...props}
37+
aria-label={ariaLabel}
38+
{...rest}
3539
/>
3640
)
3741
}
3842

3943
export const CollaboratorList = (): JSX.Element => {
44+
const { t } = useTranslation('translation', {
45+
keyPrefix: 'features.adminForm.collaborator',
46+
})
4047
const isMobile = useIsMobile()
4148
// Admin form data required for checking for duplicate emails.
4249
const {
@@ -166,6 +173,7 @@ export const CollaboratorList = (): JSX.Element => {
166173
onChange={handleUpdateRole(row)}
167174
/>
168175
<RemoveCollaboratorButton
176+
ariaLabel={t('list.removeButton.ariaLabel')}
169177
isLoading={
170178
areMutationsLoading &&
171179
mutateRemoveCollaborator.variables?.permissionToRemove
@@ -179,6 +187,7 @@ export const CollaboratorList = (): JSX.Element => {
179187
<ViewOnlyPermission role={row.role}>
180188
{isCurrentUser ? (
181189
<RemoveCollaboratorButton
190+
ariaLabel={t('list.removeButton.ariaLabel')}
182191
isDisabled={areMutationsLoading}
183192
onClick={handleForwardToRemoveSelf}
184193
/>

frontend/src/features/admin-form/common/components/CollaboratorModal/CollaboratorListScreen/CollaboratorListScreen.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useTranslation } from 'react-i18next'
12
import { ModalBody, ModalHeader, Stack } from '@chakra-ui/react'
23

34
import { useAdminFormCollaborators } from '~features/admin-form/common/queries'
@@ -8,12 +9,15 @@ import { AddCollaboratorInput } from './AddCollaboratorInput'
89
import { CollaboratorList } from './CollaboratorList'
910

1011
export const CollaboratorListScreen = (): JSX.Element => {
12+
const { t } = useTranslation('translation', {
13+
keyPrefix: 'features.adminForm.collaborator',
14+
})
1115
const { formId } = useCollaboratorWizard()
1216
const { hasEditAccess } = useAdminFormCollaborators(formId)
1317
return (
1418
<>
1519
<ModalHeader color="secondary.700">
16-
{hasEditAccess ? 'Manage collaborators' : 'Collaborators'}
20+
{hasEditAccess ? t('list.header.manage') : t('list.header.view')}
1721
</ModalHeader>
1822
<ModalBody whiteSpace="pre-wrap">
1923
<Stack spacing="2.5rem" pb="2rem">

frontend/src/features/admin-form/common/components/CollaboratorModal/CollaboratorListScreen/PermissionDropdown.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useMemo } from 'react'
2+
import { useTranslation } from 'react-i18next'
23
import { Text } from '@chakra-ui/react'
34

45
import Menu from '~components/Menu'
@@ -20,6 +21,21 @@ export const PermissionDropdown = ({
2021
allowTransferOwnership,
2122
buttonVariant = 'outline',
2223
}: PermissionDropdownProps): JSX.Element => {
24+
const { t } = useTranslation('translation', {
25+
keyPrefix: 'features.adminForm.collaborator.roles',
26+
})
27+
28+
const getRoleLabel = (role: DropdownRole): string => {
29+
switch (role) {
30+
case DropdownRole.Owner:
31+
return t('owner')
32+
case DropdownRole.Editor:
33+
return t('editor')
34+
case DropdownRole.Viewer:
35+
return t('viewer')
36+
}
37+
}
38+
2339
const availableRoles = useMemo(() => {
2440
return Object.values(DropdownRole).filter((role) => {
2541
// Either not owner role, or owner role and allowTransferOwnership is true.
@@ -39,7 +55,7 @@ export const PermissionDropdown = ({
3955
isActive={isOpen}
4056
iconSpacing="1.5rem"
4157
>
42-
{value}
58+
{getRoleLabel(value)}
4359
</Menu.Button>
4460
<Menu.List defaultValue={value}>
4561
{availableRoles.map((role) => (
@@ -48,7 +64,7 @@ export const PermissionDropdown = ({
4864
// Styling to hint to user the current active choice
4965
fontWeight={role === value ? 500 : 400}
5066
>
51-
{role}
67+
{getRoleLabel(role)}
5268
</Text>
5369
</Menu.Item>
5470
))}

frontend/src/features/admin-form/common/components/CollaboratorModal/CollaboratorListScreen/ViewOnlyPermission.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useTranslation } from 'react-i18next'
12
import { Stack, StackProps, Text } from '@chakra-ui/react'
23

34
import { DropdownRole } from '../constants'
@@ -12,6 +13,21 @@ export const ViewOnlyPermission = ({
1213
children,
1314
...stackProps
1415
}: ViewOnlyPermissionProps): JSX.Element => {
16+
const { t } = useTranslation('translation', {
17+
keyPrefix: 'features.adminForm.collaborator.roles',
18+
})
19+
20+
const getRoleLabel = (role: DropdownRole): string => {
21+
switch (role) {
22+
case DropdownRole.Owner:
23+
return t('owner')
24+
case DropdownRole.Editor:
25+
return t('editor')
26+
case DropdownRole.Viewer:
27+
return t('viewer')
28+
}
29+
}
30+
1531
return (
1632
<Stack
1733
direction="row"
@@ -26,7 +42,7 @@ export const ViewOnlyPermission = ({
2642
textStyle="body-2"
2743
color="secondary.500"
2844
>
29-
{role}
45+
{getRoleLabel(role)}
3046
</Text>
3147
{children}
3248
</Stack>

frontend/src/features/admin-form/common/components/CollaboratorModal/RemoveSelfScreen/RemoveSelfScreen.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useCallback } from 'react'
2+
import { useTranslation } from 'react-i18next'
23
import {
34
ModalBody,
45
ModalFooter,
@@ -15,6 +16,10 @@ import { useMutateCollaborators } from '~features/admin-form/common/mutations'
1516
import { useCollaboratorWizard } from '../CollaboratorWizardContext'
1617

1718
export const RemoveSelfScreen = (): JSX.Element | null => {
19+
const { t } = useTranslation('translation', {
20+
keyPrefix: 'features.adminForm.collaborator',
21+
})
22+
const { t: tCommon } = useTranslation()
1823
const isMobile = useIsMobile()
1924
const { mutateRemoveSelf } = useMutateCollaborators()
2025
const { handleBackToList, onClose } = useCollaboratorWizard()
@@ -25,14 +30,9 @@ export const RemoveSelfScreen = (): JSX.Element | null => {
2530

2631
return (
2732
<>
28-
<ModalHeader color="secondary.700">
29-
Remove myself as collaborator
30-
</ModalHeader>
33+
<ModalHeader color="secondary.700">{t('removeSelf.header')}</ModalHeader>
3134
<ModalBody whiteSpace="pre-wrap" color="secondary.500">
32-
<Text>
33-
You are removing yourself as a collaborator and will lose all access
34-
to this form. This action cannot be undone.
35-
</Text>
35+
<Text>{t('removeSelf.message')}</Text>
3636
</ModalBody>
3737
<ModalFooter>
3838
<Stack
@@ -46,7 +46,7 @@ export const RemoveSelfScreen = (): JSX.Element | null => {
4646
colorScheme="danger"
4747
onClick={handleRemoveSelf}
4848
>
49-
Yes, remove myself
49+
{t('removeSelf.button.confirm')}
5050
</Button>
5151
<Button
5252
isFullWidth={isMobile}
@@ -55,7 +55,7 @@ export const RemoveSelfScreen = (): JSX.Element | null => {
5555
colorScheme="secondary"
5656
onClick={handleBackToList}
5757
>
58-
Cancel
58+
{tCommon('features.common.cancel')}
5959
</Button>
6060
</Stack>
6161
</ModalFooter>

0 commit comments

Comments
 (0)