Skip to content

build: release v6.70.0 - #6623

Merged
wanlingt merged 16 commits into
release-al2from
release_v6.70.0
Aug 16, 2023
Merged

build: release v6.70.0#6623
wanlingt merged 16 commits into
release-al2from
release_v6.70.0

Conversation

@wanlingt

@wanlingt wanlingt commented Aug 15, 2023

Copy link
Copy Markdown
Contributor

New

  • fix: supply empty object when snapshot script has not completely migrated #6622
  • feat: payment by products #6301
  • chore: Added react dev inspector #6611
  • feat: filter out API details from user object #6588
  • docs: update feature section of README #6603
  • chore: remove angular deps #6602
  • chore: remove customMin and customMax virtuals #6596
  • build: merge v6.69.0 into develop #6601
  • build: release v6.69.0 #6600
  • chore: bump version to v6.70.0 b7e2760

Dependencies

  • fix(deps): bump libphonenumber-js from 1.10.40 to 1.10.41 in /shared #6616
  • fix(deps): bump libphonenumber-js from 1.10.39 to 1.10.40 in /shared #6614
  • fix(deps): bump type-fest from 4.1.0 to 4.2.0 in /shared #6610
  • fix(deps): bump import-in-the-middle from 1.3.4 to 1.4.2 #6609
  • fix(deps): bump validator from 13.9.0 to 13.11.0 in /shared #6605
  • fix(deps): bump libphonenumber-js from 1.10.38 to 1.10.39 in /shared #6594

Dev-Dependencies

  • chore(deps-dev): bump @types/lodash from 4.14.196 to 4.14.197 in /shared #6612

Tests

fix: supply empty object when snapshot script has not completely migrated #6622

@wanlingt

  • Make a payment
  • Find your payment document in the DB, rename payment.payment_fields_snapshot to something else
  • On the Dedicated Payment Page and observe that the page doesn't crash (product/service will be empty)

feat: payment by products #6301

Regression Tests @wanlingt

Fixed payments form should work as usual
As a form admin with fixed payment form

  • Update to description, name, amount works without error

As responder on fixed payment form

  • Able to make payment without error
  • Check that the proof of payment reflects the correct product and amount.

Variable payments form should work as usual
As a form admin with variable payment form

  • Update to description, name, min, max, amount works without error

As responder on variable payment form

  • Able to set an amount within range without error
  • Able to make payment without error
  • Check that the proof of payment reflects the correct product and amount.

Storage Form filling (due to refactors on encrypt-submissions) @wanlingt

  • Able to submit a storage form with captcha disabled
  • Able to submit a storage form with captcha enabled
  • Unable to submit a storage form that's closed

New Feature Test @LinHuiqing

New Payment by Products form without connected account
As a form admin

  • Select payments by product as payment type
  • Ensure that name, description, add products, and save button are disabled and not interactable

New Payment by Products form with a stripe account
Creating new product

  • Create new payments by product payment form
  • Add a product with name "Nameless", description "Nondescript", amount "300", multiple qty "Off"
  • Check that <PaymentPreview /> has "Nameless", "Nondescript", and price $300.00
    • Checkbox should be rendered as a <Radio />
  • Check that <ProductItem /> has "Nameless", and price $300.00
  • Edit the created product to have a different name, and save
  • Edit the created product to have amount of 123456789, the item should show an error prompting that amount should be below $200,000
  • Set the amount to 100

Note that Product Item is saved on modal saving, instead of saving on payment panel.

  • Submit a payment by products form with 1 qty x 1 product. Check that the proof of payment reflects the correct quantity, item amount and final amount
  • Submit a payment by products form with >1 qty x >1 product. Check that the proof of payment reflects the correct quantity, item amount and final amount

chore: Added react dev inspector #6611

@wanlingt

  • Start FormSG locally and press "Control + Shift + C". Click any component and it should redirect you to the corresponding LOC in vs code.

feat: filter out API details from user object #6588

@KenLSM

  • Update a user with the apiToken property ({keyHash: .., createdAt:.., lastUsedAt:.. }). Check that none of the following queries returns the apiToken property with the user object:
    • GET /api/v3/admin/forms - visit admin form dashboard page
    • POST /api/v3/auth/otp/verify - log out and log in again
    • GET /api/v3/user - visit admin form dashboard page
    • POST /user/contact/otp/verify - verify contact OTP

chore: remove customMin and customMax virtuals #6596

