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

LIMS-1466: Disable dispatch form validation when using the shipping service #891

Conversation

ndg63276
Copy link
Collaborator

@ndg63276 ndg63276 commented Jan 9, 2025

JIRA ticket: LIMS-1466

Summary:

The dispatch request form has quite strict validation, but little of it is used (or even displayed) if the shipping service will be used. This has led to problems where a hidden field fails validation and the user doesn't know how to fix the problem. We should disable validation if the shipping service is going to be used.

Changes:

  • Move validation patterns out of model file and into functions within view file
  • Tidy some whitespace

To test:

  • Enable $use_shipping_service and $use_shipping_service_redirect in config
  • Go to a test shipment (eg /shipments/sid/63609) and click "Dispatch"
  • Change the country to eg Aruba to show the full form
  • Add illegal characters to each field, check that they go red and display an error
  • Change the country to United Kingdom, the fields should now be hidden. Check you can Proceed to the shipping service.

@gfrn
Copy link
Collaborator

gfrn commented Jan 21, 2025

image
The phone number is not verified when United Kingdom is not selected. Not sure how much of a problem that is?

@gfrn gfrn self-requested a review January 21, 2025 11:49
@ndg63276 ndg63276 changed the base branch from master to pre-release/2025-R1.2 January 28, 2025 09:47
@ndg63276 ndg63276 merged commit f996391 into pre-release/2025-R1.2 Jan 28, 2025
2 checks passed
@ndg63276 ndg63276 deleted the fix/LIMS-1466/disable-dispatch-validation-when-using-shipping-service branch January 28, 2025 10:59
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.

2 participants