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: merge Release 6.36.1 back into develop #5941

Merged
merged 4 commits into from
Mar 20, 2023
Merged
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
41 changes: 26 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ 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.36.0](https://github.com/opengovsg/FormSG/compare/v6.36.0...v6.36.0)
#### [v6.36.1](https://github.com/opengovsg/FormSG/compare/v6.36.0...v6.36.1)

- build: release v6.36.0 [`#5913`](https://github.com/opengovsg/FormSG/pull/5913)
- fix: trim dropdown options for logic check [`25e197a`](https://github.com/opengovsg/FormSG/commit/25e197a22eecec527b2b284aee0b95ccb1cd3797)

#### [v6.36.0](https://github.com/opengovsg/FormSG/compare/v6.35.0...v6.36.0)

Expand All @@ -20,7 +23,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore(deps-dev): bump eslint-config-prettier from 8.6.0 to 8.7.0 in /shared [`#5895`](https://github.com/opengovsg/FormSG/pull/5895)
- chore(deps-dev): bump eslint-plugin-simple-import-sort from 8.0.0 to 10.0.0 [`#5771`](https://github.com/opengovsg/FormSG/pull/5771)
- chore(deps-dev): bump @typescript-eslint/parser from 5.54.0 to 5.54.1 in /shared [`#5892`](https://github.com/opengovsg/FormSG/pull/5892)
- chore: bump version to v6.36.0 [`a51adf1`](https://github.com/opengovsg/FormSG/commit/a51adf1a129ff473e62f38b6836e5282afc5b83f)
- chore: bump version to v6.36.0 [`d8d2b59`](https://github.com/opengovsg/FormSG/commit/d8d2b59db62d195916a8fcc3d84659dd20687de4)

#### [v6.35.0](https://github.com/opengovsg/FormSG/compare/v6.34.0...v6.35.0)

Expand Down Expand Up @@ -262,7 +265,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v6.24.0](https://github.com/opengovsg/FormSG/compare/v6.23.3...v6.24.0)

> 23 December 2022
> 22 December 2022

- feat: initialise datadog in head [`#5571`](https://github.com/opengovsg/FormSG/pull/5571)
- build: merge 6.23.3 into develop [`#5614`](https://github.com/opengovsg/FormSG/pull/5614)
Expand Down Expand Up @@ -299,7 +302,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v6.23.3](https://github.com/opengovsg/FormSG/compare/v6.23.2...v6.23.3)

> 23 December 2022
> 22 December 2022

- build: Release v6.23.2 hotfix [`#5602`](https://github.com/opengovsg/FormSG/pull/5602)
- chore: bump version to 6.23.2 [`1256707`](https://github.com/opengovsg/FormSG/commit/1256707db95a30486c2ccfc731d9ff6cbdb7dc40)
Expand Down Expand Up @@ -377,6 +380,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix: extend tags in then show logic blocks to be full width [`#5507`](https://github.com/opengovsg/FormSG/pull/5507)
- build: Release v6.20.0 [`#5496`](https://github.com/opengovsg/FormSG/pull/5496)
- chore: bump version to v6.21.0 [`3d189cf`](https://github.com/opengovsg/FormSG/commit/3d189cfdc7c105eb31987d31c1b38cb82f402952)
- chore: bump version to v6.20.0 [`54131bd`](https://github.com/opengovsg/FormSG/commit/54131bd9c354fbb9aa478ca871817c34b1544aaa)
- chore: fix changelog due to recut in v6.19.0 [`769efee`](https://github.com/opengovsg/FormSG/commit/769efee7d3552d5d675c1b81ed3320a931aafcb8)

#### [v6.20.0](https://github.com/opengovsg/FormSG/compare/v6.19.0...v6.20.0)
Expand All @@ -386,13 +390,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore: decommission SAML support for Singpass / Corppass [`#5469`](https://github.com/opengovsg/FormSG/pull/5469)
- chore: update chromatic GA to only run in PRs [`#5488`](https://github.com/opengovsg/FormSG/pull/5488)
- build: release v6.19.0 [`#5481`](https://github.com/opengovsg/FormSG/pull/5481)
- chore: bump version to v6.20.0 [`54131bd`](https://github.com/opengovsg/FormSG/commit/54131bd9c354fbb9aa478ca871817c34b1544aaa)
- Merge pull request #5490 from opengovsg/release-al2 [`bf0984e`](https://github.com/opengovsg/FormSG/commit/bf0984e8ae74382fd455c0821b16976793990932)

#### [v6.19.0](https://github.com/opengovsg/FormSG/compare/v6.18.5...v6.19.0)

> 29 November 2022

- feat: add public form `/use-template` redirection to admin form template page [`#5486`](https://github.com/opengovsg/FormSG/pull/5486)
- fix: remove form title special characters validation [`#5485`](https://github.com/opengovsg/FormSG/pull/5485)
- chore: merge hotfix release v6.18.5 to develop [`#5480`](https://github.com/opengovsg/FormSG/pull/5480)
Expand All @@ -407,15 +404,28 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix: extend MyInfo login expiry to match env var [`#5464`](https://github.com/opengovsg/FormSG/pull/5464)
- chore: merge hotfix release v6.18.4 back to develop [`#5472`](https://github.com/opengovsg/FormSG/pull/5472)
- feat: improve admin storage mode response printability [`#5460`](https://github.com/opengovsg/FormSG/pull/5460)
- fix: update field validators with more specific type guarantees [`#5468`](https://github.com/opengovsg/FormSG/pull/5468)
- build: hotfix release v6.18.4 [`#5470`](https://github.com/opengovsg/FormSG/pull/5470)
- fix: correctly perform logic validation on MyInfo prefilled fields [`#5467`](https://github.com/opengovsg/FormSG/pull/5467)
- fix: trim dropdown option answer in backend and in angularjs frontend [`#5466`](https://github.com/opengovsg/FormSG/pull/5466)
- chore(deps-dev): bump @babel/preset-env from 7.19.4 to 7.20.2 [`#5463`](https://github.com/opengovsg/FormSG/pull/5463)
- test: add email submission e2e tests [`#5162`](https://github.com/opengovsg/FormSG/pull/5162)
- feat: allow special chars in form title [`#5436`](https://github.com/opengovsg/FormSG/pull/5436)
- fix: release v6.18.3 [`#5459`](https://github.com/opengovsg/FormSG/pull/5459)
- chore(deps-dev): bump husky from 8.0.1 to 8.0.2 [`#5457`](https://github.com/opengovsg/FormSG/pull/5457)
- fix(docker-compose): change ports from 5000 to 5001 [`#5455`](https://github.com/opengovsg/FormSG/pull/5455)
- chore(deps-dev): bump @types/lodash from 4.14.189 to 4.14.190 in /shared [`#5454`](https://github.com/opengovsg/FormSG/pull/5454)
- chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.43.0 to 5.44.0 [`#5453`](https://github.com/opengovsg/FormSG/pull/5453)
- fix: update max dimension for image uploads [`#5451`](https://github.com/opengovsg/FormSG/pull/5451)
- fix(deps): bump @sentry/browser from 7.17.3 to 7.20.1 [`#5449`](https://github.com/opengovsg/FormSG/pull/5449)
- chore: bump version to v6.20.0 [`1f3f2b7`](https://github.com/opengovsg/FormSG/commit/1f3f2b7fbd0d0fec1980dacbba6a384aeb28b999)
- Merge pull request #5490 from opengovsg/release-al2 [`bf0984e`](https://github.com/opengovsg/FormSG/commit/bf0984e8ae74382fd455c0821b16976793990932)
- fix(deps): bump @aws-sdk/client-cloudwatch-logs to 3.216.0 [`ac812ec`](https://github.com/opengovsg/FormSG/commit/ac812ecdd14b11f9500e3d95aa75050be40d8e24)

#### [v6.19.0](https://github.com/opengovsg/FormSG/compare/v6.18.5...v6.19.0)

> 22 November 2022

- fix: disable submission in template mode [`#5443`](https://github.com/opengovsg/FormSG/pull/5443)
- fix(docker-compose): include US and SG SES env vars [`#5442`](https://github.com/opengovsg/FormSG/pull/5442)
- feat: use-template for forms [`#5377`](https://github.com/opengovsg/FormSG/pull/5377)
Expand All @@ -434,7 +444,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(deps): bump aws-sdk from 2.1251.0 to 2.1255.0 [`#5415`](https://github.com/opengovsg/FormSG/pull/5415)
- fix(deps): bump loader-utils from 1.4.0 to 1.4.2 [`#5416`](https://github.com/opengovsg/FormSG/pull/5416)
- chore(deps-dev): bump eslint-plugin-jest from 27.1.3 to 27.1.5 [`#5414`](https://github.com/opengovsg/FormSG/pull/5414)
- chore: bump version to v6.19.0 [`f245c66`](https://github.com/opengovsg/FormSG/commit/f245c66f1dbb133429101574889e55b479591061)
- chore: bump version to v6.19.0 [`04762a2`](https://github.com/opengovsg/FormSG/commit/04762a268542a70f3b9d10e1f8c7f273d32ac9bc)
- Merge pull request #5435 from opengovsg/release-al2 [`6023bac`](https://github.com/opengovsg/FormSG/commit/6023bac35189418bac8b1bb59cea53661df7fb76)

#### [v6.18.5](https://github.com/opengovsg/FormSG/compare/v6.18.4...v6.18.5)
Expand All @@ -443,16 +453,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- fix: update field validators with more specific type guarantees [`#5468`](https://github.com/opengovsg/FormSG/pull/5468)
- build: hotfix release v6.18.4 [`#5470`](https://github.com/opengovsg/FormSG/pull/5470)
- fix: correctly perform logic validation on MyInfo prefilled fields [`#5467`](https://github.com/opengovsg/FormSG/pull/5467)
- fix: trim dropdown option answer in backend and in angularjs frontend [`#5466`](https://github.com/opengovsg/FormSG/pull/5466)
- chore: bump version to 6.18.5 [`d542ca3`](https://github.com/opengovsg/FormSG/commit/d542ca3ba7273ddb1de5aa3cf91bdcff057ead07)
- chore: bump version to v6.18.4 [`fa4b57a`](https://github.com/opengovsg/FormSG/commit/fa4b57a6ff8ed0c5f0aced09733115c32bb2a8ce)

#### [v6.18.4](https://github.com/opengovsg/FormSG/compare/v6.18.3...v6.18.4)

> 28 November 2022

- fix: correctly perform logic validation on MyInfo prefilled fields [`#5467`](https://github.com/opengovsg/FormSG/pull/5467)
- fix: trim dropdown option answer in backend and in angularjs frontend [`#5466`](https://github.com/opengovsg/FormSG/pull/5466)
- fix: release v6.18.3 [`#5459`](https://github.com/opengovsg/FormSG/pull/5459)
- chore: bump version to v6.18.4 [`fa4b57a`](https://github.com/opengovsg/FormSG/commit/fa4b57a6ff8ed0c5f0aced09733115c32bb2a8ce)
- chore: bump version to v6.18.4 [`704d7b4`](https://github.com/opengovsg/FormSG/commit/704d7b41a263dc774e39f3633a94594def74efef)

#### [v6.18.3](https://github.com/opengovsg/FormSG/compare/v6.18.2...v6.18.3)

Expand Down
36 changes: 24 additions & 12 deletions frontend/src/features/logic/utils/isConditionFulfilled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,59 +64,71 @@ export const isConditionFulfilled = (
const args = { fieldType, input }
if (!isLogicableField(args)) return false

// TODO #4279: Revisit decision to trim after React rollout is complete
let currentValueTrimmed
const currentValue = getCurrentFieldValue(args.input, args.fieldType)
if (currentValue === '') {
return false
}
if (typeof currentValue === 'string') {
currentValueTrimmed = currentValue.trim()
} else if (typeof currentValue.value === 'string') {
currentValueTrimmed = {
...currentValue,
value: currentValue.value.trim(),
}
} else {
currentValueTrimmed = currentValue
}

switch (conditionTrimmed.state) {
case LogicConditionState.Lte:
return Number(currentValue) <= Number(conditionTrimmed.value)
return Number(currentValueTrimmed) <= Number(conditionTrimmed.value)
case LogicConditionState.Gte:
return Number(currentValue) >= Number(conditionTrimmed.value)
return Number(currentValueTrimmed) >= Number(conditionTrimmed.value)
case LogicConditionState.Either: {
// currentValue must be in a value in condition.value
const condValuesArray = Array.isArray(conditionTrimmed.value)
? conditionTrimmed.value.map(String)
: [String(conditionTrimmed.value)]
if (isRadioFormFieldValue(currentValue, args.fieldType)) {
if (isRadioFormFieldValue(currentValueTrimmed, args.fieldType)) {
if (condValuesArray.includes('Others')) {
// If the condition value is 'Others',
// then the condition must be satisfied if the current value is the special input value AND
// if the othersInput subfield has a value.
const satisfiesOthers =
currentValue.value === RADIO_OTHERS_INPUT_VALUE &&
!!currentValue.othersInput
currentValueTrimmed.value === RADIO_OTHERS_INPUT_VALUE &&
!!currentValueTrimmed.othersInput
if (satisfiesOthers) return true
}
return condValuesArray.includes(String(currentValue.value))
return condValuesArray.includes(String(currentValueTrimmed.value))
}
return condValuesArray.includes(String(currentValue))
return condValuesArray.includes(String(currentValueTrimmed))
}
case LogicConditionState.Equal: {
if (isRadioFormFieldValue(currentValue, args.fieldType)) {
if (isRadioFormFieldValue(currentValueTrimmed, args.fieldType)) {
// It's possible that the condition.value is in a single-valued array.
const condValue = Array.isArray(conditionTrimmed.value)
? conditionTrimmed.value[0]
: conditionTrimmed.value
if (
condValue === 'Others' &&
currentValue.value === RADIO_OTHERS_INPUT_VALUE
currentValueTrimmed.value === RADIO_OTHERS_INPUT_VALUE
) {
// If the condition value is 'Others', then the condition must be
// satisfied if the current value is the special input value.
// Otherwise, we still fall through in case the 'Others' was a custom
// value created by the user.
return true
}
return String(condValue) === String(currentValue.value)
return String(condValue) === String(currentValueTrimmed.value)
}
// In angular, number equality is string=== but decimal equality is number===.
// Need to replicate this behavior for backward-compatibility.
if (fieldType === BasicField.Decimal) {
return Number(currentValue) === Number(conditionTrimmed.value)
return Number(currentValueTrimmed) === Number(conditionTrimmed.value)
}
return String(conditionTrimmed.value) === String(currentValue)
return String(conditionTrimmed.value) === String(currentValueTrimmed)
}
}
}
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "FormSG",
"description": "Form Manager for Government",
"version": "6.36.0",
"version": "6.36.1",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <[email protected]>"
Expand Down