-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: add country field backend #3770
feat: add country field backend #3770
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting on build fixes before reviewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but let's refrain from merging yet, since this will be going into the react branch. can continue to react implementation for prefilling of fields!
f93611f
to
869dcee
Compare
869dcee
to
2313c23
Compare
updated your base branch to another one so you can squash and continue with other PRs without this dangling! |
* feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]>
* feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]>
* feat: add country field backend (#3770) * feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]> * feat: add Country field to frontend * feat: move Singapore up to the first value in the Country enum * test: add tests for CountryField * fix: update the typed characters in the partial typing test case * test: adjust test case for partial typing in Country field * refactor: rename Country enum to CountryRegion * refactor: rename BasicField.Country to BasicField.CountryRegion * refactor: rename CountryField to CountryRegionField * fix: commit renaming changes for tests/ * refactor: rename *Country* to *CountryRegion* in frontend edit field folder * feat: sort CountryRegion enums inside CountryRegionField * fix: remove removed isSaveEnabled prop * fix: inline sort country options constant * test: update CountryRegionField tests * fix(CountryRegionField): correctly set singapore as the first option also update tests to use the options that the field uses * style: use flag icon and fix capitalisation for CountryRegion * feat: allow validation rule overriding for DropdownField * fix: update error message for invalid Country/Region * test: fix country/region capitalisation in test Co-authored-by: Kar Rui <[email protected]>
* feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]>
* feat: add country field backend (#3770) * feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]> * feat: add Country field to frontend * feat: move Singapore up to the first value in the Country enum * test: add tests for CountryField * fix: update the typed characters in the partial typing test case * test: adjust test case for partial typing in Country field * refactor: rename Country enum to CountryRegion * refactor: rename BasicField.Country to BasicField.CountryRegion * refactor: rename CountryField to CountryRegionField * fix: commit renaming changes for tests/ * refactor: rename *Country* to *CountryRegion* in frontend edit field folder * feat: sort CountryRegion enums inside CountryRegionField * fix: remove removed isSaveEnabled prop * fix: inline sort country options constant * test: update CountryRegionField tests * fix(CountryRegionField): correctly set singapore as the first option also update tests to use the options that the field uses * style: use flag icon and fix capitalisation for CountryRegion * feat: allow validation rule overriding for DropdownField * fix: update error message for invalid Country/Region * test: fix country/region capitalisation in test Co-authored-by: Kar Rui <[email protected]>
* feat: add country field backend (#3770) * feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]> * feat: add CountryRegion field to frontend (#4112) * feat: add country field backend (#3770) * feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]> * feat: add Country field to frontend * feat: move Singapore up to the first value in the Country enum * test: add tests for CountryField * fix: update the typed characters in the partial typing test case * test: adjust test case for partial typing in Country field * refactor: rename Country enum to CountryRegion * refactor: rename BasicField.Country to BasicField.CountryRegion * refactor: rename CountryField to CountryRegionField * fix: commit renaming changes for tests/ * refactor: rename *Country* to *CountryRegion* in frontend edit field folder * feat: sort CountryRegion enums inside CountryRegionField * fix: remove removed isSaveEnabled prop * fix: inline sort country options constant * test: update CountryRegionField tests * fix(CountryRegionField): correctly set singapore as the first option also update tests to use the options that the field uses * style: use flag icon and fix capitalisation for CountryRegion * feat: allow validation rule overriding for DropdownField * fix: update error message for invalid Country/Region * test: fix country/region capitalisation in test Co-authored-by: Kar Rui <[email protected]> * fix: remove duplicate country files * fix: remove duplicate country field files and restore TODO * chore: rename test file * fix: add missing imports * fix: use new CreatePageDrawerContentContainer component * fix: dropdown now uses requiredSingleAnswerValidationFn for validation * fix: add validation and processing of CountryRegion fields on client * refactor: implement specific CRField instead of using DropdownField * fix: remove unused field schema regression * feat: make CountryRegion values uppercase when sent to the server * Revert "feat: make CountryRegion values uppercase when sent to the server" This reverts commit be8a9d3. * fix: use title-case country/region only in render * Revert "fix: use title-case country/region only in render" This reverts commit 589af79. * feat: transform Country/Region form inputs to upper-case on submit * fix: validate against upper-case country/region, add comments on why this is done, and remove reference to any * fix: remove reference to toString() * fix: simulate transformations from handleSubmitForm in country-region-validation.spec.ts * fix: resolve rebase and use === instead of == * fix: remove duplicate import * chore: fix prettier violations * fix: update generate-form-data import path * fix: follow DropdownField's way of querying input element and casting options * fix: update INVALID_COUNTRY_REGION_OPTION_ERROR * fix: linting * fix: use uppercased countryregion for non-fetch submission --------- Co-authored-by: Kar Rui <[email protected]> Co-authored-by: Jiayee Lim <[email protected]> Co-authored-by: Jiayee <[email protected]> Co-authored-by: tshuli <[email protected]>
* feat: add country field backend (opengovsg#3770) * feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]> * feat: add CountryRegion field to frontend (opengovsg#4112) * feat: add country field backend (opengovsg#3770) * feat: add country field backend * fix: Fix Property 'country' is missing * fix: replace BasicField.Dropdown in CountryField story * fix: import CountryField into FieldFactory * fix: fix type errors due to lack of handling for new country field Co-authored-by: Kar Rui <[email protected]> * feat: add Country field to frontend * feat: move Singapore up to the first value in the Country enum * test: add tests for CountryField * fix: update the typed characters in the partial typing test case * test: adjust test case for partial typing in Country field * refactor: rename Country enum to CountryRegion * refactor: rename BasicField.Country to BasicField.CountryRegion * refactor: rename CountryField to CountryRegionField * fix: commit renaming changes for tests/ * refactor: rename *Country* to *CountryRegion* in frontend edit field folder * feat: sort CountryRegion enums inside CountryRegionField * fix: remove removed isSaveEnabled prop * fix: inline sort country options constant * test: update CountryRegionField tests * fix(CountryRegionField): correctly set singapore as the first option also update tests to use the options that the field uses * style: use flag icon and fix capitalisation for CountryRegion * feat: allow validation rule overriding for DropdownField * fix: update error message for invalid Country/Region * test: fix country/region capitalisation in test Co-authored-by: Kar Rui <[email protected]> * fix: remove duplicate country files * fix: remove duplicate country field files and restore TODO * chore: rename test file * fix: add missing imports * fix: use new CreatePageDrawerContentContainer component * fix: dropdown now uses requiredSingleAnswerValidationFn for validation * fix: add validation and processing of CountryRegion fields on client * refactor: implement specific CRField instead of using DropdownField * fix: remove unused field schema regression * feat: make CountryRegion values uppercase when sent to the server * Revert "feat: make CountryRegion values uppercase when sent to the server" This reverts commit be8a9d3. * fix: use title-case country/region only in render * Revert "fix: use title-case country/region only in render" This reverts commit 589af79. * feat: transform Country/Region form inputs to upper-case on submit * fix: validate against upper-case country/region, add comments on why this is done, and remove reference to any * fix: remove reference to toString() * fix: simulate transformations from handleSubmitForm in country-region-validation.spec.ts * fix: resolve rebase and use === instead of == * fix: remove duplicate import * chore: fix prettier violations * fix: update generate-form-data import path * fix: follow DropdownField's way of querying input element and casting options * fix: update INVALID_COUNTRY_REGION_OPTION_ERROR * fix: linting * fix: use uppercased countryregion for non-fetch submission --------- Co-authored-by: Kar Rui <[email protected]> Co-authored-by: Jiayee Lim <[email protected]> Co-authored-by: Jiayee <[email protected]> Co-authored-by: tshuli <[email protected]>
Problem
Partially solves #481
Solution
Breaking Changes
Features:
src/public/modules/forms/services/form-fields.client.service.js
which saysUnhide Country field once the frontend for Country field is done
.Before & After Screenshots
N/A
Tests
src/app/utils/field-validation/validators/__tests__/country-validation.spec.ts