Repository navigation
Custom-Validierung für mehre als eine E-Mail mit der Validierung "multipleEmails" - #45
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds custom validation for multiple email addresses in a dynamic form component. The implementation includes a new multipleEmails validation rule that allows comma or semicolon-separated email addresses, along with improvements to the existing requiredIf validation function.
- Added
multipleEmailscustom validation rule for validating multiple email addresses - Refactored and improved the
requiredIfvalidation function with better logic and documentation - Added German localization for UI elements (download button and close button)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ui/components/UIDynamicForm.vue | Added multipleEmails validation, improved requiredIf function, and German UI translations |
| package.json | Version bump from 2.5.0 to 2.6.0 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const parts = node.value.split(/\s*[,;]\s*/); | ||
|
|
||
| // regulärer Ausdruck für gültige E-Mail | ||
| const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; |
There was a problem hiding this comment.
The email regex pattern is overly simplistic and may not handle valid email addresses with special characters, quoted strings, or other RFC-compliant formats. Consider using a more comprehensive email validation library or a more robust regex pattern that follows RFC 5322 standards.
| // Optional: Eigenschaftsflags | ||
| requiredIf.blocking = true; // bei Fehlschlag blockiert es das Formular | ||
| requiredIf.skipEmpty = true; // bei leerem Wert überspringen | ||
|
|
There was a problem hiding this comment.
The multipleEmails function lacks documentation explaining its purpose, parameters, and expected behavior. Add a JSDoc comment similar to the one provided for requiredIf to improve code maintainability.
| /** | |
| * Validates that a field contains a comma- or semicolon-separated list of valid email addresses. | |
| * | |
| * @param {object} node - The FormKit node representing the field to validate. The node's `value` should be a string containing one or more email addresses separated by commas or semicolons. | |
| * @returns {boolean} Returns `true` if all provided email addresses are valid or if the field is empty; otherwise, returns `false`. | |
| * | |
| * Example: | |
| * "user1@example.com, user2@example.com" | |
| * "user1@example.com;user2@example.com" | |
| */ |
# Changelog v2.6.0 (12.10.2025) Dieser Changelog deckt die Änderungen zwischen folgenden Versionen ab: [v2.5.0 und v2.6.0](v2.5.0...v2.6.0). Weitere Hinweise befinden sich im Changelog der vorherigen Version: [v2.5.0](https://github.com/5minds/node-red-dashboard-2-processcube-dynamic-form/releases/tag/v2.5.0). ## Merged Pull Requests - #45 Custom-Validierung für mehre als eine E-Mail mit der Validierung "multipleEmails" (merged 12.10.2025) [skip ci]
No description provided.