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: release v6.153.0 #7795

Merged
merged 18 commits into from
Oct 21, 2024
Merged

build: release v6.153.0 #7795

merged 18 commits into from
Oct 21, 2024

Conversation

KenLSM
Copy link
Contributor

@KenLSM KenLSM commented Oct 20, 2024

New

  • test(emailpreview): chromatic support #7786
  • fix: update the form field type for v3 test cases #7787
  • feat: email response summary #7781
  • fix: set form fields to use formfielddto type #7783
  • chore: upgrade ts-eslint to v8 #7759
  • build: merge release v6.152.0 to develop #7779
  • chore: manually upgrade webpack #7780
  • feat: no notify for steps after reject step #7771
  • feat: mrf be field validation #7718
  • build: release v6.152.0 #7773

Dependencies

  • fix(deps): bump libphonenumber-js from 1.11.11 to 1.11.12 in /shared #7791

Dev-Dependencies

  • chore(deps-dev): bump @types/jsonwebtoken from 9.0.6 to 9.0.7 #7790
  • chore(deps-dev): bump @typescript-eslint/eslint-plugin from 8.8.1 to 8.10.0 in /shared #7792
  • chore(deps-dev): bump @typescript-eslint/parser from 8.8.1 to 8.10.0 in /shared #7793
  • chore(deps-dev): bump @types/uid-generator from 2.0.3 to 2.0.6 #7784
  • chore(deps-dev): bump prettier from 3.3.2 to 3.3.3 #7785
  • chore(deps-dev): bump ts-jest from 29.1.2 to 29.2.5 #7782
  • chore(deps-dev): bump @types/promise-timeout from 1.3.0 to 1.3.3 #7775

Tests

feat: email response summary #7781

Test workflow completion email:

  • Create an MRF form with a variety of form field types (decimal, short text, email, mobile number, table and attachment). Ensure at least one of the form fields is optional.
  • Set email notification to your email inbox.
  • Set a single workflow step to fill up all the forms.
  • Submit the single step to complete the MRF workflow. Leave the optional field blank.
  • Verify workflow completion email is received with correct fields. The blank optional field should be excluded from the responses summary.

Test workflow approved email:

  • Add a yes/no field and set it to second step in workflow.
  • Submit both steps. Ensure the optional field is now filled.
  • Verify the workflow approved email is received with the correct field values. The optional field should now be included in the email since it is filled.

Test workflow rejected email:

  • Repeat the previous TC, but reject the workflow.
  • Verify the workflow not approved email is received with the correct field values.

feat: no notify for steps after reject step #7771

TC1: Regression test for approve

  • Create MRF workflow with 3 steps
  • Set step 2 and step 3 as approval step
  • Set steps 2 and 3 as notification step
  • Approve form completely.
  • See that steps 2 and 3 email get approve email.

TC2: No notify for steps after reject step

  • From MRF from TC1
  • Reject at step 2
  • Ensure only step 2 gets the reject email (Step 3 does not get an email)

TC3: Regression test for reject

  • From MRF from TC1
  • Reject at step 3
  • Ensure both step 2 and 3 gets the reject email

feat: mrf be field validation #7718

Regression test:

  • Create an MRF form with all types of basic fields, try a combination of different field settings.
  • Create a table with dropdown field and text field col.
  • Fill in with valid values and ensure that we can still submit all fields without validation error.

Setup for next few tests:

  • Set all fields in earlier MRF form to optional to prepare for the next few test cases.
  • Go to web console (inspect -> find the XHR request -> copy as cURL), save this in a text editor to create invalidate submissions

Checkbox field validation - no duplicates with others:

  • Create a option called Others: A
  • Enabled others
  • Submit the form with checkbox response selecting the option Others: A and a custom A value in others
  • Should return a validation failure, which matches Storage/email mode validation.

Table field validation:

  • From the cURL command in setup, add row to table field type value despite addMoreRows disabled, it should reject.
  • From the cURL command in setup, add row to table field type value, enable addMoreRows, it should accept.
  • From the cURL command in setup, add more rows than maxRowsAllowed to table field type value with addMoreRows enabled, it should reject.
  • Make text field required, set the textField value in row to '' empty string, it should reject.
  • Change dropdown to invalid value, it should reject.
  • Set text field and dropdown to not required, send empty string values for both, it should accept.

Short text length enforced:

  • From the cURL command in setup, change the value of 'textfield' to less than the minimum text length set and submit, it should reject.

Children field not allowed in MRF:

  • From the cURL command in setup, change the fieldType of any to children and submit, it should reject.

Decimal field range is enforced:

  • From the cURL command in setup, change the value of decimal fieldType to beyond the valid range and submit, it should reject.

Short text length is enforced:

  • From the cURL command in setup, change the value of short fieldType to beyond the valid range and submit, it should reject.

Valid country/region only:

  • From the cURL command in setup, change the value of country_region fieldType to invalid value and submit, it should reject.

NRIC must be valid:

  • From the cURL command in setup, change the value of nric fieldType to invalid nric value and submit, it should reject.

