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

#162: Add Form Validation to Institutional Representative Page #180

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

surajgoraya
Copy link
Member

@surajgoraya surajgoraya commented Jan 30, 2025

Summary

Adds the zod validation schema for the Institutional Representative Page. In addition, like verbally discussed in our meeting - if it ends up being possible for institutions outside of Canada to collaborate on projects, the country text box is now a dropdown instead, which displays various countries and territories.

Related Issues

Description of Changes

Special Instructions

You may need to (re)build the @pcgl-validation package which contains the zod validation schemas before running the project

# in the root of the project folder
pnpm build:all

UI

  • Adds a drop down for country selection as discussed in our meeting (to both applicant info and institutional info pages), however this can be disabled if not needed.
    • The browser unfortunately does not have a standard list for this, so the country list is pulled from the Government of Canada's Data Reference Standard on Countries, Territories and Geographic areas. With all countries, territories, and geographic areas labeled as ACTIVE used. Both English and French names are stored.
    • This data is licensed under the Open Government License - Canada license, as noted in the comment above the constant.
    • On selection of a country, the countries ISO3 code (example: CAN) is the value provided to save into the DB. Canada is selected by default.
  • Standardizes the personal title drop down.
  • Adds institutional representative page validation schema to the packages/pcgl-validation/src/schemas.ts file which validates inputed text according to the spec.
  • Enables the use of browser-level auto-complete in our text fields. This is a accessibility best practice (see here: https://design-system.service.gov.uk/patterns/names/#:~:text=Use%20the%20autocomplete%20attribute%20on%20name%20fields)
  • Fixes a bug where edit button wouldn't direct properly to app edit page.

Readiness Checklist

  • Self Review

    • I have performed a self review of code
    • I have run the application locally and manually tested the feature
  • PR Format

    • The PR title is properly formatted to match the pattern: #{TicketNumber}: Description of Changes
    • Links are included to all relevant tickets
  • Labels Added

    • Label is added for each package/app that is modified (api, ui, data-model, etc.)
    • Label is added for the type of work done in this PR (feature, fix, chore, documentation)
  • Local Testing

    • Successfully built all packages locally
    • Successfully ran all test suites, all unit and integration tests pass
    • Screenshot of Tests
  • Updated Tests

    • Unit and integration tests have been added that describe the bug that was fixed or the features that were added
  • Documentation

    • All new environment variables added to .env.schema file and documented in the README
    • All changes to server HTTP endpoints have open-api documentation
    • All new functions exported from their module have TSDoc comment documentation

JamesTLopez and others added 26 commits January 27, 2025 12:32
- remove form onFinish and trigger submission throw rhf
- add check if onSubmit is present, otherwise use normal next button
  flow
…into 162-form-validation-institutional-rep-page
…into 162-form-validation-institutional-rep-page
…into 162-form-validation-institutional-rep-page
A11Y best practices usually are to allow browser-level auto-complete to be enabled for most text fields
@surajgoraya surajgoraya marked this pull request as ready for review January 30, 2025 19:26
*
* **Last Updated: Jan 28th, 2025**
*
* @license https://open.canada.ca/en/open-government-licence-canada
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't believe they'd be any licensing issues but I just want to note that the data within this function is under OGL-C licensing (https://open.canada.ca/en/open-government-licence-canada).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Form Validation - Institutional Rep Page
2 participants