Skip to content

Fix ultimate trial/duo pro trial lead form phone number validation

Roy Liu requested to merge 456330-trial-form-phone-number-validation-fix into master

What does this MR do and why?

Resolves #456330 (closed). The original pattern ^(\+)*[0-9-\s]+$ causes the browser to error out on invalid character class, specifically hyphen.

The problem exists in Chrome, Firefox and Safari. Fix works for all three browsers.

Screenshot_2024-04-15_at_3.40.53_PM

The test fails to capture this, possibly due to the limitation of different JavaScript environments: https://gitlab.com/gitlab-org/gitlab/-/blob/ed3e6e29e68093b34149f9bd186a39aea7c22c33/ee/spec/frontend/trials/components/trial_create_lead_form_spec.js#L84

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Login as a user
  2. Visit /-/trials/new for the form
Edited by Roy Liu

Merge request reports