Invalid field types not allowed:

  • From the cURL command in setup, change the value of fieldType to invalid field type eg, abc and submit, it should reject.

dependabot bot and others added 18 commits October 15, 2024 17:41
Bumps [@types/promise-timeout](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/promise-timeout) from 1.3.0 to 1.3.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/promise-timeout)

---
updated-dependencies:
- dependency-name: "@types/promise-timeout"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore: remove unused verifiable mobile field

* feat: add validation v3 code to middleware

* feat: set up scaffold

* feat: add validation v3 code

* feat: add text validator

* feat: add country, homeno and rating validation

* feat: add uen and nric validators

* feat: add dropdown validator

* feat: add yesno and verifiable field validator

* feat: add attachment validator

* feat: add number and decimal validator

* feat: add children and table validator

* fix: checkbox validation to accomodate for internal val

* fix: remove unused imports

* feat: check if validation is required

* fix: handle diff date and checkbox format

* fix: bug where textfield type in table do not cause rejection

* feat: add v3 specific checks for isResponseForHidden and validation required, handle radio specific validation

* fix: explicitly check for radio response answer properties

* fix: include answer.answer for attachment check

* feat: add TC helper for v3 responses and tc for yesno

* feat: add TC for nric fields

* feat: add date validation

* fix: remove only in tc

* feat: add radio and country validator tc and fix radio button validation logic

* feat: add TC for dropdown validator v3

* feat: add tc for rating validation

* feat: add tc for short and long text validator v3

* feat: add tc for home no validation

* feat: add checkbox validation and fix checkbox v3 validation logic

* feat: fix bug with othersInput and add TC for othersInput being included in min/max count

* feat: add tc for mobileno, fix tc bugs and mobileno validation v3 bugs

* fix: change to relative import

* fix: empty string to 0

* feat: add tc for table validation v3

* chore: add exhaustivechecks on switch

* refactor: share isValidResponseFieldType, doFieldTypesMatch functions

* chore: remove unintended commit of datadogchunk

* feat: add number validation v3

* feat: add tc for attachment validation

* feat: add tc for decimal

* feat: add tc for uen validation v3

* feat: refactor to use switch statement

* feat: add tc for email validation v3

* feat: add validateMrfFieldResponses tc

* feat: fix email default field create

* feat: unblock when v3 validation fails

---------

Co-authored-by: Ken <ken@open.gov.sg>
* feat: no notify for steps after reject step

* fix: TC comments and naming
build: merge release v6.152.0 to develop
* chore: upgrade ts-eslint to v8

* fix: ts error on tests

* chore: remove unused props

* refactor: swap to type-only access

* chore: add explicit ts ignore on intended unused vars

* fix: remove unused expressions, remove unused ts-ignores, add explicit ignores

* fix: update eslint rules
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.1.2 to 29.2.5.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](kulshekhar/ts-jest@v29.1.2...v29.2.5)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: set form fields to use formfielddto type

* fix: remove unused import
Bumps [prettier](https://github.com/prettier/prettier) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.3.2...3.3.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/uid-generator](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uid-generator) from 2.0.3 to 2.0.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uid-generator)

---
updated-dependencies:
- dependency-name: "@types/uid-generator"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat: add email summary responses

* feat: add TC for util function and move to util

* feat: fix padding of email

* feat: port approval status to mrf completion email

* feat: update email styling

* fix: change padding to px instead of rem for gsib

* chore: remove unused import

* feat: change to absolute px to support GSIB

* feat: reduce code duplications

* fix: add missing full stop

* chore: split styles into commons and specific style ts
* fix: update the form field type for v3 test cases

* fix: remove unneeded cast

* fix: remove unused import
* feat: add storybook integration

* build: publish to chromatic

* chore: add email preview to chromatic
…in /shared (#7793)

chore(deps-dev): bump @typescript-eslint/parser in /shared

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.8.1 to 8.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.10.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…7791)

Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.11.11 to 1.11.12.
- [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.11.11...v1.11.12)

---
updated-dependencies:
- dependency-name: libphonenumber-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…8.10.0 in /shared (#7792)

chore(deps-dev): bump @typescript-eslint/eslint-plugin in /shared

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.8.1 to 8.10.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.10.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/jsonwebtoken](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsonwebtoken) from 9.0.6 to 9.0.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsonwebtoken)

---
updated-dependencies:
- dependency-name: "@types/jsonwebtoken"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@datadog-opengovsg
Copy link

Datadog Report

Branch report: release_v6.153.0
Commit report: 07186a9
Test service: formsg

✅ 0 Failed, 1856 Passed, 1 Skipped, 3m 9.38s Total duration (2m 51.15s time saved)

Copy link
Contributor

@kevin9foong kevin9foong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@KenLSM
Copy link
Contributor Author

KenLSM commented Oct 21, 2024

For the curl requests, we're checking through errorCodes instead of outright reject as we're introducing the validation on shadow.

Verified that we're receiving errorCode: 100702

@KenLSM KenLSM merged commit de63ee2 into release-al2 Oct 21, 2024
86 of 88 checks passed
@KenLSM KenLSM deleted the release_v6.153.0 branch October 21, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants