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

Streamlining Regex Validation in Neos Redirect Handler UI #101

Open
markusguenther opened this issue Oct 9, 2024 · 0 comments
Open

Streamlining Regex Validation in Neos Redirect Handler UI #101

markusguenther opened this issue Oct 9, 2024 · 0 comments

Comments

@markusguenther
Copy link
Member

markusguenther commented Oct 9, 2024

Neos currently uses separate regular expressions for validating source and target URIs in the Redirect Handler UI. These validations exist in two distinct configurations: Neos:RedirectHandler:validation and Neos:RedirectHandler:Ui:validation. This redundancy leads to:

  • Increased maintenance overhead: Maintaining consistent regex patterns across two locations is time-consuming and prone to errors.
  • Potential inconsistencies: Mismatches between the PHP and JavaScript validations can cause unexpected behavior.

We propose a centralized validation approach to simplify the process and improve consistency. This involves:

  • Server-side validation: Implement a new endpoint that accepts source and target URIs as parameters.
  • Unified regex engine: This endpoint will utilize a single, unified set of regex patterns for validation on the server-side.
  • Client-side validation integration: Refactor the JavaScript code of the Redirect Handler UI to leverage the new server-side validation endpoint. Upon user input, an asynchronous request will be sent to the server for validation.

https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation

@markusguenther markusguenther changed the title Unify regular expressions for validation Streamlining Regex Validation in Neos Redirect Handler UI Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant