Skip to content

Commit c119875

Browse files
authored
build: release v6.260.0 (#8823)
* feat: email redact (#8821) * feat: mask optionsToRecipientsMap and static workflow step emails * fix: retain admin id if not populated * feat: update docs to jsdocs * fix: not pojo after stripping * feat: add tc coverage for redaction and splitting of getPublicView * feat: simplify strip options to recipients map * feat: remove unneeded destructuring * feat: apply lint changes * chore: bump version to v6.260.0
2 parents 325f11c + 96c5ad4 commit c119875

File tree

12 files changed

+366
-40
lines changed

12 files changed

+366
-40
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@ 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.260.0](https://github.com/opengovsg/FormSG/compare/v6.259.0...v6.260.0)
8+
9+
- feat: email redact [`#8821`](https://github.com/opengovsg/FormSG/pull/8821)
10+
- build: merge release v6.259.0 to develop [`#8820`](https://github.com/opengovsg/FormSG/pull/8820)
11+
- build: release v6.259.0 [`#8819`](https://github.com/opengovsg/FormSG/pull/8819)
12+
713
#### [v6.259.0](https://github.com/opengovsg/FormSG/compare/v6.258.0...v6.259.0)
814

15+
> 16 October 2025
16+
917
- fix: myinfo child not reflecting correct vaccination status [`#8818`](https://github.com/opengovsg/FormSG/pull/8818)
1018
- build: merge release v6.258.0 to develop [`#8817`](https://github.com/opengovsg/FormSG/pull/8817)
1119
- build: release v6.258.0 [`#8816`](https://github.com/opengovsg/FormSG/pull/8816)
20+
- chore: bump version to v6.259.0 [`1ee5a2f`](https://github.com/opengovsg/FormSG/commit/1ee5a2f5ebd3542b2ce34855547cc868f08b4154)
1221

1322
#### [v6.258.0](https://github.com/opengovsg/FormSG/compare/v6.257.0...v6.258.0)
1423

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

frontend/src/features/form/utils/augmentFieldWithMrfWorkflowDisabling.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { FormFieldDto, FormWorkflowStep } from '~shared/types'
1+
import { FormFieldDto, StrippedFormWorkflowStepDto } from '~shared/types'
22

33
import { NON_RESPONSE_FIELD_SET } from '../constants'
44

55
export const isFieldEnabledByMrfWorkflow = (
6-
workflowStep: FormWorkflowStep | undefined,
6+
workflowStep: StrippedFormWorkflowStepDto | undefined,
77
field: FormFieldDto,
88
) => {
99
// If no workflow, default to enabled
@@ -24,7 +24,7 @@ export const isFieldEnabledByMrfWorkflow = (
2424
* @returns The field with the disabled property set based on the workflow step and its previous disabled state
2525
*/
2626
export const augmentFieldWithMrfWorkflowDisabling = (
27-
workflowStep: FormWorkflowStep | undefined,
27+
workflowStep: StrippedFormWorkflowStepDto | undefined,
2828
field: FormFieldDto,
2929
) => ({
3030
...field,

frontend/src/features/public-form/PublicFormProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ import { ErrorCode } from '~shared/types/errorCodes'
3030
import {
3131
FormAuthType,
3232
FormResponseMode,
33-
FormWorkflowStepDto,
3433
Language,
3534
ProductItem,
3635
PublicFormDto,
36+
StrippedFormWorkflowStepDto,
3737
} from '~shared/types/form'
3838
import { centsToDollars, dollarsToCents } from '~shared/utils/payments'
3939

@@ -210,7 +210,7 @@ const transformFormInputTrimTextInputs =
210210

211211
export const augmentFormFields = (
212212
formFields: FormFieldDto[],
213-
currentStepNumberWorkflowStep?: FormWorkflowStepDto,
213+
currentStepNumberWorkflowStep?: StrippedFormWorkflowStepDto,
214214
) => {
215215
return formFields
216216
.map(augmentWithMyInfo)
@@ -256,7 +256,7 @@ export const getInitialFormValues = ({
256256
formResponseMode: FormResponseMode
257257
previousSubmission?: ReturnType<typeof decryptSubmission>
258258
previousAttachments?: Record<string, ArrayBuffer>
259-
currentStepNumberWorkflowStep?: FormWorkflowStepDto
259+
currentStepNumberWorkflowStep?: StrippedFormWorkflowStepDto
260260
augmentedFormFields: FormFieldDto[]
261261
fieldPrefillMap: PrefillMap
262262
draftResponsesToRestore: FormFieldValues

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.259.0",
4+
"version": "6.260.0",
55
"homepage": "https://form.gov.sg",
66
"authors": [
77
"FormSG <[email protected]>"

shared/types/form/form.ts

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { PublicUserDto, UserDto } from '../user'
22
import {
3+
BasicField,
34
FormField,
45
FormFieldDto,
56
MyInfoChildData,
67
TranslationMapping,
78
} from '../field'
89

910
import { FormLogo } from './form_logo'
10-
import type { Merge, Tagged, PartialDeep } from 'type-fest'
11+
import type { Except, Merge, Tagged, PartialDeep } from 'type-fest'
1112
import {
1213
ADMIN_FORM_META_FIELDS,
1314
EMAIL_FORM_SETTINGS_FIELDS,
@@ -21,7 +22,12 @@ import { DateString } from '../generic'
2122
import { FormLogic, LogicDto } from './form_logic'
2223
import { PaymentChannel, PaymentMethodType, PaymentType } from '../payment'
2324
import { Product } from './product'
24-
import { FormWorkflow, FormWorkflowDto, FormWorkflowStepDto } from './workflow'
25+
import {
26+
FormWorkflow,
27+
FormWorkflowDto,
28+
FormWorkflowStepDto,
29+
StrippedFormWorkflowDto,
30+
} from './workflow'
2531
import { ErrorCode } from '../errorCodes'
2632

2733
export type FormId = Tagged<string, 'FormId'>
@@ -310,10 +316,28 @@ export type PublicMultirespondentFormDto = Merge<
310316
PublicFormBase
311317
>
312318

313-
export type PublicFormDto =
319+
export type StrippedPublicMultirespondentFormDto =
320+
PublicMultirespondentFormDto & {
321+
workflow: StrippedFormWorkflowDto
322+
}
323+
324+
/**
325+
* Used for public form view to redact sensitive information.
326+
* Specifically, it omits optionsToRecipientsMap for Dropdown field types.
327+
*/
328+
export type StrippedFormFieldDto<T extends FormFieldDto = FormFieldDto> =
329+
T extends {
330+
fieldType: BasicField.Dropdown
331+
}
332+
? Except<T, 'optionsToRecipientsMap'>
333+
: T
334+
335+
export type PublicFormDto = Merge<
314336
| PublicStorageFormDto
315337
| PublicEmailFormDto
316-
| PublicMultirespondentFormDto
338+
| StrippedPublicMultirespondentFormDto,
339+
{ form_fields: StrippedFormFieldDto[] }
340+
>
317341

318342
export type EmailFormSettings = Pick<
319343
EmailFormDto,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { omit } from 'lodash'
2+
import { BasicField, FormFieldDto } from '../types'
3+
4+
export function stripDropdownFieldOptionsToRecipientsMap(
5+
formFields: FormFieldDto[],
6+
): FormFieldDto[] {
7+
return formFields.map((formField) => {
8+
if (formField.fieldType === BasicField.Dropdown) {
9+
return omit(formField, 'optionsToRecipientsMap')
10+
}
11+
return formField
12+
})
13+
}

0 commit comments

Comments
 (0)