diff --git a/CHANGELOG.md b/CHANGELOG.md index 686e718090..12bd6efb60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,27 @@ 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.69.0](https://github.com/opengovsg/FormSG/compare/v6.68.0...v6.69.0) + +- fix: updated payment view to follow colour theme [`#6598`](https://github.com/opengovsg/FormSG/pull/6598) +- feat: toggle issue notification [`#6590`](https://github.com/opengovsg/FormSG/pull/6590) +- feat: BE endpoint to allow storage submissions before encryption [`#6587`](https://github.com/opengovsg/FormSG/pull/6587) +- chore(deps-dev): bump eslint-config-prettier from 8.9.0 to 8.10.0 in /shared [`#6593`](https://github.com/opengovsg/FormSG/pull/6593) +- chore: remove unused toastr dependency for snyk [`#6589`](https://github.com/opengovsg/FormSG/pull/6589) +- feat: add Country/Region field [`#5132`](https://github.com/opengovsg/FormSG/pull/5132) +- feat: payments UI/UX clean up [`#6581`](https://github.com/opengovsg/FormSG/pull/6581) +- feat: remove divider in payments input panel [`#6586`](https://github.com/opengovsg/FormSG/pull/6586) +- fix(deps): bump type-fest from 3.13.0 to 4.1.0 in /shared [`#6579`](https://github.com/opengovsg/FormSG/pull/6579) +- fix(deps): bump libphonenumber-js from 1.10.37 to 1.10.38 in /shared [`#6580`](https://github.com/opengovsg/FormSG/pull/6580) +- ref: remove download receipt URL [`#6577`](https://github.com/opengovsg/FormSG/pull/6577) +- chore(deps-dev): bump eslint-config-prettier from 8.8.0 to 8.9.0 in /shared [`#6576`](https://github.com/opengovsg/FormSG/pull/6576) +- build: merge v6.68.0 into develop [`#6572`](https://github.com/opengovsg/FormSG/pull/6572) +- build: release v6.68.0 [`#6571`](https://github.com/opengovsg/FormSG/pull/6571) + #### [v6.68.0](https://github.com/opengovsg/FormSG/compare/v6.67.1...v6.68.0) +> 27 July 2023 + - chore(deps-dev): bump @types/lodash from 4.14.195 to 4.14.196 in /shared [`#6570`](https://github.com/opengovsg/FormSG/pull/6570) - feat: rm bot protection for GSIB users [`#6568`](https://github.com/opengovsg/FormSG/pull/6568) - chore: lint and update commands in README [`#6567`](https://github.com/opengovsg/FormSG/pull/6567) @@ -17,6 +36,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: merge v6.67.1 into develop [`#6559`](https://github.com/opengovsg/FormSG/pull/6559) - build: release v6.67.1 [`#6557`](https://github.com/opengovsg/FormSG/pull/6557) - fix: github warning about unused import [`#6558`](https://github.com/opengovsg/FormSG/pull/6558) +- chore: bump version to v6.68.0 [`c69b1ce`](https://github.com/opengovsg/FormSG/commit/c69b1ce2a1313e0e49d1b94636af2815dc26e2c3) #### [v6.67.1](https://github.com/opengovsg/FormSG/compare/v6.67.0...v6.67.1) @@ -26,7 +46,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: release v6.67.0 [`#6555`](https://github.com/opengovsg/FormSG/pull/6555) - chore: bump version to 6.67.1 [`b641094`](https://github.com/opengovsg/FormSG/commit/b641094d40a67a888e3a8ac967a43f9d1732bd49) -#### [v6.67.0](https://github.com/opengovsg/FormSG/compare/v6.66.0...v6.67.0) +#### [v6.67.0](https://github.com/opengovsg/FormSG/compare/v6.66.1...v6.67.0) > 20 July 2023 @@ -36,16 +56,23 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: release v6.66.0 [`#6550`](https://github.com/opengovsg/FormSG/pull/6550) - feat: MyInfo Children compound fields beta [`#6523`](https://github.com/opengovsg/FormSG/pull/6523) - ci: adjust timeouts for playwright pipe [`#6551`](https://github.com/opengovsg/FormSG/pull/6551) +- fix: use proof-of-payment for payment receipt/invoice [`#6549`](https://github.com/opengovsg/FormSG/pull/6549) +- build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /frontend [`#6548`](https://github.com/opengovsg/FormSG/pull/6548) +- fix(deps): bump word-wrap from 1.2.3 to 1.2.4 [`#6547`](https://github.com/opengovsg/FormSG/pull/6547) +- build(deps): bump winston-cloudwatch to v6.2.0 [`#6545`](https://github.com/opengovsg/FormSG/pull/6545) +- chore: bump version to v6.66.0 [`0233ba8`](https://github.com/opengovsg/FormSG/commit/0233ba8018532d4978d13717fac065f81e2eb515) - chore: bump version to v6.67.0 [`6ca03c6`](https://github.com/opengovsg/FormSG/commit/6ca03c68cb162a4ae3af01f172425b3305742ae0) +#### [v6.66.1](https://github.com/opengovsg/FormSG/compare/v6.66.0...v6.66.1) + +> 18 July 2023 + +- revert: build(deps): bump winston-cloudwatch version to 6.2.0 [`#6542`](https://github.com/opengovsg/FormSG/pull/6542) + #### [v6.66.0](https://github.com/opengovsg/FormSG/compare/v6.65.0...v6.66.0) -> 19 July 2023 +> 18 July 2023 -- fix: use proof-of-payment for payment receipt/invoice [`#6549`](https://github.com/opengovsg/FormSG/pull/6549) -- build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /frontend [`#6548`](https://github.com/opengovsg/FormSG/pull/6548) -- fix(deps): bump word-wrap from 1.2.3 to 1.2.4 [`#6547`](https://github.com/opengovsg/FormSG/pull/6547) -- build(deps): bump winston-cloudwatch to v6.2.0 [`#6545`](https://github.com/opengovsg/FormSG/pull/6545) - fix(deps): [Snyk] Security upgrade mongoose from 5.13.15 to 5.13.20 [`#6541`](https://github.com/opengovsg/FormSG/pull/6541) - feat: indicate if GST has been applied to a payment transaction [`#6538`](https://github.com/opengovsg/FormSG/pull/6538) - chore: reduce max payment limit [`#6543`](https://github.com/opengovsg/FormSG/pull/6543) @@ -57,7 +84,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: merge v6.65.0 into develop [`#6531`](https://github.com/opengovsg/FormSG/pull/6531) - build: release v6.65.0 [`#6528`](https://github.com/opengovsg/FormSG/pull/6528) - fix: add FE validation rule that email domains must be non empty [`#6529`](https://github.com/opengovsg/FormSG/pull/6529) -- chore: bump version to v6.66.0 [`0233ba8`](https://github.com/opengovsg/FormSG/commit/0233ba8018532d4978d13717fac065f81e2eb515) +- chore: bump version to v6.66.0 [`b3a9818`](https://github.com/opengovsg/FormSG/commit/b3a9818762e334bc7126c029cdba63156bac85ed) #### [v6.65.0](https://github.com/opengovsg/FormSG/compare/v6.64.0...v6.65.0) @@ -109,13 +136,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.60.0 to 5.60.1 in /shared [`#6487`](https://github.com/opengovsg/FormSG/pull/6487) - chore(deps-dev): bump @typescript-eslint/parser from 5.60.0 to 5.60.1 in /shared [`#6488`](https://github.com/opengovsg/FormSG/pull/6488) - build: release v6.62.0 [`#6484`](https://github.com/opengovsg/FormSG/pull/6484) +- fix: admin feedback capturing wrong local storage value [`#6485`](https://github.com/opengovsg/FormSG/pull/6485) +- chore: bump version to v6.62.0 [`b5ab2e0`](https://github.com/opengovsg/FormSG/commit/b5ab2e0d1615a5e9b0ed1829adcaf040ef700adc) - chore: bump version to v6.63.0 [`b474dc7`](https://github.com/opengovsg/FormSG/commit/b474dc76f426ddbb101ba73c50f16e507b51a437) #### [v6.62.0](https://github.com/opengovsg/FormSG/compare/v6.61.1...v6.62.0) > 26 June 2023 -- fix: admin feedback capturing wrong local storage value [`#6485`](https://github.com/opengovsg/FormSG/pull/6485) - fix: escape form title in payment invoice's html content [`#6482`](https://github.com/opengovsg/FormSG/pull/6482) - feat: admin feedback modal [`#6465`](https://github.com/opengovsg/FormSG/pull/6465) - fix: potential html script injection [`#6481`](https://github.com/opengovsg/FormSG/pull/6481) @@ -124,7 +152,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore: update issue feedback mail html [`#6478`](https://github.com/opengovsg/FormSG/pull/6478) - build: merge v6.61.0 into develop [`#6477`](https://github.com/opengovsg/FormSG/pull/6477) - fix: account for undefined response code when tracking webhook dd stats [`#6475`](https://github.com/opengovsg/FormSG/pull/6475) -- chore: bump version to v6.62.0 [`b5ab2e0`](https://github.com/opengovsg/FormSG/commit/b5ab2e0d1615a5e9b0ed1829adcaf040ef700adc) +- chore: bump version to v6.62.0 [`bafd12a`](https://github.com/opengovsg/FormSG/commit/bafd12a2bc228b606a24c0b65cd284a25d5f7521) #### [v6.61.1](https://github.com/opengovsg/FormSG/compare/v6.61.0...v6.61.1) @@ -410,22 +438,23 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: only return previous payment id [`#6210`](https://github.com/opengovsg/FormSG/pull/6210) - build: merge release v6.45.0 to develop [`#6205`](https://github.com/opengovsg/FormSG/pull/6205) - build: release v6.45.0 [`#6200`](https://github.com/opengovsg/FormSG/pull/6200) +- chore: update payment guide in payment unsupported msg [`#6199`](https://github.com/opengovsg/FormSG/pull/6199) +- fix(deps): bump type-fest from 3.8.0 to 3.9.0 in /shared [`#6195`](https://github.com/opengovsg/FormSG/pull/6195) +- chore: bump version to v6.45.0 [`336f4c8`](https://github.com/opengovsg/FormSG/commit/336f4c8ad072d3b582a646e21010eac4b5119ee7) - chore: bump version to v6.46.0 [`87fda0e`](https://github.com/opengovsg/FormSG/commit/87fda0e0ec4c937350ebd013a4a9762f4acee802) +- docs: fix CHANGELOG.md to have only 1 section for v6.45.0 [`4fe9d00`](https://github.com/opengovsg/FormSG/commit/4fe9d00234bed21f0943e26cc9d7c2db96afcdd3) #### [v6.45.0](https://github.com/opengovsg/FormSG/compare/v6.44.1...v6.45.0) > 26 April 2023 -- chore: update payment guide in payment unsupported msg [`#6199`](https://github.com/opengovsg/FormSG/pull/6199) -- fix(deps): bump type-fest from 3.8.0 to 3.9.0 in /shared [`#6195`](https://github.com/opengovsg/FormSG/pull/6195) - chore: update previous payment typing and hooks [`#6191`](https://github.com/opengovsg/FormSG/pull/6191) - chore: add missed out changelog for 6.44.1 [`#6197`](https://github.com/opengovsg/FormSG/pull/6197) - build: merge release v6.44.1 to develop [`#6196`](https://github.com/opengovsg/FormSG/pull/6196) - build: release v6.44.1 [`#6193`](https://github.com/opengovsg/FormSG/pull/6193) - perf: memoize field row containers [`#6189`](https://github.com/opengovsg/FormSG/pull/6189) - build: merge release v6.44.0 to develop [`#6187`](https://github.com/opengovsg/FormSG/pull/6187) -- chore: bump version to v6.45.0 [`336f4c8`](https://github.com/opengovsg/FormSG/commit/336f4c8ad072d3b582a646e21010eac4b5119ee7) -- docs: fix CHANGELOG.md to have only 1 section for v6.45.0 [`4fe9d00`](https://github.com/opengovsg/FormSG/commit/4fe9d00234bed21f0943e26cc9d7c2db96afcdd3) +- chore: bump version to v6.45.0 [`df24b16`](https://github.com/opengovsg/FormSG/commit/df24b16f04ba595a53062a309deaf90225b3a2ad) #### [v6.44.1](https://github.com/opengovsg/FormSG/compare/v6.44.0...v6.44.1) @@ -531,7 +560,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump type-fest from 3.7.2 to 3.8.0 in /shared [`#6064`](https://github.com/opengovsg/FormSG/pull/6064) - build: merge release v6.40.0 into develop [`#6072`](https://github.com/opengovsg/FormSG/pull/6072) - build: release v6.40.0 [`#6071`](https://github.com/opengovsg/FormSG/pull/6071) +- build: release v6.39.0 [`#6068`](https://github.com/opengovsg/FormSG/pull/6068) - chore: bump version to v6.41.0 [`5055b51`](https://github.com/opengovsg/FormSG/commit/5055b51c5505aab5e8f2a00907e2ee2a9f793e88) +- chore: bump version to v6.39.0 [`081515a`](https://github.com/opengovsg/FormSG/commit/081515a2521c950dac7261f4b6c1b1b423c3af16) #### [v6.40.0](https://github.com/opengovsg/FormSG/compare/v6.39.0...v6.40.0) @@ -539,7 +570,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: merge release v6.39.0 into develop [`#6070`](https://github.com/opengovsg/FormSG/pull/6070) - fix(AttachmentField): correctly clear attachment on upload error [`#6069`](https://github.com/opengovsg/FormSG/pull/6069) -- build: release v6.39.0 [`#6068`](https://github.com/opengovsg/FormSG/pull/6068) - chore: bump version to v6.40.0 [`d4441e2`](https://github.com/opengovsg/FormSG/commit/d4441e276a30b373d64dcc7838f1798049ccf105) #### [v6.39.0](https://github.com/opengovsg/FormSG/compare/v6.38.0...v6.39.0) @@ -557,13 +587,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix: add staging-alt2 to deployment script [`#6019`](https://github.com/opengovsg/FormSG/pull/6019) - build: merge release 6.38.0 to develop [`#6017`](https://github.com/opengovsg/FormSG/pull/6017) - build: release v6.38.0 [`#6004`](https://github.com/opengovsg/FormSG/pull/6004) +- feat: more logging on fetch fallback [`#6008`](https://github.com/opengovsg/FormSG/pull/6008) - chore: bump version to v6.39.0 [`081515a`](https://github.com/opengovsg/FormSG/commit/081515a2521c950dac7261f4b6c1b1b423c3af16) #### [v6.38.0](https://github.com/opengovsg/FormSG/compare/v6.37.0...v6.38.0) -> 30 March 2023 +> 29 March 2023 -- feat: more logging on fetch fallback [`#6008`](https://github.com/opengovsg/FormSG/pull/6008) - feat: implement fetch API fallback for network error [`#5948`](https://github.com/opengovsg/FormSG/pull/5948) - fix: lowercase collaborator endpoint emails [`#5992`](https://github.com/opengovsg/FormSG/pull/5992) - chore(deps-dev): bump @typescript-eslint/parser from 5.56.0 to 5.57.0 in /shared [`#5995`](https://github.com/opengovsg/FormSG/pull/5995) @@ -572,6 +602,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump type-fest from 3.7.0 to 3.7.1 in /shared [`#5991`](https://github.com/opengovsg/FormSG/pull/5991) - build: merge v6.37.0 into develop [`#5989`](https://github.com/opengovsg/FormSG/pull/5989) - build: release v6.37.0 [`#5988`](https://github.com/opengovsg/FormSG/pull/5988) +- chore: bump version to v6.38.0 [`d199213`](https://github.com/opengovsg/FormSG/commit/d19921314cae6b79920cf5ec3fb4f396794816d6) #### [v6.37.0](https://github.com/opengovsg/FormSG/compare/v6.36.0...v6.37.0) @@ -606,6 +637,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: release v6.36.0 [`#5913`](https://github.com/opengovsg/FormSG/pull/5913) - chore: bump version to v6.37.0 [`b4d24eb`](https://github.com/opengovsg/FormSG/commit/b4d24eb14f8a80bff56d19e6fa23975d5661cce9) - chore: bump version to 6.36.1 [`faf75b5`](https://github.com/opengovsg/FormSG/commit/faf75b5a7d0d12745e9a0104c541fb66cca17258) +- chore: bump version to v6.36.0 [`d8d2b59`](https://github.com/opengovsg/FormSG/commit/d8d2b59db62d195916a8fcc3d84659dd20687de4) #### [v6.36.0](https://github.com/opengovsg/FormSG/compare/v6.35.0...v6.36.0) @@ -621,7 +653,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 [`d8d2b59`](https://github.com/opengovsg/FormSG/commit/d8d2b59db62d195916a8fcc3d84659dd20687de4) +- chore: bump version to v6.36.0 [`a51adf1`](https://github.com/opengovsg/FormSG/commit/a51adf1a129ff473e62f38b6836e5282afc5b83f) #### [v6.35.0](https://github.com/opengovsg/FormSG/compare/v6.34.0...v6.35.0) @@ -646,13 +678,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore: revert "feat: merge payment-mvp branch into develop" [`#5858`](https://github.com/opengovsg/FormSG/pull/5858) - build: merge release v6.33.0 into develop [`#5859`](https://github.com/opengovsg/FormSG/pull/5859) - build: release v6.33.0 [`#5853`](https://github.com/opengovsg/FormSG/pull/5853) +- feat: merge payment-mvp branch into develop [`#5851`](https://github.com/opengovsg/FormSG/pull/5851) +- chore: bump version to v6.33.0 [`6508dc0`](https://github.com/opengovsg/FormSG/commit/6508dc09bb519392afbc426c6b68257c4e83515d) - chore: bump version to v6.34.0 [`4624819`](https://github.com/opengovsg/FormSG/commit/46248191e9b5f69e7400ee9b03dd1decdae43e96) #### [v6.33.0](https://github.com/opengovsg/FormSG/compare/v6.32.0...v6.33.0) > 28 February 2023 -- feat: merge payment-mvp branch into develop [`#5851`](https://github.com/opengovsg/FormSG/pull/5851) - chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.52.0 to 5.54.0 in /shared [`#5847`](https://github.com/opengovsg/FormSG/pull/5847) - chore(deps-dev): bump @typescript-eslint/parser from 5.53.0 to 5.54.0 in /shared [`#5846`](https://github.com/opengovsg/FormSG/pull/5846) - fix(deps): bump libphonenumber-js from 1.10.20 to 1.10.21 in /shared [`#5841`](https://github.com/opengovsg/FormSG/pull/5841) @@ -661,7 +694,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: merge release v6.32.0 into develop [`#5833`](https://github.com/opengovsg/FormSG/pull/5833) - [Snyk] Security upgrade @aws-sdk/client-cloudwatch-logs from 3.241.0 to 3.276.0 [`#5835`](https://github.com/opengovsg/FormSG/pull/5835) - build: release v6.32.0 [`#5832`](https://github.com/opengovsg/FormSG/pull/5832) -- chore: bump version to v6.33.0 [`6508dc0`](https://github.com/opengovsg/FormSG/commit/6508dc09bb519392afbc426c6b68257c4e83515d) +- chore: bump version to v6.33.0 [`2e09f10`](https://github.com/opengovsg/FormSG/commit/2e09f1081a6c9f605f3e9ed179330b9b1b162d5e) #### [v6.32.0](https://github.com/opengovsg/FormSG/compare/v6.31.0...v6.32.0) @@ -785,13 +818,14 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump libphonenumber-js from 1.10.15 to 1.10.17 in /shared [`#5690`](https://github.com/opengovsg/FormSG/pull/5690) - fix(deps): bump type-fest from 3.5.0 to 3.5.1 in /shared [`#5687`](https://github.com/opengovsg/FormSG/pull/5687) - build: release v6.27.0 [`#5684`](https://github.com/opengovsg/FormSG/pull/5684) +- fix: add submission time to end page, returned from server [`#5672`](https://github.com/opengovsg/FormSG/pull/5672) +- chore: bump version to v6.27.0 [`86b31d4`](https://github.com/opengovsg/FormSG/commit/86b31d4bd6959171842112bd7d8227841cbcda66) - chore: bump version to v6.28.0 [`f982046`](https://github.com/opengovsg/FormSG/commit/f982046d76bfb3b2d8ceec36daaf23dde3ac165b) #### [v6.27.0](https://github.com/opengovsg/FormSG/compare/v6.26.0...v6.27.0) > 4 January 2023 -- fix: add submission time to end page, returned from server [`#5672`](https://github.com/opengovsg/FormSG/pull/5672) - chore: log formAuthType when redirecting user to sp/cp/myinfo/sgid [`#5682`](https://github.com/opengovsg/FormSG/pull/5682) - chore(deps-dev): bump @typescript-eslint/parser from 5.47.1 to 5.48.0 in /shared [`#5680`](https://github.com/opengovsg/FormSG/pull/5680) - chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.47.1 to 5.48.0 in /shared [`#5679`](https://github.com/opengovsg/FormSG/pull/5679) @@ -803,7 +837,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: backport v6.26.0 into develop [`#5669`](https://github.com/opengovsg/FormSG/pull/5669) - fix(deps): bump zod from 3.19.1 to 3.20.2 [`#5668`](https://github.com/opengovsg/FormSG/pull/5668) - build: release v6.26.0 [`#5666`](https://github.com/opengovsg/FormSG/pull/5666) -- chore: bump version to v6.27.0 [`86b31d4`](https://github.com/opengovsg/FormSG/commit/86b31d4bd6959171842112bd7d8227841cbcda66) +- chore: bump version to v6.27.0 [`3e2a28b`](https://github.com/opengovsg/FormSG/commit/3e2a28b6394b78e02eca138cfe781337cdee10b1) #### [v6.26.0](https://github.com/opengovsg/FormSG/compare/v6.25.0...v6.26.0) @@ -837,6 +871,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: merge release v6.25.0 into develop [`#5632`](https://github.com/opengovsg/FormSG/pull/5632) - build: release v6.25.0 [`#5630`](https://github.com/opengovsg/FormSG/pull/5630) - chore: bump version to v6.26.0 [`8a0b8e2`](https://github.com/opengovsg/FormSG/commit/8a0b8e2df75af8d9f59df5feee03f50211c4339d) +- chore: bump version to v6.25.0 [`8da99f6`](https://github.com/opengovsg/FormSG/commit/8da99f68dbb1ccbebda72ad95729aaf97e93a321) #### [v6.25.0](https://github.com/opengovsg/FormSG/compare/v6.24.1...v6.25.0) @@ -851,20 +886,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: merge release 6.24.1 into develop [`#5622`](https://github.com/opengovsg/FormSG/pull/5622) - build: Release v6.24.1 hotfix [`#5621`](https://github.com/opengovsg/FormSG/pull/5621) - build: merge release 6.24.0 into develop [`#5619`](https://github.com/opengovsg/FormSG/pull/5619) -- chore: bump version to v6.25.0 [`8da99f6`](https://github.com/opengovsg/FormSG/commit/8da99f68dbb1ccbebda72ad95729aaf97e93a321) +- chore: bump version to v6.25.0 [`6080687`](https://github.com/opengovsg/FormSG/commit/6080687d7d8ee7ce343ac6602ae2853ffde20e62) #### [v6.24.1](https://github.com/opengovsg/FormSG/compare/v6.24.0...v6.24.1) > 23 December 2022 - build: release v6.24.0 [`#5615`](https://github.com/opengovsg/FormSG/pull/5615) -- Revert "fix(deps): bump sqs-producer from 2.1.0 to 3.1.0 (#5590)" [`df3e488`](https://github.com/opengovsg/FormSG/commit/df3e488591c29d63c7c4853fe77b10ffb6f724b7) -- chore: bump version to v6.24.1 [`e2fd68c`](https://github.com/opengovsg/FormSG/commit/e2fd68cd0ca6ae62318ea33ffd03afdbe1594bd1) - -#### [v6.24.0](https://github.com/opengovsg/FormSG/compare/v6.23.3...v6.24.0) - -> 23 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) - ci: separate e2e and backend ci flows [`#5483`](https://github.com/opengovsg/FormSG/pull/5483) @@ -874,11 +902,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump @sentry/browser from 7.21.1 to 7.28.0 [`#5607`](https://github.com/opengovsg/FormSG/pull/5607) - build: merge release 6.23.2 back to develop [`#5606`](https://github.com/opengovsg/FormSG/pull/5606) - chore(deps-dev): bump regenerator from 0.14.9 to 0.14.10 [`#5608`](https://github.com/opengovsg/FormSG/pull/5608) +- build: Release v6.23.2 hotfix [`#5602`](https://github.com/opengovsg/FormSG/pull/5602) - test: fix race condition in field schema test [`#5604`](https://github.com/opengovsg/FormSG/pull/5604) - fix: avoid using merge to set query after reordering fields [`#5605`](https://github.com/opengovsg/FormSG/pull/5605) - chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.46.1 to 5.47.0 in /shared [`#5592`](https://github.com/opengovsg/FormSG/pull/5592) - fix(deps): bump sqs-producer from 2.1.0 to 3.1.0 [`#5590`](https://github.com/opengovsg/FormSG/pull/5590) - feat: push static assets to s3 [`#5595`](https://github.com/opengovsg/FormSG/pull/5595) +- fix: return 404 for unmatched static assets [`#5579`](https://github.com/opengovsg/FormSG/pull/5579) +- test: fix selectors for tests [`#5597`](https://github.com/opengovsg/FormSG/pull/5597) +- feat: push static assets to s3 [`#5595`](https://github.com/opengovsg/FormSG/pull/5595) - fix(deps): bump @aws-sdk/client-cloudwatch-logs from 3.218.0 to 3.234.0 [`#5599`](https://github.com/opengovsg/FormSG/pull/5599) - fix: return 404 for unmatched static assets [`#5579`](https://github.com/opengovsg/FormSG/pull/5579) - chore: merge v6.23.1 to develop [`#5594`](https://github.com/opengovsg/FormSG/pull/5594) @@ -889,14 +921,23 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(deps): bump libphonenumber-js from 1.10.14 to 1.10.15 [`#5553`](https://github.com/opengovsg/FormSG/pull/5553) - fix(deps): bump moment-timezone from 0.5.39 to 0.5.40 [`#5586`](https://github.com/opengovsg/FormSG/pull/5586) - chore(deps-dev): bump @playwright/test from 1.27.1 to 1.29.0 [`#5585`](https://github.com/opengovsg/FormSG/pull/5585) +- * fix: trim email input in frontend and backend [`#5581`](https://github.com/opengovsg/FormSG/pull/5581) +- fix(deps): bump formsg-javascript-sdk from 0.9.0 to 0.10.0 [`#5578`](https://github.com/opengovsg/FormSG/pull/5578) - fix(deps): bump zod from 3.19.1 to 3.20.2 in /shared [`#5562`](https://github.com/opengovsg/FormSG/pull/5562) - fix(deps): bump type-fest from 3.3.0 to 3.4.0 in /shared [`#5563`](https://github.com/opengovsg/FormSG/pull/5563) - fix(deps): bump formsg-javascript-sdk from 0.9.0 to 0.10.0 [`#5578`](https://github.com/opengovsg/FormSG/pull/5578) - fix: remove unecessary import [`#5576`](https://github.com/opengovsg/FormSG/pull/5576) +- Revert "fix(deps): bump sqs-producer from 2.1.0 to 3.1.0 (#5590)" [`df3e488`](https://github.com/opengovsg/FormSG/commit/df3e488591c29d63c7c4853fe77b10ffb6f724b7) +- chore: bump version to 6.23.2 [`1256707`](https://github.com/opengovsg/FormSG/commit/1256707db95a30486c2ccfc731d9ff6cbdb7dc40) +- chore: bump version to v6.24.0 [`13fa4f6`](https://github.com/opengovsg/FormSG/commit/13fa4f6eb7854ef91e632d8e316d180e57bb759b) + +#### [v6.24.0](https://github.com/opengovsg/FormSG/compare/v6.23.3...v6.24.0) + +> 16 December 2022 + - feat: upgrade axios to 1.2.1 [`#5568`](https://github.com/opengovsg/FormSG/pull/5568) - chore: merge v6.23.0 into develop [`#5574`](https://github.com/opengovsg/FormSG/pull/5574) -- chore: bump version to v6.24.0 [`13fa4f6`](https://github.com/opengovsg/FormSG/commit/13fa4f6eb7854ef91e632d8e316d180e57bb759b) -- Revert "fix(deps): bump sqs-consumer from 5.7.0 to 6.1.0 (#5591)" [`088902d`](https://github.com/opengovsg/FormSG/commit/088902d74fe8fde365859342aaacc7b735a777a3) +- chore: bump version to v6.24.0 [`ef21f76`](https://github.com/opengovsg/FormSG/commit/ef21f76703d53d73e61d36e913167be37e48cdf3) #### [v6.23.3](https://github.com/opengovsg/FormSG/compare/v6.23.2...v6.23.3) @@ -987,13 +1028,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) @@ -1008,15 +1042,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 [`54131bd`](https://github.com/opengovsg/FormSG/commit/54131bd9c354fbb9aa478ca871817c34b1544aaa) +- 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) @@ -1035,7 +1082,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) diff --git a/CREDITS.md b/CREDITS.md index ba986f91cc..08925dd82f 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -2229,36 +2229,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## Project -toastr - -### Source -https://github.com/CodeSeven/toastr - -### License -MIT License - -Copyright (c) 2017 Toastr Maintainers - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - ------------------------------------------------------------------------------- ## Project diff --git a/__tests__/unit/backend/helpers/generate-form-data.ts b/__tests__/unit/backend/helpers/generate-form-data.ts index 799dd8bb73..69a3a72c50 100644 --- a/__tests__/unit/backend/helpers/generate-form-data.ts +++ b/__tests__/unit/backend/helpers/generate-form-data.ts @@ -13,6 +13,7 @@ import { IAttachmentFieldSchema, IAttachmentResponse, ICheckboxFieldSchema, + ICountryRegionFieldSchema, IDateFieldSchema, IDecimalFieldSchema, IDropdownFieldSchema, @@ -117,6 +118,12 @@ export const generateDefaultField = ( getQuestion: () => defaultParams.title, ...customParams, } as IDropdownFieldSchema + case BasicField.CountryRegion: + return { + ...defaultParams, + getQuestion: () => defaultParams.title, + ...customParams, + } as ICountryRegionFieldSchema case BasicField.Decimal: return { ...defaultParams, diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 60aec3a455..aa2c03e612 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "form-frontend", - "version": "6.68.0", + "version": "6.69.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "form-frontend", - "version": "6.68.0", + "version": "6.69.0", "hasInstallScript": true, "dependencies": { "@chakra-ui/react": "^1.8.6", diff --git a/frontend/package.json b/frontend/package.json index f8cbc954ce..612d3f1862 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "form-frontend", - "version": "6.68.0", + "version": "6.69.0", "homepage": ".", "private": true, "dependencies": { diff --git a/frontend/src/constants/links.ts b/frontend/src/constants/links.ts index 719942d8a0..52b38617d2 100644 --- a/frontend/src/constants/links.ts +++ b/frontend/src/constants/links.ts @@ -31,8 +31,7 @@ export const GUIDE_PREVENT_EMAIL_BOUNCE = export const GUIDE_EMAIL_RELIABILITY = 'https://go.gov.sg/formsg-guide-email-reliability' export const GUIDE_PREFILL = 'https://go.gov.sg/formsg-guide-prefills' -export const GUIDE_STRIPE_ONBOARDING = - 'https://go.gov.sg/formsg-stripe-onboarding' +export const GUIDE_STRIPE_ONBOARDING = 'https://go.gov.sg/formsg-payments' export const GUIDE_PAYMENTS_ENTRY = 'https://go.gov.sg/formsg-payment-overview' export const GUIDE_PAYMENTS_INVOICE_DIFFERENCES = 'https://go.gov.sg/formsg-payments-invoice-differences' diff --git a/frontend/src/constants/validation.ts b/frontend/src/constants/validation.ts index 6f788ae951..d9157c8b40 100644 --- a/frontend/src/constants/validation.ts +++ b/frontend/src/constants/validation.ts @@ -6,3 +6,6 @@ export const INVALID_EMAIL_DOMAIN_ERROR = export const INVALID_DROPDOWN_OPTION_ERROR = 'Entered value is not a valid dropdown option' + +export const INVALID_COUNTRY_REGION_OPTION_ERROR = + 'Please select a valid country/region from the dropdown list' diff --git a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/FieldRow/FieldRowContainer.tsx b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/FieldRow/FieldRowContainer.tsx index 3759fc554c..9a362b47e5 100644 --- a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/FieldRow/FieldRowContainer.tsx +++ b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/FieldRow/FieldRowContainer.tsx @@ -25,6 +25,7 @@ import { AttachmentField, CheckboxField, ChildrenCompoundField, + CountryRegionField, DateField, DecimalField, DropdownField, @@ -482,6 +483,8 @@ const FieldRow = ({ field, ...rest }: FieldRowProps) => { return case BasicField.Dropdown: return + case BasicField.CountryRegion: + return case BasicField.ShortText: return case BasicField.LongText: diff --git a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/PaymentView.tsx b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/PaymentView.tsx index e7a738183b..fab0fa421a 100644 --- a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/PaymentView.tsx +++ b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignContent/PaymentView.tsx @@ -11,6 +11,7 @@ import Tooltip from '~components/Tooltip' import { PaymentPreview } from '~templates/Field/PaymentPreview/PaymentPreview' import { useAdminForm } from '~features/admin-form/common/queries' +import { useDesignColorTheme } from '~features/admin-form/create/builder-and-design/utils/useDesignColorTheme' import { CreatePageSidebarContextProps, @@ -59,6 +60,7 @@ export const PaymentView = () => { }) const paymentRef = useRef(null) + const colourTheme = useDesignColorTheme() useEffect(() => { if (paymentState === PaymentState.EditingPayment) { @@ -113,7 +115,7 @@ export const PaymentView = () => { > diff --git a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/EditFieldDrawer.tsx b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/EditFieldDrawer.tsx index 5dbd3889c2..aaddf23aac 100644 --- a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/EditFieldDrawer.tsx +++ b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/EditFieldDrawer.tsx @@ -28,6 +28,7 @@ import { import { EditAttachment, EditCheckbox, + EditCountryRegion, EditDate, EditDecimal, EditDropdown, @@ -130,6 +131,8 @@ export const MemoFieldDrawerContent = memo( return case BasicField.Dropdown: return + case BasicField.CountryRegion: + return case BasicField.Mobile: return case BasicField.HomeNo: diff --git a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditCountryRegion/EditCountryRegion.stories.tsx b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditCountryRegion/EditCountryRegion.stories.tsx new file mode 100644 index 0000000000..98fe7db376 --- /dev/null +++ b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditCountryRegion/EditCountryRegion.stories.tsx @@ -0,0 +1,51 @@ +import { Meta, Story } from '@storybook/react' + +import { CountryRegion } from '~shared/constants/countryRegion' +import { BasicField, CountryRegionFieldBase } from '~shared/types' + +import { createFormBuilderMocks } from '~/mocks/msw/handlers/admin-form' + +import { EditFieldDrawerDecorator, StoryRouter } from '~utils/storybook' + +import { EditCountryRegion } from './EditCountryRegion' + +const DEFAULT_COUNTRY_REGION_FIELD: CountryRegionFieldBase = { + title: 'Storybook Country/Region', + description: 'Some description about Country/Region', + required: true, + disabled: false, + fieldType: BasicField.CountryRegion, + fieldOptions: Object.values(CountryRegion), + globalId: 'unused', +} + +export default { + title: 'Features/AdminForm/EditFieldDrawer/EditCountryRegion', + component: EditCountryRegion, + decorators: [ + StoryRouter({ + initialEntries: ['/61540ece3d4a6e50ac0cc6ff'], + path: '/:formId', + }), + EditFieldDrawerDecorator, + ], + parameters: { + // Required so skeleton "animation" does not hide content. + chromatic: { pauseAnimationAtEnd: true }, + msw: createFormBuilderMocks({}, 0), + }, + args: { + field: DEFAULT_COUNTRY_REGION_FIELD, + }, +} as Meta + +interface StoryArgs { + field: CountryRegionFieldBase +} + +const Template: Story = ({ field }) => { + return +} + +export const Default = Template.bind({}) +Default.storyName = 'EditCountryRegion' diff --git a/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditCountryRegion/EditCountryRegion.tsx b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditCountryRegion/EditCountryRegion.tsx new file mode 100644 index 0000000000..76871a0250 --- /dev/null +++ b/frontend/src/features/admin-form/create/builder-and-design/BuilderAndDesignDrawer/EditFieldDrawer/edit-fieldtype/EditCountryRegion/EditCountryRegion.tsx @@ -0,0 +1,92 @@ +import { useMemo } from 'react' +import { FormControl } from '@chakra-ui/react' +import { extend, pick } from 'lodash' + +import { CountryRegionFieldBase } from '~shared/types/field' + +import { createBaseValidationRules } from '~utils/fieldValidation' +import FormErrorMessage from '~components/FormControl/FormErrorMessage' +import FormLabel from '~components/FormControl/FormLabel' +import Input from '~components/Input' +import Textarea from '~components/Textarea' +import Toggle from '~components/Toggle' + +import { CreatePageDrawerContentContainer } from '~features/admin-form/create/common' + +import { FormFieldDrawerActions } from '../common/FormFieldDrawerActions' +import { EditFieldProps } from '../common/types' +import { useEditFieldForm } from '../common/useEditFieldForm' + +type EditCountryRegionProps = EditFieldProps + +const EDIT_COUNTRY_FIELD_KEYS = ['title', 'description', 'required'] as const + +type EditCountryRegionKeys = typeof EDIT_COUNTRY_FIELD_KEYS[number] + +type EditCountryRegionInputs = Pick< + CountryRegionFieldBase, + EditCountryRegionKeys +> + +const transformCountryRegionFieldToEditForm = ( + field: CountryRegionFieldBase, +): EditCountryRegionInputs => { + return { + ...pick(field, EDIT_COUNTRY_FIELD_KEYS), + } +} + +const transformCountryRegionEditFormToField = ( + inputs: EditCountryRegionInputs, + originalField: CountryRegionFieldBase, +): CountryRegionFieldBase => { + return extend({}, originalField, inputs, {}) +} + +export const EditCountryRegion = ({ + field, +}: EditCountryRegionProps): JSX.Element => { + const { + register, + formState: { errors }, + buttonText, + handleUpdateField, + isLoading, + handleCancel, + } = useEditFieldForm({ + field, + transform: { + input: transformCountryRegionFieldToEditForm, + output: transformCountryRegionEditFormToField, + }, + }) + + const requiredValidationRule = useMemo( + () => createBaseValidationRules({ required: true }), + [], + ) + + return ( + + + Question + + {errors?.title?.message} + + + Description +