Skip to content

Commit 8246d3d

Browse files
Release v1.50.3 (#1168)
## Changes - Step changes now updates flow's `updated_at` column - Show (View Tile) button in editor - Fix executions pages step count - Backwards compatibility for sgID to MyInfo migration in FormSG --------- Co-authored-by: kevin <[email protected]>
2 parents 1497a45 + 2fa94b0 commit 8246d3d

File tree

34 files changed

+845
-173
lines changed

34 files changed

+845
-173
lines changed

package-lock.json

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

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,5 @@
109109
"tsconfig-paths": "^4.2.0",
110110
"type-fest": "4.10.3"
111111
},
112-
"version": "1.50.2"
112+
"version": "1.50.3"
113113
}

packages/backend/src/apps/formsg/__tests__/auth/decrypt-form-response.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ describe('decrypt form response', () => {
279279
],
280280
verified: {
281281
uinFin: 'S1234567A',
282-
sgidUinFin: 'S2345678B',
283282
cpUid: 'U987654323PLUMBER',
284283
},
285284
})
@@ -313,7 +312,7 @@ describe('decrypt form response', () => {
313312
},
314313
verifiedSubmitterInfo: {
315314
uinFin: 'S1234567A',
316-
sgidUinFin: 'S2345678B',
315+
sgidUinFin: 'S1234567A',
317316
cpUid: 'U987654323PLUMBER',
318317
},
319318
}),
@@ -371,7 +370,7 @@ describe('decrypt form response', () => {
371370
},
372371
verifiedSubmitterInfo: {
373372
uinFin: 'Z1cImQNbDXdmOaeS2roacWNxH7MbJC75OiEeYOjSbRo=',
374-
sgidUinFin: 'UAM3XbFrbNVVuD9Phz3KV/roZj4aG/Ql3Ap5Y5dTtJ4=',
373+
sgidUinFin: 'Z1cImQNbDXdmOaeS2roacWNxH7MbJC75OiEeYOjSbRo=',
375374
cpUid: 'U987654323PLUMBER',
376375
},
377376
}),
@@ -407,7 +406,7 @@ describe('decrypt form response', () => {
407406
},
408407
verifiedSubmitterInfo: {
409408
uinFin: 'xxxxx567A',
410-
sgidUinFin: 'xxxxx678B',
409+
sgidUinFin: 'xxxxx567A',
411410
cpUid: 'U987654323PLUMBER',
412411
},
413412
}),
@@ -426,7 +425,6 @@ describe('decrypt form response', () => {
426425
},
427426
],
428427
verified: {
429-
sgidUinFin: 'S1234567A',
430428
uinFin: '12345678B',
431429
cpUid: 'U987654323PLUMBER',
432430
cpUen: '987654321Z',
@@ -438,7 +436,7 @@ describe('decrypt form response', () => {
438436
expect($.request.body).toEqual(
439437
expect.objectContaining({
440438
verifiedSubmitterInfo: {
441-
sgidUinFin: 'S1234567A',
439+
sgidUinFin: '12345678B',
442440
uinFin: '12345678B',
443441
cpUid: 'U987654323PLUMBER',
444442
cpUen: '987654321Z',

packages/backend/src/apps/formsg/auth/decrypt-form-response.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ export async function decryptFormResponse(
189189
}
190190

191191
verifiedSubmitterInfo[key] = value
192+
// for backwards compatibility with old forms that were created with sgID authType
193+
if (key === 'uinFin') {
194+
verifiedSubmitterInfo['sgidUinFin'] = value
195+
}
192196
}
193197
}
194198

packages/backend/src/apps/formsg/triggers/new-submission/get-data-out-metadata.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ function buildAnswerArrayMetadatum(
222222
function buildVerifiedSubmitterInfoMetadata(
223223
data: IJSONObject,
224224
): IDataOutMetadata | null {
225-
if (!data.verifiedSubmitterInfo) {
225+
if (
226+
!data.verifiedSubmitterInfo ||
227+
typeof data.verifiedSubmitterInfo !== 'object'
228+
) {
226229
return null
227230
}
228231

@@ -234,7 +237,10 @@ function buildVerifiedSubmitterInfoMetadata(
234237
metadata.uinFin = { label: 'NRIC/FIN (Verified)' }
235238
break
236239
case 'sgidUinFin':
237-
metadata.sgidUinFin = { label: 'NRIC/FIN (Verified)' }
240+
metadata.sgidUinFin = {
241+
label: 'NRIC/FIN (Verified)',
242+
isHiddenFromList: 'uinFin' in data.verifiedSubmitterInfo,
243+
}
238244
break
239245
case 'cpUid':
240246
metadata.cpUid = { label: 'CorpPass UID (Verified)' }

packages/backend/src/apps/formsg/triggers/new-submission/get-mock-data.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,16 @@ function generateVerifiedSubmitterInfoData(
4040
): Record<string, Record<string, string>> {
4141
const filteredNric = filterNric($, MOCK_NRIC)
4242
switch (authType) {
43-
case 'SGID':
44-
case 'SGID_MyInfo':
45-
return {
46-
verifiedSubmitterInfo: {
47-
sgidUinFin: filteredNric,
48-
},
49-
}
50-
case 'SP':
43+
case 'SGID': // deprecated
44+
case 'SGID_MyInfo': // deprecated
45+
case 'SP': // deprecated
5146
case 'MyInfo':
47+
// for backwards compatibility with old forms that were created with sgID authType,
48+
// we need to return both uinFin and sgidUinFin
5249
return {
5350
verifiedSubmitterInfo: {
5451
uinFin: filteredNric,
52+
sgidUinFin: filteredNric,
5553
},
5654
}
5755
case 'CP':

packages/backend/src/apps/tiles/actions/create-row/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const action: IRawAction = {
2020
type: 'dropdown' as const,
2121
required: true,
2222
variables: false,
23+
clickableLink: {
24+
label: 'View tile',
25+
url: '/tiles/{value}',
26+
},
2327
showOptionValue: false,
2428
addNewOption: {
2529
id: 'tiles-createTileRow-tableId',

packages/backend/src/apps/tiles/actions/find-multiple-rows/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ const action: IRawAction = {
3131
required: true,
3232
variables: false,
3333
showOptionValue: false,
34+
clickableLink: {
35+
label: 'View tile',
36+
url: '/tiles/{value}',
37+
},
3438
source: {
3539
type: 'query' as const,
3640
name: 'getDynamicData' as const,

packages/backend/src/apps/tiles/actions/find-single-row/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ const action: IRawAction = {
2626
required: true,
2727
variables: false,
2828
showOptionValue: false,
29+
clickableLink: {
30+
label: 'View tile',
31+
url: '/tiles/{value}',
32+
},
2933
source: {
3034
type: 'query' as const,
3135
name: 'getDynamicData' as const,

packages/backend/src/apps/tiles/actions/update-row/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ const action: IRawAction = {
2727
required: true,
2828
variables: false,
2929
showOptionValue: false,
30+
clickableLink: {
31+
label: 'View tile',
32+
url: '/tiles/{value}',
33+
},
3034
source: {
3135
type: 'query' as const,
3236
name: 'getDynamicData' as const,

0 commit comments

Comments
 (0)