@wanlingt

  • For each combination of (min/max/exact) for (number / short text / long text) field:
    • Create a field with the validation. This should work.
    • Modify the validation options. This should work.
    • Attempt to submit a form with a response not satisfying the validation option. This should trigger an error on the frontend.
    • Attempt to submit a form with a response satisfying the validation option. This should work.

chore: bump version to v6.70.0 b7e2760

Deploy Notes

New scripts:

  • set-payment-fields-snapshot.js : This script adds the payment_fields_snapshot field to the payments collection and sets the field as the form document's payment_field for all existing documents.

New dependencies:

  • dependency : React Dev Inspector

New dev dependencies:

  • dependency : React Dev Inspector

dependabot Bot and others added 16 commits August 7, 2023 06:22
…6594)

Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.10.38 to 1.10.39.
- [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.10.38...v1.10.39)

---
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>
build: merge v6.69.0 into develop
Removed from number field and text field schemas
Bumps [validator](https://github.com/validatorjs/validator.js) from 13.9.0 to 13.11.0.
- [Release notes](https://github.com/validatorjs/validator.js/releases)
- [Changelog](https://github.com/validatorjs/validator.js/blob/master/CHANGELOG.md)
- [Commits](validatorjs/validator.js@13.9.0...13.11.0)

---
updated-dependencies:
- dependency-name: validator
  dependency-type: direct:production
  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>
* docs: update feature section of README

* docs: remove E2E wording for encryption
Bumps [import-in-the-middle](https://github.com/DataDog/import-in-the-middle) from 1.3.4 to 1.4.2.
- [Release notes](https://github.com/DataDog/import-in-the-middle/releases)
- [Commits](nodejs/import-in-the-middle@v1.3.4...v1.4.2)

---
updated-dependencies:
- dependency-name: import-in-the-middle
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [type-fest](https://github.com/sindresorhus/type-fest) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/sindresorhus/type-fest/releases)
- [Commits](sindresorhus/type-fest@v4.1.0...v4.2.0)

---
updated-dependencies:
- dependency-name: type-fest
  dependency-type: direct:production
  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>
…red (#6612)

Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.196 to 4.14.197.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  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: restrict user fields to email and agency

* feat: remove apiToken property from populated user

* test: return correct admin properties in tests

* feat: remove apiToken from user queries

* feat: filter out apiToken in user model

* test: revert changes made to tests

* fix: remove line breaks

* fix: refine mongoose setup

* test: add check for apiToken property
* added react dev inspector

* moved react dev inspector to dev dependency

* changed command to trigger inspector
…6614)

Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.10.39 to 1.10.40.
- [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.10.39...v1.10.40)

---
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>
…6616)

Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.10.40 to 1.10.41.
- [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.10.40...v1.10.41)

---
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>
* wip

* refactor: move admin payments components to PaymentPanel folder

* add AddProductModal and basic item creation flow

* add BE payments product

* wip

* refactor admin payment products input

* fix version not passed to BE

* add _id to be exposed in product model, refactor product types

* wip add responder payment

* feat: add price calculation

* add clear variant for SingleSelect

* add ProductItem Quantity display

* add full width variant for checkbox

* refactor typing, add submit action to pass payment products

* add missing field id constant

* add registering of payment products into form context

* refactor: extract stripe events fn to stripe.events.controller

* refactor: break submission controller into its payment/non-payment creation handlers

* refactor: extract checks into ensure pipelines

* fix: remove duplicate PaymentItemDetailBlock

* fix: next() to be awaited

* refactor: extract price calculation to shared, rename ensuresIsX to ensureX

* fix: hide payment items block for v2, update preview to render using version specific

* refactor: submitEncryptModeForm

* refactor: FieldListDrawer with mapped header+component

* feat: add edit product

* feat: changed ProductModal min/max qty input to hide when multiqty is disabled

* fix: clicking PaymentPreview should redirect to their respective version of payment tab

* fix: paymentpreview to update with latest products when paymentstore changes

* feat: add product deletion flow for admin

* fix: Payment v2 description, refactor PaymetnItemDetailsBlock

* refactor: cleanup #1

* fix: edit mode multi_qty to reference incoming value, fix qty range generation

* fix: merge conflicts, to render-able state

* fix: be to compile-able state

* chore: revert unintended changes

* wip

* fix: remove unnecessary payment checks in handle update payment product

* fix(fe): adding products triggering local data replacement

* feat: support non-multi selection

* fix: quantity selection does not auto select item

* chore: remove unused comments

* feat: add full width variant on radio component

* chore: camelcase checkbox component theme

* feat: store purchased products into payment doc

* chore: remove unused imports

* fix: payment product quantity converted to boolean instead of number

* fix: test cases failing due to incorrect object comparison

* fix: duplicated code from incorrect merge
 resolution

* chore: update payment page width to match design

* feat: expose products to Payment Page

* refactor: payment UI

* feat: split payments summaries for fixed, variable, and products

* feat: add full payment summary for products

* fix: typing issues

* feat: itemized invoice for payment by products (#6574)

* fix: test cases failing due to incorrect object comparison

* fix: add products button not disabled when panel is disabled

* fix: products payment not showing title on paymentpreview

* feat: add product qty validation

* fix: remove stray test capture group

* feat: show error message if no products are selected (#6585)

* feat: add error message if no product is selected

* fix: change copy

* feat: set default quantity as min qty

* feat: use isProductSelected function to check if at least 1 product is selected

* fix: use Array.prototype.some()

* feat: hide fixed payment type if form is not a fixed payment

* fix: addproduct modal not displaying errors

* chore: send log all payments info instead of only products

* chore: remove unused files

* fix: add product not validating if max qty-payment amount exceed global limits

* chore: use divider instead of hr

* chore: add strong joi validator

* chore: update copy for payment qty-payment amount exceed

* refactor: change function into class to better express side-effects

* refactor: rename productitemschema to productschema

* feat: add joi validation for handleupdatepaymentsproduct

* chore: fix typo, remove unused comments nits

* feat: add payment summary to thank you page (#6591)

* feat: add CompletedPaymentSummary

* feat: add payment_fields_snapshot to payment model

* feat: show products and other payment metadata in thank you page

* feat: db migration script for payment_fields_snapshot

* fix: rename ProductItemSchema to ProductSchema

* fix: use form payment_fields as source of truth in payments model

* ref: refactor getProductNames

* ref: remove unused code

* test: update FormPaymentPage.stories

* refactor: paymentproducts to share same joi validator, add validator to encrypt-submission

* chore: copy changes, tweak order of payment type dropdown, fix padding when payment is not connected

* chore: remove title for payments by product type

* feat: add payment preview placeholder when admin has no items

* chore: products description to be optional, ui changes on payment preview product item

* feat: auto detect disabling multi product toggle

* chore: update copy for payment summary

* fix: unstuck divider with productitem on paymentpreview

* chore: product modal to calculate qty, ui updates

* fix: update text colors

* fix: expand button to full width for mobile

* fix: adjust spacing before recaptcha container

* fix: new payment form not defaulting to products

* fix: product payment type should not require name field validated

* fix: remove mention of gst on product modal if form is not gst enabled

* fix: update test cases to reflect new defaults

* fix: payment date race condition (#6619)

fix: move payment date to be returned together when receipt url exists

---------

Co-authored-by: wanlingt <56983748+wanlingt@users.noreply.github.com>
Co-authored-by: wanlingt <wanling@open.gov.sg>
@wanlingt
wanlingt temporarily deployed to staging August 15, 2023 08:02 — with GitHub Actions Inactive
@LinHuiqing

LinHuiqing commented Aug 15, 2023

Copy link
Copy Markdown
Contributor

For #6301:

Ensure that name, description, add products, and save button are disabled and not interactable

If I were to add products prior to disconnecting the stripe account, the products are still there and I can click the buttons as usual. Just that I can't save properly as an error message it thrown by the backend.

@KenLSM

KenLSM commented Aug 15, 2023

Copy link
Copy Markdown
Contributor

For #6301:

Ensure that name, description, add products, and save button are disabled and not interactable

If I were to add products prior to disconnecting the stripe account, the products are still there and I can click the buttons as usual. Just that I can't save properly as an error message it thrown by the backend.

:'(, I'll handle that in another ticket.

I suppose it is not blocking.

@LinHuiqing

Copy link
Copy Markdown
Contributor

Regarding the same PR #6301 on payments by product, spotted another bug where admins will not be able to save payment amounts between $2020.20 and $200,000. This has been decided to be non-blocking and will be fixed in the next release (tracked with this ticket).

@wanlingt
wanlingt merged commit 479d6f6 into release-al2 Aug 16, 2023
@wanlingt
wanlingt deleted the release_v6.70.0 branch August 16, 2023 00:55
@wanlingt wanlingt mentioned this pull request Aug 17, 2023
50 tasks
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.

6 participants