Skip to content

Commit 5e1eab9

Browse files
authored
Merge pull request #8917 from opengovsg/release_v6.273.0
build: release v6.273.0
2 parents 0f2fc41 + 3e70091 commit 5e1eab9

File tree

10 files changed

+173
-44
lines changed

10 files changed

+173
-44
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,25 @@ 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.273.0](https://github.com/opengovsg/FormSG/compare/v6.272.0...v6.273.0)
8+
9+
- fix: myinfo children missing prefix [`#8916`](https://github.com/opengovsg/FormSG/pull/8916)
10+
- chore: modify respondent copy helper text v1 [`#8915`](https://github.com/opengovsg/FormSG/pull/8915)
11+
- fix(deps): bump libphonenumber-js from 1.12.26 to 1.12.29 in /shared [`#8913`](https://github.com/opengovsg/FormSG/pull/8913)
12+
- chore(deps-dev): bump @types/lodash from 4.17.20 to 4.17.21 in /shared [`#8912`](https://github.com/opengovsg/FormSG/pull/8912)
13+
- fix(deps): bump validator from 13.15.20 to 13.15.23 in /shared [`#8877`](https://github.com/opengovsg/FormSG/pull/8877)
14+
- build(deps): bump glob in /react-email-preview [`#8906`](https://github.com/opengovsg/FormSG/pull/8906)
15+
- build: merge release-al2 v6.272.0 back to develop [`#8911`](https://github.com/opengovsg/FormSG/pull/8911)
16+
- build: release v6.272.0 [`#8909`](https://github.com/opengovsg/FormSG/pull/8909)
17+
718
#### [v6.272.0](https://github.com/opengovsg/FormSG/compare/v6.271.0...v6.272.0)
819

20+
> 20 November 2025
21+
922
- feat: respondent copy v3 (phase2) [`#8869`](https://github.com/opengovsg/FormSG/pull/8869)
1023
- build: merge release-al2 v6.271.0 back to develop [`#8908`](https://github.com/opengovsg/FormSG/pull/8908)
1124
- build: release v6.271.0 [`#8905`](https://github.com/opengovsg/FormSG/pull/8905)
25+
- chore: bump version to v6.272.0 [`cb0291c`](https://github.com/opengovsg/FormSG/commit/cb0291c53c28c8f7833f5be049f2a53cb52ffd24)
1226

1327
#### [v6.271.0](https://github.com/opengovsg/FormSG/compare/v6.270.0...v6.271.0)
1428

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.272.0",
3+
"version": "6.273.0",
44
"homepage": ".",
55
"type": "module",
66
"private": true,

frontend/src/i18n/locales/features/public-form/fields/en-sg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const enSG: Fields = {
4040
'The entered email does not belong to an allowed email domain',
4141
},
4242
respondentCopyHelperText:
43-
'A copy of your responses will be sent to this email address',
43+
'A copy of the responses will be sent to this email address',
4444
},
4545
verification: {
4646
button: {

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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "FormSG",
33
"description": "Form Manager for Government",
4-
"version": "6.272.0",
4+
"version": "6.273.0",
55
"homepage": "https://form.gov.sg",
66
"authors": [
77
"FormSG <[email protected]>"

react-email-preview/package-lock.json

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

shared/package-lock.json

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

src/app/modules/submission/encrypt-submission/__tests__/encrypt-submission.utils.spec.ts

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { IPopulatedEncryptedForm, StorageModeSubmissionData } from 'src/types'
66

77
import {
88
createStorageModeSubmissionDto,
9+
formatMyInfoStorageResponseData,
910
getPaymentAmount,
1011
getPaymentIntentDescription,
1112
} from '../encrypt-submission.utils'
@@ -150,4 +151,80 @@ describe('encrypt-submission.utils', () => {
150151
expect(result).toContain(expectedValue)
151152
})
152153
})
154+
155+
describe('formatMyInfoStorageResponseData', () => {
156+
it('should return original responses when no hashed fields are provided', () => {
157+
// Arrange
158+
const parsedResponses: any[] = [
159+
{ _id: 'field1', question: 'Question 1' },
160+
{ _id: 'field2', question: 'Question 2' },
161+
]
162+
163+
// Act
164+
const actual = formatMyInfoStorageResponseData(parsedResponses)
165+
166+
// Assert
167+
expect(actual).toEqual(parsedResponses)
168+
})
169+
170+
it('should prefix MyInfo fields in responses when hashed fields are provided', () => {
171+
// Arrange
172+
const parsedResponses: any[] = [
173+
{
174+
_id: 'field1',
175+
question: 'Question 1',
176+
myInfo: { attr: 'NAME' },
177+
answer: 'John Doe',
178+
fieldType: 'textfield',
179+
},
180+
{
181+
_id: 'field2',
182+
question: 'Question 2',
183+
answer: 'Some answer',
184+
fieldType: 'textfield',
185+
},
186+
{
187+
_id: 'childrenbirthrecords.692411846d1da146b503aada.childname.0',
188+
question: 'Question Child',
189+
myInfo: { attr: 'childname' },
190+
answer: 'Child Name',
191+
fieldType: 'children',
192+
},
193+
]
194+
const hashedFields = new Set([
195+
'field1',
196+
'childrenbirthrecords.692411846d1da146b503aada.childname.0',
197+
])
198+
199+
// Act
200+
const actual = formatMyInfoStorageResponseData(
201+
parsedResponses,
202+
hashedFields,
203+
)
204+
205+
// Assert
206+
expect(actual).toEqual([
207+
{
208+
_id: 'field1',
209+
question: '[MyInfo] Question 1',
210+
myInfo: { attr: 'NAME' },
211+
answer: 'John Doe',
212+
fieldType: 'textfield',
213+
},
214+
{
215+
_id: 'field2',
216+
question: 'Question 2',
217+
answer: 'Some answer',
218+
fieldType: 'textfield',
219+
},
220+
{
221+
_id: 'childrenbirthrecords.692411846d1da146b503aada.childname.0',
222+
question: '[MyInfo] Question Child',
223+
myInfo: { attr: 'childname' },
224+
answer: 'Child Name',
225+
fieldType: 'children',
226+
},
227+
])
228+
})
229+
})
153230
})

src/app/modules/submission/submission.utils.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,15 @@ export const getMyInfoPrefix = (
776776
response: ResponseFormattedForEmail | ProcessedFieldResponse,
777777
hashedFields: Set<MyInfoKey>,
778778
): string => {
779-
return !!response.myInfo?.attr && hashedFields.has(response._id)
779+
/* encrypt mode children fields have ids e.g. childrenbirthrecords.67585515e1ced6d790a91e14.childname.0
780+
* without the suffixed child name. So we check if any hashed fields starts with response id
781+
*/
782+
const isResponseMyInfoChildren =
783+
response.fieldType === BasicField.Children &&
784+
Array.from(hashedFields).some((field) => field.startsWith(response._id))
785+
786+
return !!response.myInfo?.attr &&
787+
(hashedFields.has(response._id) || isResponseMyInfoChildren)
780788
? MYINFO_PREFIX
781789
: ''
782790
}

0 commit comments

Comments
 (0)