-
Notifications
You must be signed in to change notification settings - Fork 62
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
Issue/2159 validate settings #2233
Conversation
@Mwalek, once the unit tests are fixed and you see the build file, please test. |
@zahardev @mrcasual the validation now works with merge tags, but I identified a few issues.
|
Thanks, @Mwalek! Regarding 2 - thanks, will be fixed.
|
@zahardev, I don't think we should allow saving the View w/invalid fields. I haven't tested this PR yet and you may have already implemented this, but if there are invalid fields that are hidden (e.g., when switching from one tab to another), we should display a warning/clearly inform the user about where to find the errors. |
@mrcasual Thanks, I’ll update the UX to enable the "Update" button but prevent form submission and show a warning if invalid fields are found. |
@Mwalek Could you please check if my recent changes resolve the issues? |
@zahardev thanks! Issue 2 is resolved. However, I now see the following warning when GV is activated:
Additionally, validation does not work at all for the "Delete Entry Redirect URL" setting. |
Added validation for the "Delete Entry Redirect URL" setting. |
@zahardev the earlier issues are solved, thank you! As I was testing this time around, I noticed that the validation does not recognize merge tags in the format Additionally, the "Field is required" error message does not disappear immediately when a merge tag is selected from the dropdown. For example, if I select "Book Title" from the dropdown, it adds |
Regarding the {x} format validation - it was actually working correctly. I believe the problem occurred because the validation event wasn't triggered when a Merge Tag was selected from the dropdown (issue number two). This should be fixed now - could you please check? |
Adds a possibility to validate setting fields. Supports the following rules:
required, max, min, email, integer, matches.
Rules example:
Currently supports only frontend validation. We can improve it with a backend validation using the same validation config.
Added a "Validate URL with tags" rule for "'No Entries Redirect URL'" and "Edit Entry Redirect URL" using the "required" and "matches" rules. Here is the URL rule Regex - https://regex101.com/r/I2QSEI/1
💾 Build file (619e85c).