Add validation logic#37
Merged
MrGreenTea merged 10 commits intomainfrom Feb 14, 2025
Merged
Conversation
7fd1b67 to
cbdb21f
Compare
Contributor
Author
|
TODO:
|
MrGreenTea
requested changes
Oct 25, 2024
MrGreenTea
requested changes
Feb 14, 2025
| }, | ||
| validate(value: string, options) { | ||
| if (value && value.match(/^[a-z0-9][a-z0-9\-]+[a-z0-9]$/) == null) { | ||
| return "Es sind nur Kleinbuchstaben(a-z), Ziffern(0-9) und Bindestriche(-) erlaubt. Der slug muss mindestens 3 Zeichen lang sein. Bindestriche dürfen nich am Anfang oder Ende sein."; |
Contributor
There was a problem hiding this comment.
Suggested change
| return "Es sind nur Kleinbuchstaben(a-z), Ziffern(0-9) und Bindestriche(-) erlaubt. Der slug muss mindestens 3 Zeichen lang sein. Bindestriche dürfen nich am Anfang oder Ende sein."; | |
| return "Es sind nur Kleinbuchstaben(a-z), Ziffern(0-9) und Bindestriche(-) erlaubt. Der Slug muss mindestens 3 Zeichen lang sein. Bindestriche dürfen nicht am Anfang oder Ende sein."; |
| description: ({ value }: { value?: unknown }) => | ||
| value | ||
| ? `Eventseite erreichbar unter: https://youngvision.org/events/${value ?? ""} Entferne den slug um keine Eventseite zu generieren.` | ||
| : "Es wird keine Eventseite erstellt, weil der slug leer ist." |
Contributor
There was a problem hiding this comment.
Suggested change
| : "Es wird keine Eventseite erstellt, weil der slug leer ist." | |
| : "Es wird keine Eventseite erstellt, weil der Slug leer ist." |
| admin: { | ||
| description: ({ value }: { value?: unknown }) => | ||
| value | ||
| ? `Eventseite erreichbar unter: https://youngvision.org/events/${value ?? ""} Entferne den slug um keine Eventseite zu generieren.` |
Contributor
There was a problem hiding this comment.
Suggested change
| ? `Eventseite erreichbar unter: https://youngvision.org/events/${value ?? ""} Entferne den slug um keine Eventseite zu generieren.` | |
| ? `Eventseite erreichbar unter: https://youngvision.org/events/${value ?? ""} Entferne den Slug um keine Eventseite zu generieren.` |
allow empty slug again and more helpful description
5aeacff to
4aabdbb
Compare
MrGreenTea
approved these changes
Feb 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add validation rules: If Eventpage is enabled, require Hero Image, Content tile, content, ....