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

Add location field validation error to candidate school search #3159

Closed
wants to merge 9 commits into from

Conversation

ekumachidi
Copy link
Contributor

Trello card

https://trello.com/c/NLPhh1Wh/

Context

Ensure that we surface a validation error if a user tries to search for a school experience placement with no postcode on GSE

Changes proposed in this pull request

  • Enable validation option on the form
  • Updates the javascript to include an event listener that triggers the validation

@ekumachidi ekumachidi self-assigned this Apr 24, 2024
@github-actions github-actions bot added the ruby Pull requests that update Ruby code label Apr 24, 2024
@ekumachidi ekumachidi requested a review from MylesJarvis April 24, 2024 14:55
@MylesJarvis
Copy link
Contributor

Thanks @ekumachidi! A few comments from my testing of this in the preview app:

  1. For the pattern for the validation error, we need to use the Design System in its entirety, which means we should have a few additional elements to it:
  • We should surface a 'there is a problem' box at the top of the page
  • This box should contain the error message
  • The error message should be clickable, and that then shifts the focus to the input box

Here's an example of how it appears in the Find postgraduate teacher training service:
image

We also use this within GSE, for example on further down the registration flow:
image

  1. We also need to ensure that we only ever surface one error message at a time, I can create a stack of the same error message by clicking the search button repeatedly:
    image

  2. We should ensure we're consistent with content, and use a single word - 'postcode' - throughout

Context:
Ensure that we surface a validation error if a user tries to search for a school experience placement with no postcode on GSE

Changes proposed:
* Enable validation option on the form
* Updates the javascript to include an event listener that triggers the validation
Copy link
Contributor

@MylesJarvis MylesJarvis left a comment

Choose a reason for hiding this comment

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

LGTM

@MylesJarvis MylesJarvis requested a review from martyn-w April 26, 2024 16:55
@MylesJarvis
Copy link
Contributor

MylesJarvis commented Apr 26, 2024

Adding @martyn-w for a tech review on this.

Copy link
Collaborator

@martyn-w martyn-w left a comment

Choose a reason for hiding this comment

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

The autocomplete_controller.js file is raising an error on the search results page, when you click on search again:

autocomplete_controller.js:65 Uncaught (in promise) TypeError: r.submit is not a function
    at e.<anonymous> (autocomplete_controller.js:65:12)
    at p (regeneratorRuntime.js:45:16)
    at Generator.<anonymous> (regeneratorRuntime.js:133:17)
    at Generator.next (regeneratorRuntime.js:74:21)
    at s (application-24f320543daef9df5688.js:1:1558)
    at a (application-24f320543daef9df5688.js:1:1761)
    at application-24f320543daef9df5688.js:1:1820
    at new Promise (<anonymous>)
    at e.<anonymous> (application-24f320543daef9df5688.js:1:1701)
    at e.<anonymous> (autocomplete_controller.js:67:4)

Also, it might be better to create the error summary in the html layer rather than in the javascript, to allow the validations to work even if javascript is not enabled

Copy link

@martyn-w
Copy link
Collaborator

martyn-w commented May 29, 2024

Closing in favour of #3198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants