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

feat: add UEN field #2100

Merged
merged 6 commits into from
Jun 14, 2021
Merged

Conversation

aniruddha-adhikary
Copy link
Contributor

Problem

It adds a UEN Field

Closes #1273

Solution

I added a new field in the backend, frontend admin and public frontend.

Breaking Changes

  • Yes - this PR contains breaking changes
    • Details ...
  • No - this PR is backwards compatible

Features:

  • New Field for UEN
  • Validates UEN number syntax/format

Before & After Screenshots

BEFORE:
[Imagine no UEN Fields]

AFTER:
Screenshot 2021-06-08 at 2 00 56 PM
Screenshot 2021-06-08 at 2 02 07 PM

Tests

Deploy Notes

I am not sure if adding a new field would require any sort of migration. Maintainers, please do edit if you think it needs to.

@aniruddha-adhikary aniruddha-adhikary mentioned this pull request Jun 8, 2021
Copy link
Contributor

@mantariksh mantariksh left a comment

Choose a reason for hiding this comment

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

not sure why the CI is failing, will check it out

src/app/utils/field-validation/answerValidator.factory.ts Outdated Show resolved Hide resolved
@mantariksh
Copy link
Contributor

not sure why our github actions for frontend and backend tests aren't running on this PR. I'll look into our github actions config to fix this. shouldn't be a big deal since I've run the tests locally and everything checks out.

@mantariksh
Copy link
Contributor

mantariksh commented Jun 14, 2021

@aniruddha-adhikary this lgtm but unfortunately we're not able to run the right github actions on this PR. to expedite this, I'm going to do the following:

  1. pull your commits
  2. push the commits to a branch in this repo and open a new PR so it turns out that when I pushed the commits to this repo, the relevant github actions were started. so we don't need to open a new PR
  3. deploy this to our staging environment and get the rest of the team to take a look to make sure it's okay

hopefully we can get this into production during our release tomorrow, if not next week. will keep you updated. thanks again for the contribution!

@mantariksh
Copy link
Contributor

Manual tests

Create a UEN field and check that the following UENs are valid:

  • 01234567A
  • 012345678A
  • T01LP1234Z
  • S01LP1234Z
  • R01LP1234Z

Check that the following UENs are invalid:

  • B1234567A
  • 012345678
  • 0123456789
  • A01LP1234Z
  • S01AA1234Z
  • RS1LP1234Z
  • R010P1234Z
  • R01LPL234Z
  • R01LP12345

Submit the following UEN by API and check that the backend invalidates it:

  • R01LP12345

@mantariksh mantariksh merged commit 35eeeaf into opengovsg:develop Jun 14, 2021
mantariksh added a commit that referenced this pull request Jun 15, 2021
mantariksh added a commit that referenced this pull request Jun 15, 2021
* Revert "refactor: simplify isUenValid logic (#2156)"

This reverts commit 8f0eda6.

* Revert "feat: add UEN field (#2100)"

This reverts commit 35eeeaf.

* Revert "feat: add and call v3 API for retrieving individual admin form (#2113)"

This reverts commit e55e1a9.

* Revert "chore: remove redundant ValidationOption object properties for short text, long text and number fields (#2040)"

This reverts commit 95b6297.

* Revert "feat: Add webhook support for storage mode attachments (#1713)"

This reverts commit 332d3ce.
mantariksh pushed a commit that referenced this pull request Jun 17, 2021
* add uen field in public frontend

* add essential uen types

* make sure uen field renders

* replace isUenValid with isUenField
@mantariksh mantariksh mentioned this pull request Jun 17, 2021
2 tasks
mantariksh added a commit that referenced this pull request Jun 17, 2021
* feat: add UEN field (#2100)

* add uen field in public frontend

* add essential uen types

* make sure uen field renders

* replace isUenValid with isUenField

* refactor: simplify isUenValid logic (#2156)

* refactor: simplify isUenValid logic

* fix: use stricter regex matching

Co-authored-by: Aniruddha Adhikary (Ani) <[email protected]>
@mantariksh
Copy link
Contributor

@aniruddha-adhikary this went into production today, congrats on your first FormSG feature!

@aniruddha-adhikary aniruddha-adhikary deleted the feature/uen-field branch June 22, 2021 06:31
@aniruddha-adhikary
Copy link
Contributor Author

@mantariksh 🥺 Thanks ya'all. You guys are excellent, responsible and responsive open source maintainers. ❤️ 🚀

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.

UEN field
2 participants