neos / neos/redirecthandler-ui

Streamlining Regex Validation in Neos Redirect Handler UI

Open
#101 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature request good first issue Hacktoberfest
Dominant language
TypeScript
Stars
13
Forks
17
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Redirect Handler UI validation code and the Neos:RedirectHandler:validation and Neos.RedirectHandler:Ui:validation configurations. Then inspect existing endpoint conventions before deciding how server-side validation should accept source and target URIs. Done means one server-side validation path is used by the UI and the duplicate regular expressions no longer cause inconsistencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, typescript
Domain
api, full-stack
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.